CUDA 9.0 ImportError: libcublas.so.8.0
Hi, Currently working on some neural nets stuff with python 3.6.3, until now I was using tensorflow cpu and recently decided to switch to -GPU version. Followed all the steps from official websites in this order: 1. Installation of CUDA Toolkit (9.0) 2. Installation of cuDNN v7.0 3. Installation of libcupti-dev library (7.5.18-0ubuntu1) 4. Installation of Tensorflow-GPU Of course, after step one and two I have verified the installation using ./deviceQuery and ./bandwidthTest, both of them passed correctly. Also verified cuDNN using ./mnistCUDNN, test also passed. Installed tensorflow-gpu, tried to verify this using sample code from the website (both python3 Shell and IDE Spyder) but unfortunately no luck. The stack trace from the shell: [code] Traceback (most recent call last): File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "/home/albert/anaconda3/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 "/home/albert/anaconda3/lib/python3.6/imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "/home/albert/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic return _load(spec) ImportError: libcublas.so.8.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/albert/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module> from tensorflow.python import * File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 72, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "/home/albert/anaconda3/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 "/home/albert/anaconda3/lib/python3.6/imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "/home/albert/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic return _load(spec) ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. [/code] The import error shows that libcublas.so.8.0 is missing, however in both cuda/lib64 and cuda-9.0/lib64 the file does exists (newer version libcublas.so.9.0). I have checked the environmental variables and all seems to be perfectly correct. Tried removing everything that is associated with nvidia from my linux including drivers, cuda toolkit, cudnn etc. and installing it all over again several times but I always end up getting the same error. Any suggestions what could possibly go wrong or how to fix this? Regards, Albert
Hi,

Currently working on some neural nets stuff with python 3.6.3, until now I was using tensorflow cpu and recently decided to switch to -GPU version. Followed all the steps from official websites in this order:

1. Installation of CUDA Toolkit (9.0)
2. Installation of cuDNN v7.0
3. Installation of libcupti-dev library (7.5.18-0ubuntu1)
4. Installation of Tensorflow-GPU

Of course, after step one and two I have verified the installation using ./deviceQuery and ./bandwidthTest, both of them passed correctly. Also verified cuDNN using ./mnistCUDNN, test also passed.

Installed tensorflow-gpu, tried to verify this using sample code from the website (both python3 Shell and IDE Spyder) but unfortunately no luck.

The stack trace from the shell:
Traceback (most recent call last):
File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/albert/anaconda3/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 "/home/albert/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/albert/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.8.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/albert/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/albert/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/albert/anaconda3/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 "/home/albert/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/albert/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

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


The import error shows that libcublas.so.8.0 is missing, however in both cuda/lib64 and cuda-9.0/lib64 the file does exists (newer version libcublas.so.9.0). I have checked the environmental variables and all seems to be perfectly correct. Tried removing everything that is associated with nvidia from my linux including drivers, cuda toolkit, cudnn etc. and installing it all over again several times but I always end up getting the same error.

Any suggestions what could possibly go wrong or how to fix this?

Regards,

Albert

#1
Posted 11/08/2017 02:22 PM   
currently, the binary installable versions of TF-GPU require CUDA 8. This will probably change in the future, but for those binaries, you can't satisfy the requirement with CUDA 9. If you really want to use CUDA 9/CUDNN 7, you will need to build TF from sources. Otherwise install CUDA 8 and point TF at that. CUDA 8 can be installed alongside CUDA 9 and you don't need to modify the driver; the CUDA 9 GPU driver will work with CUDA 8 install.
currently, the binary installable versions of TF-GPU require CUDA 8. This will probably change in the future, but for those binaries, you can't satisfy the requirement with CUDA 9.

If you really want to use CUDA 9/CUDNN 7, you will need to build TF from sources. Otherwise install CUDA 8 and point TF at that. CUDA 8 can be installed alongside CUDA 9 and you don't need to modify the driver; the CUDA 9 GPU driver will work with CUDA 8 install.

#2
Posted 11/08/2017 04:17 PM   
Alright, brilliant, I'll try that solution, lastly with the cuDNN do I have to downgrade to v6 for it to work with CUDA 8?
Alright, brilliant, I'll try that solution, lastly with the cuDNN do I have to downgrade to v6 for it to work with CUDA 8?

#3
Posted 11/08/2017 04:30 PM   
cudnn has specific versions designed to work with specific CUDA versions. Please take a look at the cudnn download page, it will identify what is available for each cuda version.
cudnn has specific versions designed to work with specific CUDA versions. Please take a look at the cudnn download page, it will identify what is available for each cuda version.

#4
Posted 11/08/2017 04:33 PM   
Where are the older CUDA downloads located? From the download link only the latest CUDA 9 is available. I need to install CUDA 8 for the same reasons listed in this post.
Where are the older CUDA downloads located? From the download link only the latest CUDA 9 is available. I need to install CUDA 8 for the same reasons listed in this post.

#5
Posted 11/12/2017 09:52 PM   
google "cuda toolkit archive"
google "cuda toolkit archive"

#6
Posted 11/12/2017 10:34 PM   
Thank you. I failed at searching on my own, but with your keywords I found it: https://developer.nvidia.com/cuda-toolkit-archive
Thank you. I failed at searching on my own, but with your keywords I found it:


https://developer.nvidia.com/cuda-toolkit-archive

#7
Posted 11/12/2017 10:45 PM   
Scroll To Top

Add Reply