TensorFlow on Windows: “Couldn't open CUDA library cudnn64_5.dll”

后端 未结 12 1978
渐次进展
渐次进展 2021-01-01 17:35

Tensorflow just released windows support. I installed the gpu version and CUDA 8.0 and python 3.5. However, after I import the tensorflow I got the following error:

相关标签:
12条回答
  • 2021-01-01 17:53

    For those of you that land here because of:

    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library cublas64_80.dll
    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_blas.cc:2294] Unable to load cuBLAS DSO.
    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cudnn64_5.dll locally
    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library cufft64_80.dll
    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_fft.cc:344] Unable to load cuFFT DSO.
    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library nvcuda.dll locally
    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library curand64_80.dll
    I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_rng.cc:338] Unable to load cuRAND DSO.
    

    You need to add the CUDA regular path. I don't know why they didn't just put them together as one download. Very silly.

    C:\Users\user>set PATH=%PATH%;C:\tools\cuda\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin
    
    0 讨论(0)
  • 2021-01-01 17:55

    In addition to the answers above make sure that you've downloaded the supported version of cuDNN. Currently TensorFlow supports the older cuDNN v.5.1 while there is a newer cuDNN 6.0 available on Nvidia site. I had such errors with 6.0. When I rolled back to 5.1 everything worked.

    • Check TensorFlow requirments here: https://www.tensorflow.org/install/install_windows
    • Download the supported version of cuDNN from here: https://developer.nvidia.com/rdp/cudnn-download
    0 讨论(0)
  • 2021-01-01 17:55

    You have to download cudnn of your system, and extract it in the CUDA_PATH.

    My CUDA_PATH is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0

    0 讨论(0)
  • 2021-01-01 17:56

    Tried pip3 install --upgrade tensorflow after tensorflow-gpu and it worked fine.

    I think it's an issue only when trying pip3 install --upgrade tensorflow-gpu directly.

    0 讨论(0)
  • 2021-01-01 17:58

    I just downloaded the cuda.dll file from this website:https://developer.nvidia.com/cudnn

    and then moved the unzipped folder to where the rest of my anaconda libraries were.

    I use pycharm, so it was easy to see where all of the external libraries were stored within anaconda. Hope this helps!

    0 讨论(0)
  • 2021-01-01 18:00

    And you could check your Environmental variable in this way:

    import os
    print("Environmental variable:", os.environ["PATH"])
    C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
    

    My CUDA_path is "D:/CUDA/v8.0/bin", and I can not find my CUDA_path here. You will find your missing file here(such as "cublas64_80.dll", "cudnn64_5.dll", etc.) . The premise is that you had finish your CUDA installing.

    If you can not find your CUDA_path in Environmental variable, you could add your CUDA_path manually: (The order of the following code is very important. Add the CUDA_path before import TensorFlow.)

    import os
    os.environ["PATH"] += ";D:/CUDA/v8.0/bin;" 
    import tensorflow as tf
    

    Or you could add your CUDA_path in CMD temporarily:

    set PATH=%PATH%;"D:/CUDA/v8.0/bin"
    python3 tensorflow_model.py
    

    It work on my laptop(Windows10, Python3.6, Tensorflow-gpu==1.5). I think this two ways are simple solutions.

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