1. 程式人生 > >error while loading shared libraries: libcudnn.so.7: cannot open shared object file: No such file or

error while loading shared libraries: libcudnn.so.7: cannot open shared object file: No such file or

1、錯誤:libcudnn.so.7

.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libcudnn.so.7: cannot open shared object file: No such file or directory
Makefile:542: recipe for target 'runtest' failed
make: *** [runtest] Error 127

 

原因分析:

主要是 /usr/local/lib/目錄下找不到libcudnn.so.7這個檔案, 該檔案可以在usr/local/cuda-8.0/lib64/目錄下找到,因此我們通過下面的命令將libcudnn.so.7這個檔案複製一份過去,記得要加sudo許可權,否則可能無法複製。

 

參考連結:

https://www.cnblogs.com/is-Tina/p/7719599.html

https://blog.csdn.net/qq_38451119/article/details/81126692

 

解決方案:

終端執行:

sudo cp /usr/local/cuda/lib64/libcudnn.so.7 /usr/local/lib/libcudnn.so.7
sudo ldconfig

執行後,不在報錯,成功解決。

 

類似問題:

2、錯誤:libcudart.so.8.0

.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libcudart.so.8.0: cannot open shared object file: No such file or directory
Makefile:542: recipe for target 'runtest' failed
make: *** [runtest] Error 127

 

解決方法:執行

sudo cp /usr/local/cuda-8.0/lib64/libcudart.so.8.0 /usr/local/lib/libcudart.so.8.0 && sudo ldconfig

 

3、錯誤:libcublas.so.8.0

.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libcublas.so.8.0: cannot open shared object file: No such file or directory
Makefile:542: recipe for target 'runtest' failed
make: *** [runtest] Error 127

解決方案:執行

sudo cp /usr/local/cuda-8.0/lib64/libcublas.so.8.0 /usr/local/lib/libcublas.so.8.0 && sudo ldconfig

 

4、錯誤: libcurand.so.8.0

.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libcurand.so.8.0: cannot open shared object file: No such file or directory
Makefile:542: recipe for target 'runtest' failed
make: *** [runtest] Error 127

解決方案:執行

sudo cp /usr/local/cuda-8.0/lib64/libcurand.so.8.0 /usr/local/lib/libcurand.so.8.0 && sudo ldconfig