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

30,722

Solution 1

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.

Solution 2

Courtesy of Mr. Aaron Haviland:

sudo apt-add-repository ppa:aaron-haviland/cuda-5.5
sudo apt-get install nvidia-cuda-toolkit

In case one would also like to install the (currently) latest NVIDIA drivers for ubuntu (NOTE: this is NOT a dependency of CUDA 5.5), an easy method…

Courtesy of the “xorg crack pushers team”:

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-331

Solution 3

My UBUNTU 13.10 64bits system (uname -a):

Linux gpia 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

The way I've installed CUDA Toolkit 5.5:

1 - In System Settings -> Software & Updates -> Additional Drives, select:

SELECT: Using NVIDIA binary Xorg driver, kernel module and VDPAU library from nvidia-319-updates (proprietary)

This gave me NVIDIA driver version 319.60 (it needs to be >= 319.37).

2 - Install gcc-4.6:

sudo apt-get install gcc-4.6

3 - Use update-alternatives to handle gcc versions (as stated by banskt):

sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 1
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
sudo update-alternatives --config gcc

and choose gcc-4.6.

4 - Install some sutff to avoid missing libraries from CUDA samples (libGLU.so, libX11.so, libXi.so, libXmu.so):

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa-dev

5 - Install CUDA Toolkit, previously downloaded from NVIDIA site (RUN version 12.10 64 bits: developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run)

sudo sh cuda_5.5.22_linux_64.run

Answers: accept, y (unsupported), n (NVIDIA driver), y (install toolkit), enter (default location), y (samples), enter (default location)

6 - With update-alternatives, return to gcc-4.8:

sudo update-alternatives --config gcc

7 - Add the CUDA binaries and lib path to your PATH and LD_LIBRARY_PATH environment variables:

PATH: =======================================

cd /etc/profile.d
sudo vi cuda-5.5_bin.sh

#inside file:

export PATH=$PATH:/usr/local/cuda-5.5/bin

=============================================

LD_LIBRARY_PATH: ============================

cd /etc/ld.so.conf.d
sudo vi cuda-5.5.conf

#inside file:

/usr/local/cuda-5.5/lib
/usr/local/cuda-5.5/lib64

=============================================

8 - Log out your system and log in again. Test with nvcc --version or compile and run the following simple example codes: first.cu, sumvec.cu with nvcc filename.cu -o filename.exec.

Have a nice CUDA time :-D

Share:
30,722

Related videos on Youtube

user0002128
Author by

user0002128

Updated on September 18, 2022

Comments

  • user0002128
    user0002128 over 1 year

    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.
    
  • Braiam
    Braiam over 10 years
    next time, just paste the content here.
  • Sajesh Kumar
    Sajesh Kumar over 10 years
    This is not the 5.5 version of the CUDA toolkit but the 5.0 version... source
  • Sajesh Kumar
    Sajesh Kumar over 10 years
    The question asked specifically for Ubuntu 13.10, the instructions for 12.04 are on the CUDA website and are much simpler.
  • hunse
    hunse over 10 years
    Worked great (on Linux Mint 16). I didn't have to do all the blacklisting, but that's probably because I already had the newest NVIDIA drivers installed. If that's the case, the key steps are installing the dependencies, setting up gcc 4.6, and installing CUDA from the .run package. Don't forget to put gcc back to 4.8 when you're done!
  • hunse
    hunse over 10 years
    I was not able to get this to work with the newest (nvidia-311) version of the drivers, which I had installed myself from the NVIDIA site. apt-get tried to install some updates to the nvidia-319 drivers (which I did not have installed), causing problems. Using the .run file to install as described by @banskt seems like a more generic alternative.
  • Luís de Sousa
    Luís de Sousa over 10 years
    Welcome to AskUbuntu. Your answer seems valid but could you please detail it a bit more?
  • eldad-a
    eldad-a over 10 years
    @LuísdeSousa I am not sure what further details would be helpful - the question was how to install CUDA 5.5 on ubuntu 13.10. Running the lines I wrote above worked for me. Please let me know what details are missing.
  • eldad-a
    eldad-a over 10 years
    @LuísdeSousa I feel like I am missing something... Do you find this helpful? launchpad.net/~aaron-haviland
  • Greg Kramida
    Greg Kramida almost 10 years
    Worked for me for CUDA 6.0 / Ubuntu 14.04. Thanks!
  • Nickolai Leschov
    Nickolai Leschov almost 10 years
    @eldad is nvidia-331 still the latest and greatest one to use?
  • e-sushi
    e-sushi over 9 years
    Guess I’m the first one to actually read this answer!?! Look at step 7. The last #inside file: does not specify what file to add /usr/local/cuda-5.5/lib /usr/local/cuda-5.5/lib64 to. It might be a good idea to edit your answer. Fixing that “glitch” would make this incomplete answer complete.
  • iperetta
    iperetta over 9 years
    Dear e-sushi: everything you need is there. In step 7 you must create <<cuda-5.5_bin.sh>> and <<cuda-5.5.conf>> files, as it is shown by the "cd" and "vi" commands. Anyway, I'll include a subdivision between those two sub-steps.
  • Faizan Akram Dar
    Faizan Akram Dar about 9 years
    This is an Ubuntu site not Linux mint
  • A.B.
    A.B. about 9 years
    -1 Is that an answer? I don't think so.
  • Eduardo
    Eduardo over 7 years
    Another link on how to install nvidia-cuda-toolkit