I’m working on optimizing some OpenCV algorithms with OpenCL. I have an ATI graphics card and run Ubuntu 10.04. To familiarize myself with OpenCL I’m following enja’s Adventures in OpenCL tutorial. Unfortunately before I can get familiar with OpenCL, I have to install it! This was not terribly easy to figure out. Now that it’s done though, it’s a piece of cake. So I’m sharing what I had to do to get OpenCL running on my Ubuntu+ATI system.
Before OpenCL can utilize your graphics card, you need a driver which can give you that control. The new ATI Catalyst 10.7 driver is running great on my system. Don’t download it from there though, it’s a real pain to install. There is a script written to take care of it for you below.
Ubuntu 10.04 – i386
wget http://mathnathan.com/wp-content/uploads/2010/08/aticatalist10_7_i386.txt chmod +x aticatalist10_7_i386.txt ./aticatalist10_7_i386.txt
Ubuntu 10.04 – amd64
wget http://mathnathan.com/wp-content/uploads/2010/08/aticatalist10_7_amd64.txt chmod +x aticatalist10_7_amd64.txt ./aticatalist10_7_amd64.txt
Once the new driver is installed you want to hit a rebot and make sure it all went smoothly.
Next you need the ATI Stream SDK. This has all the OpenCL libraries. Once you’ve got it, extract it to a location of your choice using something like…
For 32 bit installation
cd /path/to/chosen/location tar -xvzf /path/to/download/ati-stream-sdk-v2.2-lnx32.tgz
For 64 bit installation
cd /path/to/chosen/location tar -xvzf /path/to/ati-stream-sdk-v2.2-lnx64.tgz
Now you need to set some environment variables. Add these to your .bashrc file.
32 bit Installation
vim ~/.bashrc export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/path/to/ati-stream-sdk-v2.2-lnx32 /lib/x86/" export LIBRARY_PATH=$LIBRARY_PATH":/path/to/ati-stream-sdk-v2.2-lnx32 /lib/x86/" export C_INCLUDE_PATH=$C_INCLUDE_PATH":/path/to/ati-stream-sdk-v2.2-lnx32 /include/"
64 bit Installation
vim ~/.bashrc export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/path/to/ati-stream-sdk-v2.2-lnx64 /lib/x86/" export LIBRARY_PATH=$LIBRARY_PATH":/path/to/ati-stream-sdk-v2.2-lnx64 /lib/x86/" export C_INCLUDE_PATH=$C_INCLUDE_PATH":/path/to/ati-stream-sdk-v2.2-lnx64 /include/"
Lastly you need to download the icd-registration.tgz file, and extract it to your /etc folder…
cd / sudo tar xzf /path/to/icd-registration.tgz
Extracting it in the / directory automatically puts both atiocl32.icd, and atiocl64.icd in the /etc/OpenCL/vendors directory.
That’s all there was to it for me. After this I was able to compile enja’s programs and follow the rest of his tutorials. Good luck!