cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

fyfy
Journeyman III

Error code -2 (Device not availaible) when running clCreateContextFromType

Hello Everyone,

I'm currently retesting some OpenCL code and I recently had a problem on my code. When I'm trying to get the device list on my computer with the C++ Wrapper function ... I get a error -2 (CL_DEVICE_NOT_AVAILABLE) on clCreateContextFromType.

At the beginning, I though that this was because some drive letters on my computers have changed (new disks ) but it wasn't. Next, I though that it was because I've updated drivers, so I backward it but it don't work too.

The strangest is that it worked some weeks ago (end of november) just before I update my drivers from july to december.

To get the list of devices, I use this :

cl::Context myCtx = cl::Context(CL_DEVICE_TYPE_ALL, 0, NULL, NULL, &errorCode);

I'm running a Windows 7 x64 with a AMD Radeon RX 560

Could you help me to solve my problem ??

Thank you in advance

FyFy

Tags (1)
0 Kudos
Reply
2 Replies
dipak
Staff
Staff

Re: Error code -2 (Device not availaible) when running clCreateContextFromType

Thank you for reporting it.

Please share the clinfo output and the driver information. Also, it would be helpful if you mention the driver version where the code worked earlier.

Thanks.

0 Kudos
Reply
fyfy
Journeyman III

Re: Error code -2 (Device not availaible) when running clCreateContextFromType

Hello,

Thank you for your quick answer.

Today, I seem to have resolved my problem. In fact, I used the default platform (ID 0) which on clinfo correspond to "Experimental OpenCL 2.1 CPU Only Platform" which correspond the Intel OpenCL SDK (I have forgotten that I had installed for my Xeons).

I tested in selecting the good platform and it seems to work.

Thank you

0 Kudos
Reply