Has anyone successfully installed CUDA 5.5 on Ubuntu 13.10 64-bit?
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.
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