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 tr
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
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