Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Started with OpenCL on Windows 7

Tags:

opencl

I am trying to get OpenCL up and running on a Windows 7 machine. The machine has an NVIDIA GEFORCE GT 520M with driver version 8.17.12.6721.

Does anyone know about getting started with GPU computing in OpenCL on Windows? Or of a good in-depth resource for getting it all set up? To make this question more specific, I guess I would like to know a) what SDK's and additional files must I download and install on top of the NVIDIA driver and b) how do I compile and run OpenCL code on Windows.

like image 366
follyroof Avatar asked Sep 05 '11 06:09

follyroof


People also ask

Does my graphics card support OpenCL?

All CPUs support OpenCL 1.2 only. NVIDIA: NVIDIA GeForce 8600M GT, GeForce 8800 GT, GeForce 8800 GTS, GeForce 9400M, GeForce 9600M GT, GeForce GT 120, GeForce GT 130, ATI Radeon 4850, Radeon 4870, and likely more are supported. Apple (MacOS X only is supported)


3 Answers

There is no magic to it.

a) You have to install the CUDA SDK

b) To correctly #include the OpenCL header you just need to set the include path of your IDE you to include/CUDA/CL of the SDK you just installed, and link against the OpenCL.lib. That's it!

I can't describe it in detail if I don't know whether you are using Eclipse or Visual Studio or what, but if you don't know yet how to set the include path, there should be tons of instructions to be found via google.

like image 67
w-m Avatar answered Sep 20 '22 22:09

w-m


If you are using Visual Studio then you would need to add the include and lib folders to your project as well as adding OpenCL.lib in order for everything to compile correctly. Also you would need to use the #include"CL/cl.h" command in your code.

like image 39
patemotter Avatar answered Sep 18 '22 22:09

patemotter


I have ported an autotool-based project to Windows. You need MingW+msys environment to make autotool and gcc work. Then an OpenCL library is required to build the complete application.

I downloaded an OpenCL sample on nvidia developer's zone, and find the OpenCL.lib for x64 then you need reimp to convert the OpenCL.lib to libOpenCL.a , and copy the libOpenCL.a to mingw's system library path.

like image 39
BiaoWang Avatar answered Sep 20 '22 22:09

BiaoWang