openCL Newbie

Profile : Research Scholar with no background of GP

System Info :Win 7, nVidia GT218(1 GB)

Intentions: Wish to learn openCL

Help : What toolkit is needed to develop/compile openCL applications?

All you need is the NVIDIA driver ( You don’t need NVCC or the CUDA toolkit. You can compile with your standard compiler.

Quickest way to get up and running is to use ArrayFire for OpenCL, download here:

Thanks for the quick response.

I have the display driver version : Forceware 275.33,is this ok?

Which compiler should i preferably use?

The 275.33 driver is probably good, but I always recommend updating the driver if things don’t end up working.

In Windows, Visual Studio is typically used. I like Visual Studio 2008.

Sorry, this is wrong. You also need the OpenCL header files and libraries. While it’s true that the OpenCL ICD (OpenCL.dll) comes with the NVIDIA display driver, the import library that you need to link against (OpenCL.lib) does not. You need to install the NVIDIA GPU Computing SDK for that, which also comes with the header files.

Thanks a lot.

1.Is it the Cuda Toolkit which is required? The nvidia GPU computing SDk is directing me here.

2.Kindly also instruct step wise procedure.

I have installed Visual Studio 10 and Arrayfire(would install CUDA toolkit too,if u say so)

ArrayFire OpenCL is easy to use. You don’t need the NVIDIA toolkit. Just unzip ArrayFire OpenCL Windows package and open any of the examples in VS 2008 and you should be able to compile and run them. You may modify them as per your need. ArrayFire OpenCL package contains the necessary OpenCL.lib to link against and also contains the header files in ArrayFire_Unzipped/include/CL directory.

Note that ArrayFire OpenCL library is not compatible with VS 2010.

Yes, do develop OpenCL kernels without ArrayFire, you would need additional header files. Here is the relevant link: On that page is says, “Please note that you may need to install the latest NVIDIA drivers and CUDA Toolkit to compile and run the code samples. Refer to the SDK release notes for more information.”

oh so this means:

  1. i need to uninstall VS 2010 and install VS 2008

  2. I am still confused on using the nvidia CUDA Toolkit.

Yes, that is the best approach.

You do not need most of the things in the CUDA toolkit (e.g. you don’t need nvcc). The only thing you need beyond the NVIDIA driver is the OpenCL headers. I believe that the headers are in the OpenCL SDK, but it has been awhile and they may now be in the CUDA toolkit install. I suggest installing the OpenCL SDK first and see if they are there.

Thanks for the reply.

I am trying to run the arrayfire sample helloworld.cpp in VS 2008.

The following error is being displayed:

1>Project : error PRJ0019: A tool returned an error code from “Performing Custom Build Step”

1>Build log was saved at “file://c:\softwares\arrayfire openCL\ArrayFire-0.3-OpenCL-win\ArrayFire-0.3-OpenCL-win\examples\Release\BuildLog.htm”

1>helloworld_vs2008 - 1 error(s), 0 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  1. Try running the binaries shipped with ArrayFire OpenCL from Arrayfire_Unzipped/bin{32/64} directory to see if you system is configured correctly.

  2. I don’t get any error in the custom build step. But you can change the project configuration and remove any actions in the custom build step, which is essentially copying the compiled binary from a temporary directory to bin{32/64} folder. You can do this manually. The bin{32/64} contains the DLLs you need to run the binaries.

That’s interesting. I was trying to find out whether it’s allowed to redistribute OpenCL.lib with our own application’s SDK here, but I did not receive any answer yet. How did you manage to get permission to redistribute OpenCL.lib?

OpenCL.lib is generic, I found that you can actually use the AMD version to run on NVIDIA and vice versa.

The OpenCL.lib and headers used to come with the SDK but they were moved to the toolkit, not sure with what version though (3.2 or 4.0 if I’m not mistaken).

I didn’t use the accelereyes solution so I don’t know what it does or why it’s VS 2008 only, but with the CUDA toolkit you can use visual 2010 as well.

I can run the binary(helloworld and blackscholes) from the bin64 folder(so the system is configured correctly.)

But when i try to debug the project it gives , ‘clAmdBlas.dll’ missing error.

is this a CUDA toolkit file. Then ,I need to install CUDA?

I got MSVCR100.dll and MSVCP100.dll missing errors for conv and fft(examples in bin64) . but then i manually copied them to windows\system32 folder.

The error displayed is :

The application was unable to start correctly(0xc000007b)

It’s working fine for me.

Please download the package again if you are having issues building. Should work.

clAmdBlas from the name of it is an AMD dll, not a NVIDIA one. NVIDIA can’t debug OpenCL code at the moment (you can only debug the host side, not the device side). To debug device code you need to either use CUDA or and AMD GPU with gRemedy debugger (Intel may have gotten to the point of debugging on the CPU, not sure though).