Published on

cudnn_安装

cuDNN安装

  1. 下载https://developer.nvidia.com/rdp/cudnn-archive对应版本压缩包

tensorflow cuda cuDNN对应关系 https://tensorflow.google.cn/install/source_windows?hl=en#gpu下载需要注册账号密码,如需要,可以私信。

  1. tar -xzvf 解压,得到cuda目录,包含include 和 lib64 两个文件
  2. 将lib64文件添加到环境变量中,然后source
vim ~/.bashrc
添加: export LD_LIBRARY_PATH=..(你的安装目录)../lib64:$LD_LIBRARY_PATH
source ~/.bashrc
  1. 将include中cuddn.h文件复制到 /usr/local/cuda/include文件中,重置cudnn.h权限
cp */cuddn.h /usr/local/cuda/include/
chmod a+r /usr/local/cuda/include/cuddn.h

https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html

  1. 查看cuDNN版本

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

cat /usr/local/cuda/version.txt

相关帮助链接:

CUDA各个版本下载链接:https://developer.nvidia.com/cuda-toolkit-archive nvidia驱动和cuda版本兼容性查看:https://docs.nvidia.com/cuda/archive/11.3.0/cuda-installation-guide-linux/index.html

cuDNN各版本下载:https://developer.nvidia.com/rdp/cudnn-archive

tensorflow cuda cuDNN对应关系:https://tensorflow.google.cn/install/source_windows?hl=en#gpu