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

This error is appeared when import tensorflow. I need to know steps to solve this problem.

Zaccharie Ramzi
  • 2,106
  • 1
  • 18
  • 37
Wael Eid
  • 149
  • 1
  • 3
  • 9

2 Answers2

5

If you are using TensorFlow with GPU, you need to install CUDA and cuDNN. Please follow instructions on https://www.tensorflow.org/install/

If you have already install CUDA and cuDNN, but still get this error, then you probably forgot to export your libraries: for Linux, you may need to set LD_LIBRARY_PATH to include CUDA libraries.

Max
  • 1,014
  • 6
  • 7
  • 1
    How can i set LD_LIBRARY_PATH? – Wael Eid Nov 05 '17 at 08:28
  • 1
    Something like: `$ export LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64/:/opt/intel/ipp/lib/intel64_lin:/usr/local/lib:/usr/local/cuda/extras/CUPTI/lib64/:/opt/intel/ipp/lib/intel64_lin:$LD_LIBRARY_PATH` – Max Nov 05 '17 at 16:17
  • The previous problem is solved but ImportError: /lib64/libc.so.6: version `GLIBC_2.16' not found appears when i write import tensorflow – Wael Eid Nov 05 '17 at 19:47
0

After installing TensorFlow 1.11 GPU via Anaconda "conda install tensorflow-gpu" I also experienced the same problem. Before TF 1.11 I used TF 1.04. Just before the TF update I updated Nvidia Driver to the version 396 through ppa.

There was no trace of libcuda.so.1 in my entire linux.

After many trials, the problem was solved when I changed the nvidia driver to 390. The 390 version inserted libcuda.so.1 to /usr/lib/i386-linux-gnu directory, which evidently solved the problem.

Hyunbong Lee
  • 826
  • 6
  • 4