TaeHyun Kim
TaeHyun Kim

Reputation: 41

On tensorflow v.1.15 sess=tf.Session() - Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found

I had downgrade tensorflow v.2.0 to v.1.15 And then I typed some code in ipython to check. But, there is some problem about cudnn64_7.dll

(base) C:\Users\puppy>ipython
Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import tensorflow as tf
2019-10-31 00:14:52.841679: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully         opened dynamic library cudart64_100.dll

In [2]: hello=tf.constant('Hello, tensorflow!')

In [3]: sess=tf.Session()
2019-10-31 00:17:45.140209: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library nvcuda.dll
2019-10-31 00:17:45.937511: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with     properties:
name: GeForce 920M major: 3 minor: 5 memoryClockRate(GHz): 0.954
pciBusID: 0000:03:00.0
2019-10-31 00:17:45.945256: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cudart64_100.dll
2019-10-31 00:17:45.981463: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cublas64_100.dll
2019-10-31 00:17:46.039438: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cufft64_100.dll
2019-10-31 00:17:46.056982: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library curand64_100.dll
2019-10-31 00:17:46.131993: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully     opened dynamic library cusolver64_100.dll
2019-10-31 00:17:46.192560: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll
2019-10-31 00:17:46.202156: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load     dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2019-10-31 00:17:46.209181: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU         libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the     required libraries for your platform.
Skipping registering GPU devices...
2019-10-31 00:17:46.223313: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports     instructions that this TensorFlow binary was not compiled to use: AVX2
2019-10-31 00:17:46.237318: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect     StreamExecutor with strength 1 edge matrix:
2019-10-31 00:17:46.243341: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]

In [4]: print(sess.run(hello))
b'Hello, tensorflow!'

this part is problem

2019-10-31 00:17:46.202156: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load     dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2019-10-31 00:17:46.209181: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU         libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the     required libraries for your platform.
Skipping registering GPU devices...
2019-10-31 00:17:46.223313: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports     instructions that this TensorFlow binary was not compiled to use: AVX2
2019-10-31 00:17:46.237318: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect     StreamExecutor with strength 1 edge matrix:

Why I cannot find cudnn64_7.dll? I download 'cuDNN v7.6.4 (September 27, 2019), for CUDA 10.0' and add to the path of system variable like this

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\dll
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\CUPTI\libx64

How can I fix this problem and use GPU library?

Upvotes: 4

Views: 4596

Answers (1)

Debjit Datta
Debjit Datta

Reputation: 121

It sometimes happen that cudnn64_7.dll gets removed automatically from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin. Try re-pasting the file from the extracted cudnn package and it will work.

Upvotes: 2

Related Questions