Install cuDNN v8.0.5 in ubuntu 20.04

  • what: NVIDIA cuDNN是用于深度神经网络的GPU加速库。cuDNN安装很简单,就是将解压的文件放到指定位置即可.
  • why: GPU acceleration for DNN
  • how: cuDNN安装很简单,就是将解压的文件放到指定位置即可[2].
    • step 1: Register a Nvidia account and go to the download page. Select the version based on your CUDA version
    • step 2: navigate to your directory containing the tar file, and unzip the cuDNN via tar -xzvf cudnn-x.x-linux-x64-v8.x.x.x.tgz
    • step 3: copy files to target location
      $ sudo cp cuda/include/cudnn*.h /usr/local/cuda/include
      $ 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: check result via cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
    • step 5: Then downloaded the other 3 .deb files and install them:
      $ cd ~/Downloads   
      $ sudo dpkg -i .deb
      $ sudo dpkg -i .deb
      $ sudo dpkg -i .deb
      
    • step 6: verifying the install on Linux [2]. If cuDNN is properly installed and running on your Linux system, you will see a message similar to the following:
      Test passed!
      # Copy the cuDNN samples to a writable path.
      $ cp -r /usr/src/cudnn_samples_v8/ $HOME
      # Go to the writable path.
      $ cd  $HOME/cudnn_samples_v8/mnistCUDNN
      # Compile the mnistCUDNN sample.
      $ make clean && make
      # Run the mnistCUDNN sample.
      $ ./mnistCUDNN
      # If cuDNN is properly installed and running on your Linux system, you will see a message similar to the following:
      # Test passed!
      
  • record:
    • step 1: download the latest version Download cuDNN v8.0.5 (November 9th, 2020), for CUDA 10.1. (Q: will there be problemetic when using PyTorch built in cudnn with v7.6.5?)
    • step 2: unzip
      $ cd ~/Downloads
      $ tar -xzvf cudnn-10.1-linux-x64-v8.0.5.39.tgz
      
    • step 3: done, and every command is okay
    • step 4: done, and got 8.0.5
    • step 5: done.
    • step 6: got Test passed!
  • result: pass
  • ref:
    • [1] Ubuntu:安装cudnn10.1
    • [2] Official instllation guide of cudnn

你可能感兴趣的:(Use,Linux,cudnn)