Specifications
I run Ubuntu 10.04 on a 64-bit machine with a quad-core AMD Phenom II X4 955 Processor and a GeForce 9600 GT nVidia 512 MB card. The issues documented here relate largely to Ubuntu 10.04.
Install the CUDA toolkit
This is reasonably straightforward. Note that the latest version of the toolkit is for Ubuntu 9.04.
2 | chmod +x cudatoolkit_3.0_linux_64_ubuntu9.04.run |
3 | sudo ./cudatoolkit_3.0_linux_64_ubuntu9.04.run |
The installer asks where you would like to install the toolkit. I chose /opt/cuda, over the default /usr/local/cuda. You then add /opt/cuda/bin to your PATH and /opt/cuda/lib64 to LD_LIBRARY_PATH. There are several ways to achieve this; I like to edit ~/.profile:
2 | if [ -d "/opt/cuda/bin" ] ; then |
3 | PATH= "/opt/cuda/bin:$PATH" |
4 | LD_LIBRARY_PATH= "/opt/cuda/lib64:$LD_LIBRARY_PATH" |
Download and unpack the SDK
This is also quite easy.
2 | chmod +x gpucomputingsdk_3.0_linux.run |
3 | ./gpucomputingsdk_3.0_linux.run |
This simply unpacks the SDK to the default destination of ~/NVIDIA_GPU_Computing_SDK.
Fix up issues with compilation
In theory, the next step is to cd to ~/NVIDIA_GPU_Computing_SDK/C, type “make” and watch the sample applications compile. There are a couple of problems with Ubuntu 10.04.
First, the version of GCC in the distribution is 4.4.3, whereas the SDK requires, at most, 4.3.x. We need to install gcc-4.3:
1 | sudo apt-get install gcc-4.3 |
Next, we have to tell the SDK which GCC to use. Open up ~/NVIDIA_GPU_Computing_SDK/C/common/common.mk in a text editor and:
4 | NVCCFLAGS := --compiler-bindir=/usr/bin/gcc-4.3 |
At this point, make still failed with errors related to libraries. Ubuntu 10.04 has an up-to-date version of the NVIDIA video driver, so there should be no need to update it. However, check whether your system has libxi-dev, libxmu-dev and libglut3-dev and install them if required.
My final make error was “unable to find -lcuda”. On my system, it lives in /usr/lib/nvidia-current/libcuda.so. A temporary symbolic link to /usr/lib did the trick:
1 | sudo ln -sf /usr/lib/nvidia-current/libcuda.so /usr/lib/ |
Finally, make works and creates 68 executables in the directory ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release. If everything went well, you can now enjoy a fast rendering of a smoke cloud, like the one in the video at the top of this post, by running smokeParticles.
Next step – figuring out how to do something useful and bioinformatics-related with this new toy.
I used several very helpful blog posts by other people to troubleshoot these issues. Unfortunately, I don’t have the links with me right now, so I’ll update this post later in the day.
|