The step by step processes of CUDA 8.0
installation in Ubuntu(14.04)
is provided here.
The following installation has been implemented and successfully tested on CUDA 8.0 and NVIDIA TITAN X(Pwered by Pascal) GPU. However the method can simply be used for older version of CUDA
and older GPU architectures
.
Before installation of CUDA, It is recommended to uninstall all NVIDIA drivers in order to prevent having any conflict with the new CUDA driver.
sudo apt-get purge nvidia*
Still some of the modules might be stuck in the kernel. Get their names by:
dkms status
The output should be void
or if there is any remnant module the output is as follows:
nvidia-current-updates, "module_version", "kernel_version", x86_64: installed
Module version
and kernel version
are of format 304.4
and 3.1.0-36-generic
respectively. These modules should be removed by the following command:
sudo dkms remove nvidia-current-updates/module_version -k kernel_version
Now the CUDA can safely be installed using the aforementioned procedure in the previous section.
WARNING: DO NOT REBOOT AT THIS STAGE. ALL THE NIVIDIA DRIVERS HAVE BEEN REMOVED AND IF YOU REBOOT THERE IS NO DRIVER. REBOOT AFTER INTALLATION OF CUDA WHICH IS THE NEXT STEP.
For the NVIDIA TITAN X(Pwered by Pascal) GPU, installing CUDA 8.0 is necessary. The CUDA 8.0 download file and installation procedure can be found here. The system platform has to be chosen as the following image: ![](images/Select Target Platform.png).
First using the terminal go to the folder that the downloaded .deb
file is located. Now the installation has to be done as follows:
sudo dpkg -i cuda-repo-ubuntu1404-8-0-local_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
It is worth mentioning that, the described procedure is the straight-forward approach of installing CUDA. Issues like black screen
, stuck in login page
and other incompatibilities may happen which are beyond the scope of this documentation.
The last step of installation CUDA is to add the path of it to source bash file
:
sudo gedit ~/.bashrc
The the two following line must be added to the file with regard to CUDA 8.0
installation:
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
NOTE:
This istallation can be used for any CUDA version however the aforementioned PATH should be addressed based on the installed CUDA verion.
Alternatively current-updates
can be used since it is a package that is cloned from NVIDIA’s releases,
but it is officially tested and packaged by Ubuntu. The command is as follows:
sudo apt-get install nvidia-current-updates nvidia-settings-updates
Now the assumption is that the CUDA is already installed.
Check the supporting GPU(s) and Ubuntu version using the following command:
lspci | grep -i nvidia
uname -m && cat /etc/*release
gcc --version
For increasing the performance(loosly speaking and not necessarily) installing CuDNN is recommended.
After downloading the relevent file to the system, assume the file is downloaded and extracted in the under
the name of cuda
. the go to the folder which cuda
is there and run the following:
sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
Moreover the path to the CuDNN library must be added to system path as follows:
cd <installpath>
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH