0

I first installed cuda 9.0 and cudnn for cuda 9.0 and the latest tensorflow-gpu 1.6. But I noticed my nvidia-driver 384.111 doesn't support cuda 9.0. SO I uninstalled cuda 9.0, cudnn and tensorflow-gpu 1.5 and reinstalled tensorflow-gpu 1.5, cuda8.0 and cudnn v7.1 for cuda 8.0. But when I import tensorflow, it always shows:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

Seems like tensorflow is trying to find libcublas.so.9.0 however I only have cuda 8.0 installed. It's clear that I can use tensorflow 1.5 with cuda 8.0.

Does anyone know how to solve this?

Update: Looks like tensorflow officially doesn't provide binaries compiled with cuda 8.0 and cudnn v7.1 after tensorflow 1.4. Does any one know where to download those binaries?

talonmies
  • 70,661
  • 34
  • 192
  • 269
tuming1990
  • 89
  • 3
  • 8

2 Answers2

1

I assume that you are installing TF using pip install. Tensorflow install page (currently, version 1.6) mentions than that CUDA® Toolkit 9.0 along with cuDNN v7.0 are the requirements for your installation.

Since TF version 1.5 CUDA9+CUDNN7 are among new requirements. Since CUDA9 relies on NVIDIA driver 384+ it causes a chain of updates of software: driver, CUDA, CUDNN, TF, etc. CUDA 9.1 would require nvidia driver 390 or later.

Ways to solve the issue you can follow one of following paths:

  • Update nvidia driver and switch back to CUDA 9.0 and cuDNN 7.0. You can have multiple versions of CUDA and CUDNN coexisting on your system.
  • Install TF 1.4 which requires exactly CUDA 8.0 and cuDNN v6.0
  • Compile TF from source. It requires investing some time and installing additional software. In my experience can easily take hours even if it is not your first time.
  • Find a wheel of TF compiled for your system configuration.
y.selivonchyk
  • 8,987
  • 8
  • 54
  • 77
  • 1
    CUDA 9 can work with the 384.111 driver mentioned. If you go to http://www.nvidia.com/drivers, select a GPU like Tesla P100, and select linux, and cuda 9.0, the wizard will actually suggest 384.111 – Robert Crovella Mar 21 '18 at 00:08
  • 1
    You mean you fixed it where it says "CUDA 9.0 would require nvidia driver 390 or later" ? – Robert Crovella Mar 21 '18 at 00:46
0

I have had the same problem when installing tensorflow-gpu-1.6, i have resolved my problem like this :
step(1): for tensorflow-gpu-1.6 we can use cuda9.0 and cudnn7 so download cuda9.0 debian if you are using Ubuntu, you can download cuda9.0 from here https://developer.nvidia.com/cuda-90-download-archive
step(2): enter the following command

sudo apt-get --purge remove cuda

step(3):
sudo apt autoremove

step(4): and now install the downloaded cuda9.0 file
step(5): and nvidia driver 384 is ok for cuda9.0, so no worries
step(6): edit the path for cuda9.0 in bashrc
gedit ~/.bashrc

I have done the same procedure like i removed every thing related to cuda from my pc, and then tried installing cuda9.0 and it did worked for me.
Let me know whether problem is resolved or not, Thank You.
shanmuka
  • 1
  • 3