ImportError: libnvidia-fatbinaryloader.so.375.39: cannot open shared object file: No such file or directory

10,610

Solution 1

I encountered this issue as well, there were two issues that needed to be resolved.

  1. I added /usr/lib/nvidia-375 to my LD_LIBRARY_PATH environment variable. You can verify that the file libnvidia-fatbinaryloader.so.375.39 lives in that directory. If not, find where it does live and add that path. It's not clear to me why this wasn't picked up properly in compiling the sources.

  2. Next I encountered the error:

    libstdc++.so.6: version `CXXABI_1.3.8' not found
    

If you encounter that it's because you have a newer version of gcc than is available in anaconda or your python installation. For me that meant adding this path to LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu/libstdc++.so.6

I also had to rename the old libstdc++.so.6 at the path shown in the error message. I couldn't find a way to convince python not to look in the default path without just renaming the file. There may be a cleaner way to do this, but that worked for me.

There were a lot of hidden gotchas in the installation.

Solution 2

In my case tensorflow-gpu was installed and working for a time, but installation of nvidia-opencl-icd-384 caused apt to upgrade my nvidia drivers from 384.47 to 384.59 but did NOT upgrade libcuda, nvidia-settings, and perhaps other packages. Upgrading libcuda should most likely solve the issue but probably best to purge and reinstall.

sudo apt-get purge nvidia*
sudo apt-get install libcuda1-384 nvidia-384 nvidia-384-dev nvidia-prime nvidia-settings

For me, symbolic link for libnvidia-fatbinaryloader.so.384.37 -> libnvidia-fatbinaryloader.so.384.59 in /usr/lib and /usr/lib32 did not correct the issue and LD_LIBRARY_PATH was already correctly configured.

Solution 3

In my case I previously had nvidia 387.34 and later uninstalled it using

sudo apt-get purge nvidia*

Then I installed driver 384.111, added /usr/lib/nvidia-384 to my LD_LIBRARY_PATH but tensorflow was still asking for libnvidia-fatbinaryloader.so.387.34

I realized that /usr/lib/x86_64-linux-gnu and /usr/lib/i386-linux-gnu still had libcuda.so.387.34 Once I deleted these files from both these directories tensorflow picked up the correct version of 384.

Do apt-get remove nvidia-{{version}} for uninstalling. Then do sudo apt-get purge nvidia*. This will be more foolproof I guess.

Solution 4

I encountered the same problem. Here is my solution!

  1. find libnvidia-fatbinaryloader.so.* file in you computer. For me

    (ubuntu16.04):sudo find -iname libnvidia-fatbinaryloader.so*

and then it shows libnvidia-fatbinaryloader.so.375.45,
NOTE:has different version number

  1. copy the file to you cuda lib,e.g:/usr/local/cuda/lib64/

  2. change the version number 375.45 to your missing file , 375.39,e.g:

    mv libnvidia-fatbinaryloader.so.375.45 libnvidia-fatbinaryloader.so.375.39

Share:
10,610
Admin
Author by

Admin

Updated on June 13, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm using Ubuntu 16.04, Cuda 8.0 and cudann-v5.1. I uninstalled Tensorflow-CPU version and reinstalled tensorflow-GPU enabled. Followed the instructions given here: https://alliseesolutions.wordpress.com/2016/09/08/install-gpu-tensorflow-from-sources-w-ubuntu-16-04-and-cuda-8-0-rc/

    However, when I try to load tensorflow, I get the following error:

    >>> import tensorflow as tf
    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 51, in <module>
        from tensorflow.python import pywrap_tensorflow
      File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 56, 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 41, 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: libnvidia-fatbinaryloader.so.375.39: cannot open shared object file: No such file or directory
    
    
    Failed to load the native TensorFlow runtime.