我试图导入cudamat。然后我遇到了错误:
OSError: libcublas.so.3: cannot open shared object file: No such file or directory
我试图找到libcublas
/usr/local/MATLAB/MATLAB_Production_Server/R2013a/bin/glnxa64/libcublas.so.5.0
/usr/local/MATLAB/MATLAB_Production_Server/R2013a/bin/glnxa64/libcublas.so.5.0.40
/usr/local/cuda-5.5/lib/libcublas.so
/usr/local/cuda-5.5/lib/libcublas.so.5.5
/usr/local/cuda-5.5/lib/libcublas.so.5.5.22
/usr/local/cuda-5.5/lib/libcublas_device.a
/usr/local/cuda-5.5/lib64/libcublas.so
/usr/local/cuda-5.5/lib64/libcublas.so.5.5
/usr/local/cuda-5.5/lib64/libcublas.so.5.5.22
/usr/local/cuda-5.5/lib64/libcublas_device.a
/usr/local/cuda-5.5/targets/x86_64-linux/lib/libcublas.so
/usr/local/cuda-5.5/targets/x86_64-linux/lib/libcublas.so.5.5
/usr/local/cuda-5.5/targets/x86_64-linux/lib/libcublas.so.5.5.22
/usr/local/cuda-5.5/targets/x86_64-linux/lib/libcublas_device.a
我该怎么办?对不起,我不熟悉ubuntu。谢谢!
首先设置PATH和LD_LIBRARY_PATH
$ export PATH=/usr/local/cuda-5.5/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:$LD_LIBRARY_PATH
然后建立一个符号链接
sudo ln -s /usr/local/cuda-5.5/lib64/libcublas.so /usr/local/cuda-5.5/lib64/libcublas.so.3
答案 0 :(得分:14)
我自己解决了这个问题。
首先设置PATH和LD_LIBRARY_PATH
$ export PATH=/usr/local/cuda-5.5/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:$LD_LIBRARY_PATH
然后建立一个符号链接
sudo ln -s /usr/local/cuda-5.5/lib64/libcublas.so /usr/local/cuda-5.5/lib64/libcublas.so.3
答案 1 :(得分:1)
在稍微不同的情况下,字面上丢失的lib文件可能会引发相同的警告,即.lib
文件不在$CUDA/lib64/
。例如,以下代码未在此目录中显示libcublas.so
。
sudo find / -iname libcublas*
/usr/local/cuda-7.5/doc/man/man7/libcublas.so.7
/usr/local/cuda-7.5/doc/man/man7/libcublas.7
/usr/local/cuda-7.5/targets/x86_64-linux/lib/libcublas.so.7.5
/usr/local/cuda-7.5/targets/x86_64-linux/lib/libcublas_static.a
/usr/local/cuda-7.5/targets/x86_64-linux/lib/stubs/libcublas.so
/usr/local/cuda-7.5/targets/x86_64-linux/lib/libcublas_device.a
/usr/local/cuda-7.5/targets/x86_64-linux/lib/libcublas.so.7.5.18
/usr/local/cuda-7.5/targets/x86_64-linux/lib/libcublas.so
这种情况的workaround不同但很简单:只需在$CUDA/lib64/
中为$CUDA/targets/x86_64-linux/lib
中的所有lib文件创建符号链接。一个示例单行是这样的:
sudo ln -s /usr/local/cuda/targets/x86_64-linux/lib/* $LD_LIBRARY_PATH