Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow 1.13.1: ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory #26209

Closed
PhungVanDuy opened this issue Feb 28, 2019 · 23 comments

Comments

Projects
None yet
@PhungVanDuy
Copy link

commented Feb 28, 2019

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04.6 LTS
  • TensorFlow installed from (source or binary): Binary (pip3 install -U tensorflow-gpu
  • TensorFlow version: current version from pip (maybe version 1.13.1)
  • Python version: Python 3.5.2
  • Installed using virtualenv? pip? conda?: virtualenv environment with pip
  • CUDA/cuDNN version: Cuda 9.0
  • GPU model and memory: Titan Xp

Describe the problem
I tried to install tensorflow-gpu follow the instruction at link and pip install -U tensorflow gpu. But when I check it import tensorflow as tf appear a bug as follow:

ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

Meanwhile, I also tried installing pytorch and succeeded. (Figure below)
screenshot from 2019-02-28 20-31-09

@qpoisson

This comment has been minimized.

Copy link

commented Feb 28, 2019

how did you solve it ?

@helonayala

This comment has been minimized.

Copy link

commented Feb 28, 2019

just had the same issue on Debian

@PhungVanDuy

This comment has been minimized.

Copy link
Author

commented Mar 1, 2019

how did you solve it?

Yes, I figured out my system installed Cuda 9.0 but maybe tensorflow 1.13.1 only support Cuda 10. So I installed tensorflow 1.12.0 and it works!

Thanks!

@helonayala

This comment has been minimized.

Copy link

commented Mar 1, 2019

thanks mate

worked for me as well

I will open an issue about it

@blemke

This comment has been minimized.

Copy link

commented Mar 1, 2019

I have TensorFlow 1.13.1 working on Ubunutu 16.04 with Python 3.7.2.
I had the error above using CUDA 10.1, but it went away after downgrading to CUDA 10.0

@mranon0007

This comment has been minimized.

Copy link

commented Mar 3, 2019

how did you solve it?

Yes, I figured out my system installed Cuda 9.0 but maybe tensorflow 1.13.1 only support Cuda 10. So I installed tensorflow 1.12.0 and it works!

Thanks!

Thank you. It worked for me.

@BornInWater

This comment has been minimized.

Copy link

commented Mar 4, 2019

Yes, I figured out my system installed Cuda 9.0 but maybe tensorflow 1.13.1 only support Cuda 10. So I installed tensorflow 1.12.0 and it works!

Thanks a lot mate! This helped me .

@Enzo90910

This comment has been minimized.

Copy link

commented Apr 2, 2019

I have TensorFlow 1.13.1 working on Ubunutu 16.04 with Python 3.7.2.
I had the error above using CUDA 10.1, but it went away after downgrading to CUDA 10.0

Same here on CentOS 7, TF 1.13.1 would not import with latest CUDA (10.1) but worked fine after downgrade to CUDA 10.0. Thanks for the tip.

@shivangpatel

This comment has been minimized.

Copy link

commented Apr 5, 2019

Without downgrade any chance ?

@Krulvis

This comment has been minimized.

Copy link

commented Apr 9, 2019

I have TensorFlow 1.13.1 working on Ubunutu 16.04 with Python 3.7.2.
I had the error above using CUDA 10.1, but it went away after downgrading to CUDA 10.0

How do you go about downgrading CUDA from 10.1 -> 10.0? Running arch btw

@japrogramer

This comment has been minimized.

Copy link

commented Apr 12, 2019

same problem with

tensorflow-gpu==2.0.0a0
Python 3.7.3
5.0.7-arch1-1-ARCH
linux 5.0.7.arch1-1
Dell Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series]
OpenGL renderer string: AMD RAVEN (DRM 3.27.0, 5.0.7-arch1-1-ARCH, LLVM 8.0.0)
#cuda not available
@shivangpatel

This comment has been minimized.

Copy link

commented Apr 13, 2019

We need to wait until tensorflow providing support to CUDA10.1.

@tshr729

This comment has been minimized.

Copy link

commented Apr 16, 2019

I had same problem with

tensorflow-gpu==1.13.1
Python 3.7.3
OS = Ubuntu 18.04
cuda 10.1
cudNN = 7.5

I fixed this by downgrading python to 3.5.5 and reinstall tensorflow-gpu

@Kailegh

This comment has been minimized.

Copy link

commented Apr 16, 2019

Can you explain how to easily downgrade from cuda 10.1->10.0? Do you also have to change the Cudnn libraries?

@Enzo90910

This comment has been minimized.

Copy link

commented Apr 16, 2019

Can you explain how to easily downgrade from cuda 10.1->10.0? Do you also have to change the Cudnn libraries?

To my recollection, I only had to install 10.0 and it installed in the same directory and updated the symlink. I did not reinstall libcudnn because I don't need it yet, but I expect you would have to if you need it.

