nvidia-docker icon indicating copy to clipboard operation
nvidia-docker copied to clipboard

Tensorflow import error "Couldn't open CUDA library libcuda.so.1" Ubuntu 14.04 Cuda 8.0 Dell 7559 i7

Open anuj2rock opened this issue 10 years ago • 3 comments

Hi,

I need help regarding installation of Tensorflow on Ubuntu with GPU support .

I have followed a blog on bumblebee+ubuntu on Dell 7559 and it works perfectly fine.

What's done>>

  1. Ubuntu 14.04 lts +windows 10 dual boot
  2. bumblebee + nvidia 367 drivers
  3. Cuda 8.0 (without packaged nvidia drivers)
  4. cuDNN 5.1
  5. Tensorflow 0.11rc2 with python3

Now its stuck at last step which is when I test TF installation by typing "import tensorflow as tf" inside python3 console ## it fails to import libcuda.so.1 file at LD library path(which is correctly set)

Some facts:-- First>>> ls -l /usr/local/cuda-8.0/lib64/stubs/libcuda.* -rwxr-xr-x 1 root root 40048 Nov 8 18:46 /usr/local/cuda-8.0/lib64/stubs/libcuda.so

Second>>> import tensorflow as tf I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:119] Couldn't open CUDA library libcuda.so.1. LD_LIBRARY_PATH: :/usr/local/cuda-8.0/lib64:/usr/local/cuda/extras/CUPTI/lib64 I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: airig-Inspiron-7559 I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: Not found: was unable to find libcuda.so DSO loaded into this program I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:363] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 367.57 Mon Oct 3 20:37:01 PDT 2016 GCC version: gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) """ I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 367.57.0 I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1091] LD_LIBRARY_PATH: :/usr/local/cuda-8.0/lib64:/usr/local/cuda/extras/CUPTI/lib64 I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1092] failed to find libcuda.so on this system: Failed precondition: could not dlopen DSO: libcuda.so.1; dlerror: libnvidia-fatbinaryloader.so.367.57: cannot open shared object file: No such file or directory I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so.8.0 locally

Third>>>> $ sudo find /usr/ -name 'libcuda.so.1' /usr/local/cuda-8.0/lib64/libcuda.so.1 /usr/lib/i386-linux-gnu/libcuda.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so.1

Fourth>>> ldconfig -p .. libcupsfilters.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcupsfilters.so.1 libcupscgi.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcupscgi.so.1 libcups.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcups.so.2 libcuda.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcuda.so.1 libcuda.so.1 (libc6) => /usr/lib/i386-linux-gnu/libcuda.so.1 libcuda.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcuda.so libcuda.so (libc6) => /usr/lib/i386-linux-gnu/libcuda.so libcrypto.so.1.0.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 libcrypto.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcrypto.so libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.24) => /lib/x86_64-linux-gnu/libcrypt.so.1 ........

Can you please help in locating this file or pointing to tweaks in NVIDIA installation stage.

Thanks in advance

anuj2rock avatar Nov 09 '16 10:11 anuj2rock

It doesn't look like you're using docker or nvidia-docker, right? In this case, you should seek help on the NVIDIA developer forum or maybe look at TensorFlow mailing lists. As a first step though, try running nvidia-smi and running the CUDA samples in /usr/local/cuda/samples. If it doesn't work, your setup is broken.

flx42 avatar Nov 09 '16 17:11 flx42

@flx42 Ok, thanks for the reply. Will take it up in respective forum.

anuj2rock avatar Nov 09 '16 17:11 anuj2rock

I am facing the same issue using nvidia-docker during run time

nvidia-docker run tfseqgpu

Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/seq2seq/bin/train.py", line 29, in import tensorflow as tf File "/usr/local/lib/python2.7/dist-packages/tensorflow/init.py", line 24, in from tensorflow.python import * File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py", line 51, in from tensorflow.python import pywrap_tensorflow File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in 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 from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _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: libcudnn.so.5: cannot open shared object file: No such file or directory

vishalnus avatar Jun 16 '17 07:06 vishalnus