Bootstrap

Ubuntu 20.04 安装CUDA11.1 和cudnn 8.0.5

Install CUDA

cuda 11.1
百度网盘链接
密码: bo6f

sudo sh cuda_11.1.0_455.23.05_linux.run

把第一个X,用enter键去掉,去掉之后,如下所示
在这里插入图片描述

安装成功后跳出

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-11.1/
Samples:  Not Selected

Please make sure that
 -   PATH includes /usr/local/cuda-11.1/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-11.1/lib64, or, add /usr/local/cuda-11.1/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.1/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least .00 is required for CUDA 11.1 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run --silent --driver

Logfile is /var/log/cuda-installer.log

修改 ~/.bashrc 文件

sudo vim ~/.bashrc

add the following lines to the end of the file ~/.bashrc

export PATH=/usr/local/cuda-11.1/bin${PATH}
export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:${LD_LIBRARY_PATH}

source ~/.bashrc

Install cudnn

https://developer.nvidia.com/rdp/cudnn-archive

cudnn 8.0.5
百度网盘
密码: 935g

tar xvzf cudnn-10.0-linux-x64-v7.6.4.38.tgz
sudo cp -rp cuda/include/cudnn.h /usr/local/cuda-11.1/include
sudo cp -rp cuda/lib64/libcudnn* /usr/local/cuda-11.1/lib64
sudo chmod a+r /usr/local/cuda-11.1/include/cudnn.h /usr/local/cuda-11.1/lib64/libcudnn*

重启

nvcc -V
zdx@wood:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0
;