tensorflow: docs: Could not load dynamic library 'libcublas.so.10'

URL(s) with the issue:

https://www.tensorflow.org/install/gpu#install_cuda_with_apt

Description of issue (what needs changing):

I followed the Ubuntu 18.04 (CUDA 10.1) instructions and have installed cuda-10-1, libcudnn7=7.6.5.32-1+cuda10.1, libcudnn7-dev=7.6.5.32-1+cuda10.1 as per the instructions.

When I train I’m seeing

Could not load dynamic library 'libcublas.so.10'; dlerror: libcublas.so.10: cannot open shared object file: No such file or directory

In context:

2020-10-26 01:41:57.018284: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
2020-10-26 01:41:57.018526: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcublas.so.10'; dlerror: libcublas.so.10: cannot open shared object file: No such file or directory
2020-10-26 01:41:57.119177: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcufft.so.10
2020-10-26 01:41:57.144040: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcurand.so.10
2020-10-26 01:41:57.274656: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcusolver.so.10
2020-10-26 01:41:57.292466: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcusparse.so.10
2020-10-26 01:41:57.619082: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudnn.so.7
2020-10-26 01:41:57.619159: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...

I’m running Ubuntu 18.04.5 LTS (Bionic Beaver)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 15 (3 by maintainers)

Most upvoted comments

@hdubbs the problem was that the file was in the 10.2 version , and eventually I followed this https://stackoverflow.com/a/64472380/10255757 and added the export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} in the .bashrc file and the problem was solved . thanks 👍

Ok. I also had this problem and here was my solution, since nothing in this thread did. Info: Of Remote Ubuntu 18.04 LTS Cuda 10.1 Tensorflow 2.3.1 Accessed with Pycharm Professional 2020.2 (remote interpreter)

The problem was the environment variables were not correctly set due to PyCharm. If you are using PyCharm and using a remote host, you should add the LD_LIBRARY_PATH variable to your environment variables in PyCharm, editing .bashrc will not solve the problem, nor will editing the .profile:

In PyCharm

  1. Run > Edit Configurations…
  2. Click on the list icon for Environment Variables
  3. Add the LD_LIBRARY_PATH variable with the value /usr/local/cuda/lib64:/usr/local/cuda-10.1/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH (as given previously in this thread).

I’m sorry if this is the wrong place for this, but this may help others. I was not aware of this issue with PyCharm.

Yes that’s what I did (see above). Perhaps the docs should be updated to reflect this?

apt-get install libcublas10 installed cuda 10.2 versions:

$ dpkg -L libcublas10
/.
/usr
/usr/local
/usr/local/cuda-10.2
/usr/local/cuda-10.2/targets
/usr/local/cuda-10.2/targets/x86_64-linux
/usr/local/cuda-10.2/targets/x86_64-linux/lib
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcublas.so.10.2.2.214
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcublasLt.so.10.2.2.214
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libnvblas.so.10.2.2.214
/usr/share
/usr/share/doc
/usr/share/doc/libcublas10
/usr/share/doc/libcublas10/changelog.Debian.gz
/usr/share/doc/libcublas10/copyright
/usr/local/cuda-10.2/lib64
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcublas.so.10
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcublasLt.so.10
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libnvblas.so.10

I can add /usr/local/cuda-10.2/targets/x86_64-linux/lib/ to LD_LIBRARY_PATH and it works. But if feels like I am mixing and matching cuda 10.1 and cuda 10.2 file versions, and there might be a better way.

I would like to provide how I solved this issue after a long term. Just I saw that this file was not inside of my directory libcublas.so.10. I do not know why. I had installed CUDA-10.0, CUDA-10.1 and CUDA-10.2 but I called for CUDA-10.1. My solution was to pass the libcublas.so.10.0 and rename it to libcublas.so.10 from CUDA-10.0 to CUDA-10.1 and it worked! I verified that my GPU is running! I am so happy!

@tekumara

Please, see this SO link and see if it helps you. Thanks!