libcudnn.so.7: cannot open shared object file: No such file or directory
程序员文章站
2022-07-15 16:42:47
...
不同的版本:
cudnn:7.1.1
cuda:9.0.176
tensorflow:1.6.0
Ubuntu:16.04
我经历了两次这样的错误,每次都费事费力,终于找到最终解决方法了
安装CUDA 9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0
CUDA_PATCH1="cuda-repo-ubuntu1604-9-0-local-cublas-performance-update_1.0-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/patches/1/${CUDA_PATCH1}
sudo dpkg -i ${CUDA_PATCH1}
sudo apt-get update
安装cuDNN v7.0
CUDNN_PKG="libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb"
wget https://github.com/ashokpant/cudnn_archive/raw/master/v7.0/${CUDNN_PKG}
sudo dpkg -i ${CUDNN_PKG}
sudo apt-get update
安装CUDA配置文件工具
# install NVIDIA CUDA Profile Tools Interface ( libcupti-dev v9.0)
sudo apt-get install cuda-command-line-tools-9-0
设置环境变量
export PATH=${PATH}:/usr/local/cuda-9.0/bin
export CUDA_HOME=${CUDA_HOME}:/usr/local/cuda:/usr/local/cuda-9.0
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-9.0/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64
按照上面运行完成之后,Tensorflow就可以正常工作了。无需再登录NVIDA。
推荐阅读
-
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
-
解决启动MongoDB错误:error while loading shared libraries: libstdc++.so.6:cannot open shared object file:
-
linux系统安装VMware(详细解决"Cannot open /dev/vmmon: No such file or directory"问题)
-
mdadm: cannot open /dev/sdb: No such file or directory
-
Tensorflow:ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
-
libiconv.so.2 cannot open shared object file: No such file or directory
-
libmatio.so.2: cannot open shared object file: No such file or directory
-
libevent-2.0.so.5: cannot open shared object file: No such file or directory
-
报错:libmysqlclient.so.18: cannot open shared object file: No such file or directory.
-
libcudart.so.9.2: cannot open shared object file: No such file or directory