• Register
0 votes

Problem :

I am facing following error :

ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.

Above error comes up when I tried to import the  tensorflow. Is there anybody who has faced this error before and know the solution on it?

6 5 3
7,540 points

1 Answer

0 votes

Solution :

If you want to use the TensorFlow with the GPU, then you will need to install the CUDA and cuDNN. Please follow the instructions given  on https://www.tensorflow.org/install/

If you are already done with the installation of CUDA and cuDNN, but still if you are facing this error, then you must have forgotten to export your libraries: So for the Linux, you may need to set the LD_LIBRARY_PATH to include CUDA libraries.


After installing the TensorFlow 1.11 GPU via the Anaconda with th below command

"conda install tensorflow-gpu" I also had experienced the same problem which you had. So before TF 1.11 I used the TF 1.04. Just before updating the TF I also updated the Nvidia Driver to the version 396 through the ppa.

There was no trace for the libcuda.so.1 in the entire linux.

After many trial and errors, my problem was resolved when I tried to change the nvidia driver to 390. The 390 version inserted the libcuda.so.1 to /usr/lib/i386-linux-gnu the directory, which completely solved the problem.

9 7 4
38,600 points

Related questions

0 votes
1 answer 90 views
Problem : I am very new to tensorflow-gpu, I want to use the tensorflow-gpu on my system. I have already tried to reinstall tensorflow-gpu many times but still it shows me the following error.If I use the tensorflow-cpu then it works correctly. Please Note: I ... ) ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory Can somebody help me in fixing above error ?
asked Feb 19 mphil 2.3k points
0 votes
2 answers 75 views
Problem : I have recently installed the cuda 8.0 and cuda 9.0 in the Gpu support system. I encountered the below error while importing from the keras module. It says it is unable to load the native tensorflow runtime. I have received the error log as below: Traceback ... is, Cuda compilation tools, release 8.0, V8.0.61 Is it the clash between two cuda versions? Have anyone solved this before?
asked Feb 18 mphil 2.3k points
0 votes
1 answer 222 views
Problem : I am building the TensorFlow from the source code. The build appears to succeed; but, when my TensorFlow program invokes the import tensorflow, one or both of the following errors starts appearing: · ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory · ImportError: libcudnn.5: cannot open shared object file: No such file or directory
asked Dec 9, 2019 alecxe 7.5k points
0 votes
1 answer 117 views
Problem : I am facing following error while importing the Tensorflow. >>> import tensorflow Traceback (most recent call last): File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module> from tensorflow.python. ... soon as I open the terminal windows, and type nvcc -V in the new terminal window it again shows that not installed
asked Dec 7, 2019 alecxe 7.5k points
0 votes
0 answers 174 views
Problem : I have installed Cuda 10.1 and cudnn on Ubuntu 18.04 for the first time and it seems to be installed properly as when I type nvcc and nvidia-smi I am getting proper response. I have also installed tensorflow using following command: user:~$ sudo ... solutions. Include the entire stack trace above this error message when asking for help. Am I missing something? How to resolve this issue?
asked Nov 27, 2019 AbhijitJ 38.6k points