Wael Eid
Wael Eid

Reputation: 149

Import error when trying to import tensorflow with gpu

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.

Upvotes: 4

Views: 9685

Answers (2)

Hyunbong Lee
Hyunbong Lee

Reputation: 826

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.

Upvotes: 0

Max
Max

Reputation: 1039

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.

Upvotes: 5

Related Questions