ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

12,281

Solution 1

I solved the issue. Actually I have cuda 7.5 installed and I was installing latest tensorflow version which probably support cuda 8.0. So I downgraded.

 pip install --upgrade \ https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl

Solution 2

This may be connected to the incorrect linking of your libraries.
Simply run sudo ldconfig /usr/local/cuda/lib64. It solved for me.

If you need to know more: ldconfig man page.

Share:
12,281
Junaid Ahmad
Author by

Junaid Ahmad

Junaid is a highly motivated Web Engineer. He is getting serious in Open-Source Contributions. Junaid's GitHub profile can be found here: https://github.com/MJunaidAhmad Junaid has also maintained a personal website with a detailed description of his nature of work: https://devjunaid.wordpress.com/ He has mostly worked (but not limited to) in the domain of e-Commerce, AI, Chat-bots, Digital Marketing as a full stack developer. Junaid has expert level experience with the following technologies: PHP, JAVASCRIPT, jQuery, Laravel, VueJS, NodeJS, ReactJS, WordPress. Junaid's goal is to become a successful software architect and an independent researcher.

Updated on June 05, 2022

Comments

  • Junaid Ahmad
    Junaid Ahmad almost 2 years

    Possible duplicate of this question. I have a gpu account to whom I connect through putty (ssh login). I have created a virtualenv there and I am installing tenorflow through pip for gpu. Everything works fine, when I run command

    $ pip list
    

    following list is being shown:

     backports.weakref (1.0rc1)
     bleach (1.5.0)
     funcsigs (1.0.2)
     html5lib (0.9999999)
     Markdown (2.6.8)
     mock (2.0.0)
     numpy (1.13.1)
     olefile (0.44)
     pbr (3.1.1)
     Pillow (4.2.1)
     pip (9.0.1)
     protobuf (3.3.0)
     setuptools (36.0.1)
     six (1.10.0)
     tensorflow-gpu (1.2.1)
     Werkzeug (0.12.2)
     wheel (0.29.0)
    

    But when I run:

    $ python
    >>> import tensorflow
    

    It shows the following error:

      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/nauman/junaid/final/test/lib/python2.7/site-
      packages/tensorflow/__init__.py", line 24, in <module>
      from tensorflow.python import *
      File "/home/nauman/junaid/final/test/lib/python2.7/site-
      packages/tensorflow/python/__init__.py", line 49, in <module>
      from tensorflow.python import pywrap_tensorflow
      File "/home/nauman/junaid/final/test/lib/python2.7/site-
      packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
      raise ImportError(msg)
      ImportError: Traceback (most recent call last):
      File "/home/nauman/junaid/final/test/lib/python2.7/site-
      packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
      from tensorflow.python.pywrap_tensorflow_internal import *
      File "/home/nauman/junaid/final/test/lib/python2.7/site-
      packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in 
      <module>
      _pywrap_tensorflow_internal = swig_import_helper()
      File "/home/nauman/junaid/final/test/lib/python2.7/site-
      packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in 
      swig_import_helper
      _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, 
      description)
      ImportError: libcusolver.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.
    

    I have also set my environment variables like this:

      export CUDA_HOME=/opt/cuda
      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
    

    Moreover, I found that libcusolver.so.8.0 is not there, while libcusolver.so.7.5 is there in cuda/lib64/. Somehow tensorflow is finding wrong file or I ain't know nothing. Any help would be appreciated as I am new to all this stuff. Python version: 2.7 OS: Linux

  • Shadi
    Shadi over 6 years
    I also just installed tensorflow version 1.2.0 instead of 1.3.0 to use cuda 7.5 with pip install tensorflow==1.2.0. Note that I left tensorflow-gpu at 1.3.0
  • markroxor
    markroxor over 6 years
    @ben26941 my guess is that you are using cuda-9.0 . In that case try sudo apt install nvidia-cuda-dev (if you are using an Ubuntu distribution)