Thursday, August 20, 2015

full recipe to install cuda 7 on ubuntu 14.04

cuda driver and toolkit can be downloaded from here.

step 1
$sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx-lts-trusty libglu1-mesa libglu1-mesa-dev -y

step 2
blacklist the required modules (so that they don’t interfere with the driver installation)
$sudo vim  /etc/modprobe.d/blacklist.conf
add the end with following lines:

blacklist amd76x_edac
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv


step 3
get rid of nvidia residuals
$sudo apt-get remove --purge nvidia-*


step 4
reboot
gksudo gedit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
sudo update-grub


step 4
reboot
sudo service lightdm stop
chmod +x cuda_*.run
sudo ./cuda_7.0.28_linux.run


step 5
in your ~/.bashrc, set up the env
export PATH=/usr/local/cuda-7.0/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64

sudo reboot

HOOOOOOOOORAY~~~~!!!

If you updated your linux kernel and could log in by typing the right password, you may need to consider the following approach by removing the new linux image.

to check the installed linux image list
dpkg --list | grep linux-image

remove the targeted kernel image (http://askubuntu.com/questions/375844/kernel-downgrade-after-update-broke-my-system) . Here is an example.
sudo apt-get remove --purge linux-image-3.8.0-33-generic

No comments:

Post a Comment