CUDA – Compute Unified Device Architecture, is NVIDIA’s parallel computing architecture. It boost the computing performance of a program by making use of the power of the graphics processing unit (GPU). Read more…
First thing you must do is to download CUDA (current version is 5.0).
2 ways to proceed with installation:
- Either install with default display driver.
- Or Install with NVIDIA display driver.
Once you have the downloaded script file “cuda_5.0.35_linux_64_ubuntu11.10-1.run” , it can be extracted to obtain 3 sub script files:
sh cuda_5.0.35_linux_64_ubuntu11.10-1.run -extract=”absolute path”
1. “cudatoolkit_5.0.35_linux_64_ubuntu11.10.run” – Cuda Toolkit (contains IDE Nsight which is based on Eclipse)
2. “devdriver_5.0_linux_64_304.54.run” – NVIDIA device driver
3. “cuda-samples_5.0.35_linux.run” – Cuda samples
Then install the NVIDIA driver,
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update && sudo apt-get install nvidia-current
Installing with default display driver
1. Run script file ”cudatoolkit_5.0.35_linux_64_ubuntu11.10.run” to install the nvidia toolkit.
2. You will need to link the libcuda.so.”version” (e.g libcuda.so.304.64) file from the nvidia driver directory to the install directory for the cuda toolkit
sudo ln -s /usr/lib/nvidia-current/libcuda.so.304.64 /usr/local/cuda-5.0/lib64/libcuda.so
sudo ln -s /usr/lib/nvidia-current/libcuda.so.304.64 /usr/local/cuda-5.0/lib64/libcuda.so.1
3. Install cuda samples
Installing with NVIDIA display driver
1. Reconfigure the basic video driver by removing all nvidia drivers present.
sudo apt-get remove –purge nvidia*
2. Blacklist the built-in nouveau driver so that it does not conflict with the nvidia driver which is going to be installed afterwards.
Create a file and call it blacklist.conf in /etc/modprobe.d/ and add the following lines,
options nouveau modeset=0
3. To install the new nvidia driver, log out of your system and press CTRL+ALT+F1 to enter a text based login. Stop the graphical display manager
sudo service mdm stop
4. Run the script “cudatoolkit_5.0.35_linux_64_ubuntu11.10.run” to install the toolkit, the video driver and cuda samples. Then reboot your system.
sudo shutdown -r now
Setting Environment Variables
Running CUDA Samples
Some cuda samples require openGL and openMPI packages to be installed in order to run.
sudo apt-get install freeglut3-dev libxi-dev libxmu-dev
sudo apt-get install mpi-default-dev
Go to the samples directory and execute the following command to build the samples,
Test by running,
NVIDIA_CUDA-5.0_Samples directory is found on your home directory when the building process has finished.
If you encouter with the following error,
error while loading shared libraries: libcudart.so.2: cannot open shared object file: No such file or directory
it can be solved by modifying the /etc/ld.so.conf file and adding the following two line,
Now you are ready to go.