tensorflow: ImportError: libnvidia-fatbinaryloader.so.375.51: cannot open shared object file
- OS: Ubuntu 17.04
- *TensorFlow installed from: source
- TensorFlow version: 1.1.0rc1
- Bazel version (if compiling from source): 0.4.5
- CUDA/cuDNN version: 8.0/5.1
- GPU Model and Memory: NVIDIA GTX 1060, 6 GB RAM
- Exact command to reproduce:
import tensorflow as tf
Describe the problem clearly
I installed Tensorflow from source in order to have all CPU instructions supported.
(tensorflow) stefano@stefano-PC:~$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.5/dist-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/stefano/tensorflow/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/home/stefano/tensorflow/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libnvidia-fatbinaryloader.so.375.51: 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 "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.5/dist-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/stefano/tensorflow/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/home/stefano/tensorflow/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libnvidia-fatbinaryloader.so.375.51: 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.
>>>
My bashrc:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/cuda/lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/nvidia-375
export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/cuda/lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/nvidia-375
Problem is, that Tensorflow tries to load libnvidia-fatbinaryloader.so.375.51, but it exists only libnvidia-fatbinaryloader.so.375.38. I’m puzzled why TF tries to load a newer version, because right now, version 375.38 is the latest driver available!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 58 (14 by maintainers)
I added /usr/lib/nvidia-375 to my LD_LIBRARY_PATH and got rid of this import error @danindiana
Best solution is to prepend new paths to old LD_LIBRARY_PATH in ~/.bashrc as following:
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:/usr/lib/nvidia-375:$LD_LIBRARY_PATH
@sudoankit Environment variables solved the problem for me on ubuntu 16.04
nvidia-375.66 TF 1.1.0
Had the same
importissue. Before you do theimportI suggest to check if all these apply:Ubuntu 16.04 LTSnvidia-375,Secure Bootshould be off.cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0pip wheel.Anacondafor TensorFlow..bashrcorzshconfig:All the best.
I fixed the error by using a symbolic link.
ln -s libnvidia-fatbinaryloader.so.375.66 libnvidia-fatbinaryloader.so.375.51
Just because I’m at the same place at the same time as you guys, I’ll comment something non-obvious I found. Many hours were sacrificed for this knowledge.
You might think cuda can either be installed with a .deb file or a .run file. HOWEVER, if you want to use the slightly older 375.39, you need to use the run file. This annoyed me because I think the rule of thumb is not to mix run files and deb files with drivers.
The reason is that the run file will prompt you whether you want to upgrade the driver during installation. Whereas during the procedure: dpkg -i <cuda.deb>&& apt-get update && apt-get install cuda, there is no choice in the matter. Upgrading to 375.51 is forced. You can try to insist not to upgrade the driver with apt-get --nodeps or dpkg --ignore-dep=nvidia-375, but then apt-get will complain of broken dependencies.
I am currently exploring alternatives. My system is ubuntu16.04, 2*TitanX (pascal).
In my new eGPU setup with Ubuntu 17.10 with TF 1.6 (pip) with a GTX1070Ti and nVidia driver 387.34, I ran into the same error just some minutes ago. Even that it was working fine yesterday. I could simply solve it with this command:
As far as I know, this is something like manual nVidia Optimus, where I have to select the external GPU. I have to run this command every time before I can use the eGPU. Maybe this is just an eGPU specific solution, but at least it worked in my case and I wanted to share this approach.
What workaround? I don’t see one. I had exported all relevant path variables. See my first post. And btw: A workaround means, that users still will encounter this issue and will maybe find by luck this issue.
@madhupkumar
17:27:32 CDT UPDATE: OK. After installing cuDNN and exporting the LD_LIBRARY_PATH I was able to get it working. Thanks for your help.
Oops. OK. It appears I didn’t install libcudnn5 so let me see if that works and eliminates the error. Google’s Tensorflow install instructions don’t mention that unfortunately.
Can you be a little more specific? I seem to have added that to my LD_LIBRARY_PATH as well but am still getting an error. Thanks for the help.
echo $LD_LIBRARY_PATH /home/speed/torch/install/lib:/home/speed/torch/install/lib:/home/speed/torch/install/lib:/home/speed/torch/install/lib::/usr/lib/nvidia-375
This is what my bashrc has in it:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/cuda/lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/nvidia-375 export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/cuda/lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/nvidia-375
Perhaps there is a conflict with minconda3 linking?
added by Miniconda3 3.10.1 installer
export PATH=“/home/speed/miniconda3/bin:$PATH” source /home/speed/perl5/perlbrew/etc/bashrc export PATH=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/games” export PATH=“$PATH:$HOME/bin”
export NVM_DIR=“/home/speed/.nvm” [ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm
. /home/speed/torch/install/bin/torch-activate
. /home/speed/torch/install/bin/torch-activate
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/nvidia-375 export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/cuda/lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/nvidia-375
@EMCP last thing to check is going with:
find / -name 'libnvidia-*' 2>/dev/null | xargs ldd | grep "not found"that lets you know if reinstalling/upgrading the driver version left something broken (decina’s 10-tin-underpants principle)
Hi, I didn’t downgraded the driver, but the OS from 17.04 to 16-04 and then it worked. @Songweiping used Ubuntu 14.04 LTS and had the same issue.
It seems TF can’t handle different point releases of the driver.
I still have the same driver version on 16.04 (which strangely works):
I’m glad to hear it’s working. Our support matrix for Ubuntu Linux only includes versions 14 LTE to 16 LTE. Thank you for bringing the compatibility issues with 17 to the attention of the community.