Installing CUDA 3.2 under Kubuntu 10.10

From Jens' Hjørne

Jump to: navigation, search

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:

  • Remember to change the priviliges for the 2 .run files, to make them executable:
$ chmod u+x
$ chmod u+x
  • Install the CUDA toolkit by executing with root privileges:
$ sudo
  • 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 as an ordinary user:

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

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:

  • 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"
  • 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


Personal tools