第二次在实验室服务器(CentOS7)自己装cuda+cudnn了,记录一下流程(并不希望有第三次^^ )
CUDA10.2安装
-
非root安装cuda:https://blog.csdn.net/weixin_45690176/article/details/119062059
-
CUDA Toolkit Archive:https://developer.nvidia.com/cuda-toolkit-archive
-
命令
wget https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
bash ./cuda_10.2.89_440.33.01_linux.run --toolkit --toolkitpath=$HOME/cuda_10.2 --defaultroot=$HOME/cuda_10.2
*$HOME改成自己的路径
cuDNN8.6.0安装
- cuDNN下载(需要注册账号):https://developer.nvidia.com/rdp/cudnn-download
- 官方Installation Guide:https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html
- 命令
tar -xvf cudnn-linux-x86_64-8.x.x.x_cudaX.Y-archive.tar.xz
sudo cp cudnn-*-archive/include/cudnn*.h /usr/local/cuda/include
sudo cp -P cudnn-*-archive/lib/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
- 查看是否安装成功
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
简单粗暴的解决方法
直接conda安装tensorflow
- conda换源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- conda安装tensorflow
conda install tensorflow-gpu==2.1.0
- 报错GLIBC_2.23’ not found:把环境python换成3.6版本的试试