Tuesday, 17 May 2011

Since I work with OpenCL a lot and yesterday I found out that Intel's OpenCL is now finally available for Linux, I thought I'd share a few words of how to get it to work on Ubuntu (even though Intel currently provides only a rpm package for RHEL and Suse).

First of all, I'm testing all of this on Lucid 64bit, but I suppose it'd work also on newer Ubuntu releases (though you need to be using 64bit version, cause the Intel package is for 64).

The package is nice and also installs OpenCL headers in /usr/include/CL. Also the main binary (libOpenCL.so) is installed in /usr/lib64 - if you don't have any other OpenCL platform installed on your system, I suggest moving it to /usr/lib (run `sudo ldconfig` afterwards), if you do have this library already (for example nvidia driver also contains it) just leave it there.

Since the libraries are installed in non-standard location for Ubuntu (/usr/lib64/OpenCL/vendors/intel), you'll need to adjust your LD_LIBRARY_PATH. I usually do this using a script, but you can just run:export LD_LIBRARY_PATH=/usr/lib64/OpenCL/vendors/intel:$LD_LIBRARY_PATH

Running a OpenCL program that just lists available platforms should return now at least one platform. Or if you have multiple platforms including their ICDs installed you'd get something like:

I get the message: "intel_ocl_sdk_1.5_x64.rpm is for architecture amd64 ; the package cannot be built on this system" when trying to convert the rpm package. Does anyone have a solution for this? I try to convert on a ThinkPad T60 with Core2Duo T2400 processor. Ubuntu 11.10