Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to install CUDA 5.5 on Ubuntu

📅 2013-Oct-10 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Installing CUDA 5.5 on Ubuntu 12.04 is much easier than with earlier versions of CUDA.

  1. Download the .deb file that matches your 32-bit or 64-bit Ubuntu from here. For my system, it was cuda-repo-ubuntu1204_5.5-0_amd64.deb

  2. Uninstall the existing NVIDIA driver:

$ sudo /usr/bin/nvidia-uninstall
  1. Install the .deb file:
$ sudo gdebi cuda-repo-ubuntu1204_5.5-0_amd64.deb

This just adds a cuda.list file to /etc/apt/sources.list.d/. The URL inside cuda.list for my 64-bit Ubuntu is http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64. This will be used by apt-get to get CUDA packages for installation.

  1. Install CUDA packages:
$ sudo apt-get update
$ sudo apt-get install cuda
  1. Restart the computer. Hopefully, there is no problem with your drivers and you get the Ubuntu desktop.

  2. Set the PATH and LD_LIBRARY_PATH environment variables. I add this to my .bashrc:

export CUDA_ROOT=/usr/local/cuda-5.5
export PATH=$PATH:$CUDA_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_ROOT/lib64
  1. Compile and run your CUDA programs. They should work without errors :)

Tried with: Ubuntu 12.04 LTS