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

Cannot run tensorflow GPU 2.0 with cuda 9.2 #28022

Closed
ChristophePRAT opened this issue Apr 21, 2019 · 5 comments
Closed

Cannot run tensorflow GPU 2.0 with cuda 9.2 #28022

ChristophePRAT opened this issue Apr 21, 2019 · 5 comments
Assignees
Labels
stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.0 Issues relating to TensorFlow 2.0 type:build/install Build and install issues

Comments

@ChristophePRAT
Copy link

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • TensorFlow installed from (source or binary): I used virtualenv and pip install --upgrade tensorflow-gpu==2.0.0-alpha0
  • TensorFlow version: 2.0.0-alpha0
  • Python version: 3.5
  • Installed using virtualenv? pip? conda?: installed in virtualenv using
  • Name of the Virtualenv: tensorflow
  • CUDA/cuDNN version: cuda 9.2

Problem

Hello, I've installed tensorflow 2.0 with cuda 9.2 and when I run: >> import tensorflow, it prompts:

Traceback (most recent call last):
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/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 "/home/kexin/virtualenv/tensorflow/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/imp.py", line 342, 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 "<stdin>", line 1, in <module>
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/__init__.py", line 27, in <module>
    from tensorflow._api.v2 import audio
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/_api/v2/audio/__init__.py", line 8, in <module>
    from tensorflow.python.ops.gen_audio_ops import decode_wav
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/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 "/home/kexin/virtualenv/tensorflow/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/home/kexin/virtualenv/tensorflow/lib/python3.5/imp.py", line 342, 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.

Thank you!

@rootkitchao
Copy link

Tensorflow 2.0 Alpha 2.0 requires CUDN 10.0.So you need to use CUDN10.0.

@ppwwyyxx
Copy link
Contributor

  • Latest TensorFlow supports cuda 8-10. cudnn 6-7.
  • Each TensorFlow binary has to work with the version of cuda and cudnn it was built with. If they don't match, you have to change either the TensorFlow binary or the Nvidia softwares.
  • Official tensorflow binaries (the one downloaded by pip or conda) are built with cuda 9.0, cudnn 7 since TF 1.5, and cuda 10.0, cudnn 7 since TF 1.13. These are written in the release notes. You have to use the matching version of cuda if using the official binaries.
  • If you don't like to install a different version of Nvidia software, you can:
    (1) Use a different version of official TensorFlow binary
    (2) Use non-official binaries built by others, if they happen to match your existing Nvidia software. Some can be found at https://github.com/mind/wheels/releases, https://github.com/hadim/docker-tensorflow-builder#builds,
    https://github.com/inoryy/tensorflow-optimized-wheels
    (3) Build the binaries by yourself from source with your version of Nvidia software.

@muddham muddham self-assigned this Apr 22, 2019
@muddham
Copy link

muddham commented Apr 22, 2019

@ChristophePRAT Please try downgrading your tensorflow version and check and the link says tensorflow-gpu==2.0.0-alpha0 supports CUDA10.0 . Please follow the steps and let us know your progress.

@muddham muddham added 2.0.0-alpha0 stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues type:build/install Build and install issues labels Apr 22, 2019
@muddham muddham assigned jvishnuvardhan and unassigned muddham Apr 22, 2019
@jvishnuvardhan
Copy link
Contributor

jvishnuvardhan commented Apr 22, 2019

@ChristophePRAT In short,

(1) Official pip binaries ofl TF1.13.1 and TF2.0 are built with CUDA10.0. So you need to upgrade your CUDA if you want to install TF1.13.1 or TF2.0.

(2) Official binary of TF1.12 was built using CUDA9.0. So you need to downgrade from CUDA9.2 to CUDA9.0 if you want to install TF1.12.

(3) If you don't want to touch CUDA9.2, then you can use one of the link (https://github.com/inoryy/tensorflow-optimized-wheels) provided by @ppwwyyxx to install TF1.10

(4) If you are able to install TF from source, then you could use CUDA 9.2 with TF2.0. But, it could take more time and efforts.
Please let us know how it progresses. Thanks!

@ChristophePRAT
Copy link
Author

Thank you very much everybody! Just installed Cuda 10.0 with tensorflow 2.0 and it works.

@lvenugopalan lvenugopalan added the TF 2.0 Issues relating to TensorFlow 2.0 label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.0 Issues relating to TensorFlow 2.0 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

6 participants