By default the cuda is not working on Ubuntu. You may not want to crash your system. Please do exactly follow the instruction step by step. If you are brave enough like me or you are still OK to handle the problem properly even if only the Linux kernel and SSH are working fine, there is no need to backup your system at first.
- Go to the CUDA official website and download the Getting started guide for your system
- Read the installation guide from Cuda official website
- install all the prerequisites for your system
- Download Cuda 5 installation
- typically it’s a cuda5.run file
- Remove the existing nvidia driver from Ubuntu official reposistory
- $ sudo apt-get remove –purge nvidia
- Change tty to anyone without gui:
- eg. ctrl + alt + F1
- Stop the default dm:
- eg. $ sudo service lightdm stop
- Install gcc and change the default gcc to gcc-4.4:
- sudo apt-get install gcc gcc-4.4
- sudo update-alternatives –remove-all gcc ( if you have previous configuration )
- sudo update-alternatives –config gcc ( if you have previous configuration )
- sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.4 20
- gcc –version
- gcc 4.4.* or something like that should be printed out
- Run installation:
- chmod +x <cuda>.run
- sudo ./<cuda>.run