I tried to import cudamat. Then I ran into the error:
OSError: libcublas.so.3: cannot open shared object file: No such file or directory
I tried to locate 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
What can I do? I'm sorry I'm not familiar with ubuntu. Thank you !
first set PATH and 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
Then build a symbolic link
sudo ln -s /usr/local/cuda-5.5/lib64/libcublas.so /usr/local/cuda-5.5/lib64/libcublas.so.3
I solved this myself.
first set PATH and 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
Then build a symbolic link
sudo ln -s /usr/local/cuda-5.5/lib64/libcublas.so /usr/local/cuda-5.5/lib64/libcublas.so.3
In a slightly different situation, the same warning may be raised by literally missing lib file, i.e. the .lib
files are not at $CUDA/lib64/
. For instance the following code did not show libcublas.so
in this directory.
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
The workaround for this case is different but straightforward: just create symlinks in $CUDA/lib64/
for all the lib files in $CUDA/targets/x86_64-linux/lib
. An example one-liner is like this:
sudo ln -s /usr/local/cuda/targets/x86_64-linux/lib/* $LD_LIBRARY_PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With