Installing CUDA 3.2 under Kubuntu 10.10
This is a description of what I needed to do, to get CUDA up and running on my Lenovo T61 laptop running Kubuntu 10.10.
Downloading and installing
I started out by downloading CUDA 3.2 and documentation from nVidias homepage, and then I followed the installation steps in the Linux Getting Started Guide:
- Downloaded 3 files from nVidia (There's a lot of other files, but these are the ones needed for the install):
- Remember to change the priviliges for the 2 .run files, to make them executable:
$ chmod u+x cudatoolkit_3.2.16_linux_32_ubuntu10.04.run $ chmod u+x gpucomputingsdk_3.2.16_linux.run
- Install the CUDA toolkit by executing cudatoolkit_3.2.16_linux_32_ubuntu10.04.run with root privileges:
$ sudo cudatoolkit_3.2.16_linux_32_ubuntu10.04.run
- Set up the correct search paths by inserting these two lines in your .bashrc file:
export PATH=~/bin:/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH
- Make sure that your .bashrc have been executed, so the paths have been set up correctly. The easiest way is probably to log out and back in.
- Install the nVidia GPU Computing SDK by executing gpucomputingsdk_3.2.16_linux.run as an ordinary user:
$ gpucomputingsdk_3.2.16_linux.run
Making the sample code compile
The Getting Started Guide asks you to copmpoile the sample code to see if the install succeeded:
$ cd ~/nvidia_gpu_computing_dsk/C $ make
Which got me these error messages:
/usr/bin/ld: cannot find -lGL /usr/bin/ld: cannot find -lGLU /usr/bin/ld: cannot find -lXmu /usr/bin/ld: cannot find -lglut /usr/bin/ld: cannot find -lcuda collect2: ld returned 1 exit status
After some searching I found that I needed to install a couple of packages, and set up a file link:
$ sudo apt-get install libglu-dev libXmu-dev libglut3-dev $ cd /usr/lib $ sudo ln -s libGL.so.260.19.29 libGL.so
That took care of the first 4 error messages. The last one I took care of by uninstalling the automatically installed nVidia drivers from the Ubuntu package system, and installing the newest driver from the nVidia homepage.
Changing nVidia drivers
I found the original description of how to change drivers here: http://forums.nvidia.com/index.php?showtopic=167422&pid=1050235&mode=threaded&start=0#entry1050235
- Remove current nvidia packages
- Disable the nVidia drivers in Application->System->Additional Drivers
- Remove the disabled drivers:
$ sudo apt-get purge nvidia-*
- Create the file /etc/modprobe.d/nvidia-graphics-drivers.conf with the following contents
blacklist vga16fb blacklist nouveau blacklist lbm-nouveau blacklist nvidia-173 blacklist nvidia-96 blacklist nvidia-current blacklist nvidiafb
- Create or adjust the /etx/X11/xorg.conf file to:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
- Reboot
- When you get the kdm log-in prompt, change to a text mode log in, and log in as root.
- Stop X by stopping the kdm service (if you are running Ubuntu, and not Kubuntu replace kdm with gdm):
$ sudo service kdm stop
- Run the nvidia installer and when it asks to run nvidia-x-config, answer yes
- Start X by starting the kdm service (if you are running Ubuntu, and not Kubuntu replace kdm with gdm):
$ sudo service kdm start