cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

firespot
Adept I

crash on SDK 2.7 if concurrently using alternative platforms

Hi community,

So far I have successfully used SDK 2.6. This is on a machine with an Intel CPU and an Nivida graphics card, where besides the AMD SDK I have also installed the Nvidia GPU-computing SDK 4.1.28 and Intel OpenCL SDK 2012 (2.0) to enable Nvidia-GPU device and Intel CPU device, respectively - they support OpenCL 1.1. OS is Win7 64, development done using VS 2008 and using the AMD SDK header and lib files.

Using this config I could use all three platforms (detect platforms, fetch devices, uses devices). I have now upgraded to AMD SDK 2.7 and encountered errors. First, the default-loaded Opencl.dll loaded from Windows\SysWoW64 was an old one and I have received "clRetainDevice not found" errors. I then forced my app to use the dlls that ship with the new 2.7 SDK. The program starts but if I access any of the Nvidia or Intel devices (through a call to cl::Platform::getDevices), it crashes with an unhandled exception from the function

static cl_int ReferenceHandler<cl_device_id>::retain(cl_device_id device);

which is enabled through the preprocessor command #if defined(CL_VERSION_1_2).

It doe not crash if access the AMD driven CPU-device this way.

My other platforms / devices do not support OpenCl 1.2. I then proceeded to edit the cl.h that ships with SDK 2.7 and there #undefined CL_VERSION_1_2, where now I start getting different runtime errors (depending on device invoked, but also if the AMD platform is invoked).

Conclusion: I can't get 2.7 getting work if additional platforms (supporting OpenCL 1.1) are installed and to be used. So ... how would I do that?

Let's generalize the question also: Suppose multiple OpenCL-APIs are installed concurrently to enable the respective platforms / devices. What is the proper way to integrate them (use the different devices concurrently) by the same program? So far just including the AMD SDK 2.6 header and lib versions did work and all platforms were correctly running, but I always suspected binary compatibility problems might be ahead this way - which I suppose I have hit now by upgrading to 2.7?

EDIT: switched to the header and lib files provided by the Intel SDK, and all is working without problem so far; though of course some residual binary compatibility problem might be hidden yet. Seems one must use an SDK implemented on the lowest OpenCL specification of any SDKs used on the system.

thanks !

0 Likes
3 Replies
Wenju
Elite

hi  firespot :

i think  you can try add '#define CL_USE_DEPRECATED_OPENCL_1_1_APIS'

in you apps, good luck ☺

0 Likes

Hi Wenju,

This doesn't change the observed behaviour by any means; i.e. using the AMD APP 2.7 SDK header and lib files it still crashes, and using the Intel SDK files it works the same as without #defining that. Of course, it might resolve an incompatibility issue I have not come across yet.

It could be that I am still lucky yet as all my devices support OpenCL 1.1 only, as far as I know; hence no implementation would produce binary execution code for 1.2, and hence the 1.1 lib files work.

But my main question remains, if multiple SDKs are installed and to be used concurrently on the same machine, supporting different OpenCL versions, and let's also say different devices support different OpenCL versions (and thus it may also happen that e.g. a CPU device supports 1.2, and a given SDK supports 1.2 for that device while another only supports 1.1), what's the correct procedure (#defines, header and lib files used etc) to ensure all components work seemlessly and binary compatible?

0 Likes

Since version 2.7 sdk opencl 1.2 standard, you should first check the your nVidia device drivers support open cl 1.2

0 Likes