相关网址:
-
Installation Instructions:
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal -
Deep Learning SDK Documentation
https://docs.nvidia.com/deeplearning/sdk/
https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html
step 1.
下载CUDA Toolkit 10.1
网址: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal
指令如下:
$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
$ sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
$ wget http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
$ sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
$ sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub
$ sudo apt-get update
$ sudo apt-get -y install cuda
step 2.
安装完毕之后,将以下两条加入.bashrc文件中.
$ sudo gedit ~/.bashrc
添加如下代码:
export PATH=/usr/local/cuda-10.1/bin${PATH:+:$PATH}} #注意,根据自己的版本, 修改10.1...
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} #注意,根据自己的版本,修改10.1...
step 3.
下载 cudnn-10.1-linux-x64-v7.6.3.30.tgz, 网址为: https://developer.nvidia.com/rdp/cudnn-download
先解压,然后将其中的内容复制到CUDA安装文件夹里面. 如下步骤:
$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include 注意,解压后的文件夹名称为cuda ,将对应文件复制到 /usr/local中的cuda内
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
step 4.
Verifying
To verify that cuDNN is installed and is running properly, compile the mnistCUDNN sample located in the /usr/src/cudnn_samples_v7 directory in the debian file.
$ cp -r /usr/src/cudnn_samples_v7/ $HOME # Copy the cuDNN sample to a writable path.
$ cd $HOME/cudnn_samples_v7/mnistCUDNN # Go to the writable path.
$ make clean && make # Compile the mnistCUDNN sample.
$ ./mnistCUDNN # Run the mnistCUDNN sample.
If cuDNN is properly installed and running on your Linux system, you will see a message similar to the following:
Test passed!