2

I tried to get list of platforms beform calculating:

vector<cl::Platform> platforms;
cl::Platform::get(&platforms);

but have an exception:

unhandled exception in "0x00000000" in "Test.exe": 0xC0000005: Access violation.

I have Radeon Mobility HD 5730, it supports only OpenCL v 1.0. I tried use SDK from AMD and Intel last versions, but results were the same. May it depands on sdk version? Could you help me solve this problem?

Pavel
  • 71
  • 8
  • Павел, did you try running your OpenCL app on CPU? CL_DEVICE_TYPE_GPU vs CL_DEVICE_TYPE_CPU? – Severin Pappadeux Jan 06 '16 at 16:53
  • @SeverinPappadeux, I tried use clCreateContextFromType(0, CL_DEVICE_TYPE_CPU, NULL, NULL, &errcode); but it did not help. the same error. Do you mean this? – Pavel Jan 06 '16 at 17:14
  • Yes, if you repeat problem on CPU and GPU, most likely it is somewhere in your code. I understand you have really few lines of code, but this is usually first indication of something wrong. Did you try to get a stack trace? Easier to get it on CPU – Severin Pappadeux Jan 06 '16 at 17:49
  • @SeverinPappadeux, it's the first lines before other code. I try to initialize openCL and then use it. – Pavel Jan 06 '16 at 17:54
  • By the way, did you try to run your app as an administrator? – Severin Pappadeux Jan 06 '16 at 18:09
  • @SeverinPappadeux, I run always app as admin, no effect – Pavel Jan 06 '16 at 18:17
  • well, I'm at lost here. Apparently, your code is trying to access something at address 0x00000 (dereference null pointer?) and quite logically get access violation (famous error code 0xC0000005). You could try to get stack trace, or back trace. Try to run it under `windbg`, that's the only advice I have. Good luck! – Severin Pappadeux Jan 06 '16 at 18:36
  • You have some problem linking your OpenCL lib, since it is crassing with null pointers everytime you are calling OpenCL API functions. It is not related to the SDK or the C++ code. You are saying that you are initializing the code then using it, doe sthat mean you are using a dynamic dll loading? There may be some problem there. – DarkZeros Jan 07 '16 at 14:55
  • I have seen systems where calling clGetPlatformIDs (which, under the C++ wrapper code, this code is doing) causes and exception. It was usually caused by a broken driver. I'd suggest re-installing drivers for your OpenCL device(s). – Dithermaster Jan 10 '16 at 18:57

0 Answers0