Install CUDA8.0
Download CUDA8.0 from https://developer.nvidia.com/cuda-downloads
Execute the following commands to install CUDA.
sudo dpkg -i cuda-repo-ubuntu1604_8.0.44-1_amd64.deb
sudo apt update
sudo apt install cuda
Setting the path
write into .bashrc file as below
echo -e "\n## CUDA and cuDNN paths" >> ~/.bashrc
echo 'export PATH=/usr/local/cuda-8.0/bin:${PATH}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:${LD_LIBRARY_PATH}' >> ~/.bashrc
source ~/.bashrc
export PATH=/usr/local/cuda-8.0/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:${LD_LIBRARY_PATH}
check whether the path of CUDA is passed through
echo $PATH # is the path "/usr/local/cuda-8.0/bin" included?
echo $LD_LIBRARY_PATH # is the path "/usr/local/cuda-8.0/lib64" included?
which nvcc # is the path "/usr/local/cuda-8.0/bin/nvcc" outputed?
nvidia-smi # is the information of nvidia's GPU displayed?
Install cuDNN
Download cuDNN 5.1 for CUDA 8.0 from
https://developer.nvidia.com/rdp/cudnn-download
1.Execute the following commands on the terminal at the directory where you just saved the downloaded cuDNN.
2.Copy lib of cuDNN into the directory where CUDA as installed.
3.Setting the symbolic link.
tar xzvf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp -a cuda/lib64/* /usr/local/cuda-8.0/lib64/
sudo cp -a cuda/include/* /usr/local/cuda-8.0/include/
sudo ldconfig
Check the operation
Execute the sample of CUDA to check the operation.
Because the shell script which is used to copy the sample code to the home directory(cuda-install-samples-8.0.sh
) is in /usr/local/cuda-8.0/bin/
, so if CUDA path is passed through,you can execute the sample by only assigning the filename.
cuda-install-samples-8.0.sh ~ # copy the sample code to home directory
cd ~/NVIDIA_CUDA-8.0_Samples/
make
cd bin/x86_64/linux/release # move to the directory where the executable file of the sample is in.
./smokeParticles