Tensorflow error in Windows: failed call to cuinit: CUDA_ ERROR_ UNKNOWN

    • environment
    • Linux this problem
    • is mispositioned
            • 0. Do you have the correct cuda and cudnn versions installed?
            • 1. Do you have cudnn and where?Where are the DLL files such as CUDNN64_7.DLL in the compressed package (the number changes after different versions)?2. Did you add the folder containing cudnn64_7.dll (the number changes after different versions) to the environment variable path?

environment

    系统:window10 *64
    显卡:gtx970
    python环境:3.5.4
    tensorflow:1.8.0
    cuda:cuda9.0
    cudnn:cuDNN v7.1.1 (Feb 28, 2018), for CUDA 9.0

this problem in Linux

in addition to the cause mentioned in this article, the following may also refer to reference:
http://kawahara.ca/tensorflow-failed-call-to-cuinit-cuda_error_unknown/

is mispositioned

0. Have you installed the correct cuda and cudnn versions to match?

as of 2018.5.4 the installation tutorial of tensorflow official website is cuda9.0+cudnn7.0+ the latest tensorflow (1.8.0)
must strictly match the three versions (tf version with 1.7 and 1.6 although no problem was found)
official website original words:

if one of your packages is different from the above version, change to the specified version. In particular, the cuDNN version must match exactly : if cudnn64_7.dll cannot be found, TensorFlow will not load. To use different versions of cuDNN, you must build from source code.

if you use cuda9.1 you may encounter problems, either in win or Linux, as the latest version of tf is compiled against cuda9.0. Based on cuda9.1 tf under Linux build can see my articles at https://blog.csdn.net/u014561933/article/details/79995536.

if you don’t use cudnn7.0 like I do you’ll get the error I mentioned in the title, although I’m using cudnn7.1 for version 9.0. The website says matches exactly :

if this is your problem, just reinstall and restart.

1. Do you have cudnn installed and where?Where are the DLL files such as CUDNN64_7.DLL in the compressed package (the number changes after different versions)?

you need to make sure that all the files in the cudnn package like bin, include, lib/x64 are copied to the corresponding files in cuda.

2. Did you add the folder containing cudnn64_7.dll (the number changes after different versions) to the environment variable path?

is generally in cuda/bin, this directory will be added automatically in Windows installation, Linux requires manual operation.

Read More: