1、查看cuda版本
cat /usr/local/cuda/version.txt
2、查看cudnn版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
NVIDIA-cudnn官网
https://developer.nvidia.com/cuDNN
1、下载并解压出一个名为cuda的文件夹,文件夹中有include和lib64两个文件夹
2、删除原来的cudnn
sudo rm -rf /usr/local/cuda/include/cudnn.h
sudo rm -rf /usr/local/cuda/lib64/libcudnn*
3、安装安装需要版本的cudnn,在终端cd到刚解压的cuda文件夹
sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
sudo cp cuda/lib64/lib* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*