Ubuntu – Has anyone successfully installed CUDA 5.5 on Ubuntu 13.10 64-bit

13.1064-bitcudasoftware installation

I tried to install a CUDA 5.5, following the steps on the Nvidia website, using the deb file for Ubuntu 12.10 (the latest version I could find on Nvidia website), but the installer fail to begin, telling me there are some dependency issues:

The following packages have unmet dependencies. 
  cuda : Depends: cuda-5-5 (= 5.5-22) but it is not going to be installed. 
E: Unable to correct problems, you have held broken packages.

Best Answer

I have successfully installed CUDA-5.5.22 on Ubuntu 13.10 64-bit.

$ uname -a
Linux bagchi62 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:04:55 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

My GPU is GeForce GTX 650Ti. Below are the steps of my installation:

Step 1. Purge the existing NVIDIA driver installations. I had to install the latest NVIDIA driver (331.20) for CUDA-5.5 to work. [I later found that you need at least v319.37 for CUDA-5.5.22 - the toolkit that supports Ubuntu 12.10]

sudo apt-get purge nvidia*

Step 2. Download the latest NVIDIA driver from here: http://www.nvidia.com/Download/index.aspx, and the CUDA toolkit from here: https://developer.nvidia.com/cuda-downloads [I download the .run file for 64-bit Ubuntu 12.10]

Step 3. Create a blacklist for existing video drivers in /etc/modprobe.d. I created a file named /etc/modprobe.d/blacklist-file-drivers.conf with the following content:

blacklist nouveau
blacklist lbm-nouveau
blacklist amd76x_edac
blacklist vga16fb
blacklist rivatv
blacklist rivafb
blacklist nvidiafb
blacklist nvidia-173
blacklist nvidia-96
blacklist nvidia-current
blacklist nvidia-173-updates
blacklist nvidia-96-updates
alias nvidia nvidia_current_updates
alias nouveau off
alias lbm-nouveau off

Step 4. Install the dependencies. [Note: CUDA-5.5.22 needs gcc-v4.7.2 or below for compilation. If you install gcc-4.7, then v4.7.3 is pulled from the repositories, and you cannot install the toolkit. Hence, I used gcc-4.6]

sudo apt-get install freeglut3 freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev gcc g++ gcc-4.6 g++-4.6 linux-headers-generic linux-source
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so

Step 5. Configure your gcc for alternatives. You will need latest gcc for NVIDIA driver and gcc-4.6 for CUDA toolkit. [I have gcc-4.8 as the latest. You have to change accordingly]

sudo update-alternatives --remove-all gcc
sudo update-alternatives --config gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50

Step 6. Prequisites done. Reboot and drop into a text console (Ctrl+Alt+F1). Kill your display manager. For un-tweaked Ubuntu 13.10, it is lightdm

sudo service lightdm stop

Step 7. Install NVIDIA driver. Navigate to your download directory, and choose your latest gcc. [Note: Do not copy-paste the following code. Change the name of your driver file accordingly]

sudo update-alternatives --config gcc          #choose 4.8
sudo chmod +x NVIDIA-Linux-x86_64-331.20.run
sudo ./NVIDIA-Linux-x86_64-331.20.run

Follow the text instructions. Initially, it would give warnings about unsupported distribution. Ignore and continue.

Step 8. Install CUDA toolkit. [Note: Do not copy-paste the following code. Change the name of your toolkit file accordingly]

sudo update-alternatives --config gcc          #choose 4.6
sudo chmod +x cuda_5.5.22_linux_64.run
sudo ./cuda_5.5.22_linux_64.run

Follow text instruction. Do NOT install the CUDA driver that comes with the toolkit.

Step 9. Add the binaries and lib files to your path. Reboot.

Step 10. Done! You can make the sample files now. Enjoy your CUDA.