Using the CPU with StreamSDK

Since NVIDIA’s implementation of OpenCL doesn’t support the CPU, I was wondering if some of you managed to get it working with ATI’s Stream SDK?

I tried a basic example, where I actually just detect existing OpenCL devices, and compiled it linking it to StreamSDK’s libs and headers. I had no success though.

I’m avoiding installing the SDK as I still want to use NVIDIA’s for the GPU. However, I need to perform a couple of tests with the CPU. Any help?

Define “had no success”. Compilation error? Runtime error? What kind? Unable to find AMD’s OpenCL.dll? Wrong results?

What code did you try to run? Which NVIDIA driver version, which AMD SDK version?

Sorry, you’re right, I should have given more details.

The code I’m trying to run just adds to arrays (for testing purposes). It doesn’t ouput any error or any of that, just doesn’t give the expected output (contrary to using the GPU).

The only thing different I’m doing is use

clGetDeviceIDs(clPlatformIDs[0], CL_DEVICE_TYPE_CPU, 1, &cdDevice, NULL);

instead of “CL_DEVICE_TYPE_GPU”, and use Stream SDK’s lib and headers.

Should work, right?

This is something I’m interested in as well, and have read several threads on the subject both here and at the Khronos forums. What I still miss though is an explicit, step-by-step guide of what is required to do in order to get NVIDIA GPU and AMD CPU OpenCL to co-exist on the same system. I’ve seen comments about copying and renaming .dll-files and the like but it doesn’t feels like that is the correct way to do things.

Right now, with the newest drivers, the guide goes:

  1. Download and install Forceware 197.13 or newer

  2. Download AMDs Stream SDK (newest version is 2.0.1 at the time of writing)

  3. Run AMDs Stream SDK installer which will unpack the installation files to a temporary folder (by default C:\ATI iirc)

  4. If you have an ATI video card, just run Setup.exe (not tested, don’t have one) and go to step 5
    4a. If you don’t, navigate to C:\ATI\SUPPORT\streamsdk_2-0-1_winXXX\Packages\Apps
    4b. Inside there are ATIStreamSDK_Dev and ATIStreamSDK_Samples folders, run the .msi files from both - this installs, respectively, the OpenCL runtime and code samples even if you don’t have an ATI GPU.

  5. Run CLInfo.exe from AMD’s samples that you’ve installed. It should list devices from both platforms, just like that.

There’s no need to shuffle .dlls anymore (since Forceware 197.13). It should just work.

Note: Nvidia’s oclDeviceQuery will only list nv hardware - this is how it’s written, in code they explicitly select only their platform unless there’s no other option - pay no mind to that.
Note 2: Tested on Windows 7 x64 with a GF 8800 and an Intel CPU

I’ve tried this procedure on my setup (Win2003R2 x64, Athlon X2, GF8800GT) and:

  1. AMD samples work well and detect both platforms
  2. nVidia samples and my own programs detect only one platform (CUDA), even if I link against AMD libs!!! So, nVidia DLL must be loading somehow here :-O
    EDIT: I’ve started developing my code on AMD, so I’ve never used nV SDK functions to detect devices (just plain clGetPlatformIDs() and stuff).
    What could I have done wrong?
    EDIT2: Win reset solved it. Now it detects everything when linked against AMD libs.

I’ve tried this procedure on my setup (Win2003R2 x64, Athlon X2, GF8800GT) and:

  1. AMD samples work well and detect both platforms
  2. nVidia samples and my own programs detect only one platform (CUDA), even if I link against AMD libs!!! So, nVidia DLL must be loading somehow here :-O
    EDIT: I’ve started developing my code on AMD, so I’ve never used nV SDK functions to detect devices (just plain clGetPlatformIDs() and stuff).
    What could I have done wrong?
    EDIT2: Win reset solved it. Now it detects everything when linked against AMD libs.

OpenCL.libs supplied by AMD and nVidia are identical, you can link to either.

OpenCL.libs supplied by AMD and nVidia are identical, you can link to either.