Setup OpenCL in Visual Studio 2010

I just got the CUDA samples compiling in Visual Studio 2010 with Nsight 1.5 but when I try to run the OpenCL samples from nVidia’s sample colection I run into problems.

The sample projects are VS2008 projects and even if I open them in VS2008 (which I have installed since I need the old compiler for CUDA) I get the following compile error:

1>LINK : fatal error LNK1104: cannot open file 'oclUtils32D.lib'

Can anyone give me a guide to how I setup a simple project in VS2010 that uses nVidia OpenCL?

I just got the CUDA samples compiling in Visual Studio 2010 with Nsight 1.5 but when I try to run the OpenCL samples from nVidia’s sample colection I run into problems.

The sample projects are VS2008 projects and even if I open them in VS2008 (which I have installed since I need the old compiler for CUDA) I get the following compile error:

1>LINK : fatal error LNK1104: cannot open file 'oclUtils32D.lib'

Can anyone give me a guide to how I setup a simple project in VS2010 that uses nVidia OpenCL?

MSVS spits out this error when it can’t find one of the files needed during the linking process. Try project → properties → linker → General → Additional Library Directories and make sure one of them points to the directory containing that file. Also, make sure your project dependencies are set correctly, sometimes if one project depends on another and you try to compile it, it will compile them in the wrong order and try to run the linker before the object file is created. In this case, setting the dependencies or right clicking on the project that didn’t build correctly and selecting “project only → rebuild” will fix it.

MSVS spits out this error when it can’t find one of the files needed during the linking process. Try project → properties → linker → General → Additional Library Directories and make sure one of them points to the directory containing that file. Also, make sure your project dependencies are set correctly, sometimes if one project depends on another and you try to compile it, it will compile them in the wrong order and try to run the linker before the object file is created. In this case, setting the dependencies or right clicking on the project that didn’t build correctly and selecting “project only → rebuild” will fix it.

I found these release notes for OpenCL: http://developer.download.nvidia.com/compute/cuda/3_2/sdk/docs/OpenCL_Release_Notes.txt

It says that I can find the headers and libs necessary in “NVIDIA GPU Computing SDK\OpenCL\common\inc\CL”, however I can’t find that folder. The closest I get is “C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\OpenCL” but that directory only contains folders named bin and src. I have installed Nsight 1.5 but does that contain both the OpenCL SDK or just the CUDA SDK? Do I need to install another SDK and what should I install?

Thanks for trying to help me.

I found these release notes for OpenCL: http://developer.download.nvidia.com/compute/cuda/3_2/sdk/docs/OpenCL_Release_Notes.txt

It says that I can find the headers and libs necessary in “NVIDIA GPU Computing SDK\OpenCL\common\inc\CL”, however I can’t find that folder. The closest I get is “C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\OpenCL” but that directory only contains folders named bin and src. I have installed Nsight 1.5 but does that contain both the OpenCL SDK or just the CUDA SDK? Do I need to install another SDK and what should I install?

Thanks for trying to help me.

I’m still testing only on Linux, so don’t take my comments too seriously.

I remember that before I could compile SDK samples, I had to compile the libs (mainly ‘oclUtils32D.lib’). So use the oclRelease.sln mentioned in SDK release notes or find the VS project, which compiles those libraries. Hope it will help a bit.

I’m still testing only on Linux, so don’t take my comments too seriously.

I remember that before I could compile SDK samples, I had to compile the libs (mainly ‘oclUtils32D.lib’). So use the oclRelease.sln mentioned in SDK release notes or find the VS project, which compiles those libraries. Hope it will help a bit.