OpenCL: first investigations with an NVIDIA card

Posted on 24 February 2010 in GPU Computing, Programming

I'm taking a look at OpenCL at the moment, with the vague intention of hooking it up to Resolver One. In case you've not heard about it, OpenCL is a language that allows you to do non-graphical computing on your graphics card (GPU). Because GPUs have more raw computational power than even modern CPUs, in the form of a large number of relatively slow stream processors, this can speed up certain kinds of calculations -- in particular, those that are amenable to massive parallelisation.

Until recently, the two main graphics card manufacturers had their own languages for this kind of general-purpose GPU computing; NVIDIA had CUDA, and ATI/AMD had their Stream technology. OpenCL was created as a way of having one language that would work on all graphics cards, so although the tools for developing using it are not currently as good as those for CUDA (which has been around for a long time and has great support), as a longer-term investment OpenCL looks to me like the best one to be looking at.

It took a little bit of work to get something up and running on my machine here at work, so it's probably worth documenting to help others who are trying the same.

I'm doing this using a machine with an NVIDIA GeForce 8600 GT graphics card; it's a bit old, but it can run CUDA, and (as you might expect) NVIDIA's OpenCL implementation is build on top of CUDA. So this description will probably only help people trying to get stuff working using NVIDIA cards. I have a laptop with an ATI card at home, and I'll try installing it all there some other time and write that up too.

Here's what I did, including mis-steps and error messages:

So, that's how I got it all installed and running. Next time I'll write about something a little more interesting, like how the programs are structured, or even how to call OpenCL from IronPython applications like Resolver One.