ls -l /usr/local/
lrwxrwxrwx 1 root root 9 Apr 2 19:57 cuda -> cuda-10.0
drwxr-xr-x 16 root root 4096 Apr 2 19:57 cuda-10.0
drwxr-xr-x 17 root root 4096 Apr 2 18:17 cuda-10.1

@wendy2003888

This comment has been minimized.

Copy link

commented Apr 19, 2019

Can you explain how to easily downgrade from cuda 10.1->10.0? Do you also have to change the Cudnn libraries?

My situation is whichever install method I tried following the official archive here, apt-get always install 10.1
If you face same problem, you can reference this article

@shivangpatel

This comment has been minimized.

Copy link

commented Apr 25, 2019

On ubuntu 18.10 - I successfully installed CUDA 10.0 toolkit by downgrading gcc and g++ version to 7.3.
Now I can see my nvcc --version is 10.0 .

But still I getting that common errors.... libcublas.so.10.0 is missing

Any IDEA ? Now what's a issue !


shivangpatel@shivangpatel:~$ python3 -c 'import tensorflow as tf; print(tf.__version__)'  # for Python 3
Traceback (most recent call last):
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/shivangpatel/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

@semal

This comment has been minimized.

Copy link

commented May 9, 2019

using tensorflow 1.12, it is working.

@kiitosu

This comment has been minimized.

Copy link

commented May 10, 2019

Can you explain how to easily downgrade from cuda 10.1->10.0? Do you also have to change the Cudnn libraries?

you can do that with this command.
sudo apt purge cuda
sudo apt autoremove
sudo apt install cuda-10-0

And now it is working.

@apivovarov

This comment has been minimized.

Copy link

commented May 10, 2019

@kiitosu I tried that and still had the same error
When you install cuda-10-0 on ubuntu 16.04 it does not install libcudnn.so.7
To install cudnn you need to download cuDNN v7.5.1 deb package from https://developer.nvidia.com/rdp/cudnn-download
and then install it

sudo dpkg -i libcudnn7_7.5.1.10-1+cuda10.0_amd64.deb

After that import tensorflow as tf works!

@kiitosu

This comment has been minimized.

Copy link

commented May 10, 2019

@kiitosu I tried that and still had the same error
When you install cuda-10-0 on ubuntu 16.04 it does not install libcudnn.so.7
To install cudnn you need to download cuDNN v7.5.1 deb package from https://developer.nvidia.com/rdp/cudnn-download
and then install it

sudo dpkg -i libcudnn7_7.5.1.10-1+cuda10.0_amd64.deb

After that import tensorflow as tf works!

Yes I installed cuDNN before reinstall cuda10-0.

@7thstorm

This comment has been minimized.

Copy link

commented May 15, 2019

I'm having a similar issue.
when I do nvcc --version, I get
Cuda compilation tools, release 9.1, V9.1.85

but when I do nvidia-smi,
I see cuda version 10 (I'm using 10 in my projects, so there's obviously an issue. How do I uninstall 9.x if that is the issue?

@archenroot

This comment has been minimized.

Copy link

commented May 17, 2019

@tshr729 - I wonder how got it working with CUDA 10.1 by just downgrading python, doesn't make much sense to me :-), the issue is in not supporeted version by Tensorflow itself...

So on my Gentoo system I have CUDA 10.1.105 which creates following platform links:

andromeda /opt/cuda/targets/x86_64-linux/lib # ls -la|grep cublas
lrwxrwxrwx 1 root root        17 May  3 11:14 libcublasLt.so -> libcublasLt.so.10
lrwxrwxrwx 1 root root        25 May  3 11:14 libcublasLt.so.10 -> libcublasLt.so.10.1.0.105
-rwxr-xr-x 1 root root  37058992 May  3 11:14 libcublasLt.so.10.1.0.105
-rw-r--r-- 1 root root  23513690 May  3 11:14 libcublasLt_static.a
lrwxrwxrwx 1 root root        15 May  3 11:14 libcublas.so -> libcublas.so.10
lrwxrwxrwx 1 root root        23 May  3 11:14 libcublas.so.10 -> libcublas.so.10.1.0.105
-rwxr-xr-x 1 root root  78315120 May  3 11:14 libcublas.so.10.1.0.105
-rw-r--r-- 1 root root  90723762 May  3 11:14 libcublas_static.a

So once I downgrade to 10.0.130 I get what Tensorflow looks for in following platform structure:

andromeda /opt/cuda/targets/x86_64-linux/lib # ls -la|grep cublas
lrwxrwxrwx 1 root root        17 Sep 12  2018 libcublas.so -> libcublas.so.10.0
lrwxrwxrwx 1 root root        21 Sep 12  2018 libcublas.so.10.0 -> libcublas.so.10.0.130
-rwxr-xr-x 1 root root  70796360 Sep 12  2018 libcublas.so.10.0.130
-rw-r--r-- 1 root root  88164166 May 17 17:51 libcublas_static.a

So now 10.0 link which is correct. I cannot understand how it by default works for you...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.