After building TensorFlow from source, seeing libcudart.so and libcudnn errors

后端 未结 12 2479
萌比男神i
萌比男神i 2020-11-28 06:19

I\'m building TensorFlow from source code. The build appears to succeed; however, when my TensorFlow program invokes import tensorflow, one or both of the foll

相关标签:
12条回答
  • 2020-11-28 06:32

    I fixed this just adding the cuda path to my .bashrc

    export LD_LIBRARY_PATH=/usr/local/cuda/lib64/
    

    Just have in mind that first you need to go to nvidia Deep Learning page, register and download cuDNN, extract and copy the files from include and lib64 folders into your cuda installation.

    0 讨论(0)
  • 2020-11-28 06:33

    Check the NVIDIA requirements to run TensorFlow with GPU support (link):

    • CUDA® Toolkit 8.0

    • The NVIDIA drivers associated with CUDA Toolkit 8.0

    • cuDNN v6.0

    • GPU card with CUDA Compute Capability 3.0 or higher

    • The libcupti-dev library, which is the NVIDIA CUDA Profile Tools Interface

    I installed the cuda v5.1 and the message below still remains:

    ImportError: libcudart.so.8.0: cannot open shared object file:
      No such file or directory
    

    I so I got pissed off because everything looks fine, so I decide to check my GPU with the command (on Linux):

    glxinfo | grep GeForce
    

    And I noticed that my NVIDIA GPU is not supported:

    OpenGL renderer string: **GeForce GTX 560M**/PCIe/SSE2
    

    In this link you can find a list, like that:

    So my solution was use tensor flow without GPU support. So I do:

    pip uninstall tensorflow-gpu
    

    I install whithout support:

    pip install tensorflow
    
    0 讨论(0)
  • 2020-11-28 06:34

    As of now tensor-flow supports cuda-9.0

    Do following things. Hope it helps :

    $ sudo apt-get install cuda-9.0
    $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
    

    Download cuDNN for 9.0 (You need to register before downloading) https://developer.nvidia.com/rdp/form/cudnn-download-survey

    $ sudo dpkg -i libcudnn7_7.1.2.21-1+cuda9.0_amd64.deb
    

    Close all terminal and open new

    $ source activate tensorflow
    $ python
    >> import tensorflow as tf
    

    You should not get any error after this.

    0 讨论(0)
  • 2020-11-28 06:34

    First, Install CUDA library (version 7.5) from here

    Installation Instructions: 1- sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb 2- sudo apt-get update 3- sudo apt-get install cuda

    Second, install the cuDNN from here

    Third, export cuDNN path:

    export LD_LIBRARY_PATH=/usr/local/cuda/lib64/
    

    In case you have an error like "The package libcudnnX needs to be reinstalled", follow those steps here

    0 讨论(0)
  • 2020-11-28 06:39

    Mysteriously, my libcudnn.so.5 was installed at ~/cuda/lib64. For people like me, you need to change

    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:~/cuda/lib64"
    

    to

    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/yourusername/cuda/lib64"
    
    0 讨论(0)
  • 2020-11-28 06:40

    The preceding errors are typically caused by not specifying a version number for the Cuda SDK or cuDNN when you run the configure script. In other words, when running the configure script, always specify a version number in response to the following two questions:

    • Please specify the Cuda SDK version you want to use, e.g. 7.0.
    • Please specify the cuDNN version you want to use.

    Don't accept the system defaults.

    0 讨论(0)
提交回复
热议问题