Tensorflow-gpu cudnn_cnn_infer64_8.dll not recognised [Error code 193]
Question:
When trying to use Tensorflow (gpu), it won’t run because of this :
Could not load library cudnn_cnn_infer64_8.dll. Error code 193 Please make sure cudnn_cnn_infer64_8.dll is in your library path!
The thing is, that I have this lib :
and I’ve added the environnement variables :
Full error message :
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-01-02 00:22:39.438945: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 5468 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3070, pci bus id: 0000:01:00.0, compute capability: 8.6
2022-01-02 00:22:40.466945: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 5468 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3070, pci bus id: 0000:01:00.0, compute capability: 8.6
2022-01-02 00:22:41.646700: I tensorflow/stream_executor/cuda/cuda_blas.cc:1774] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
2022-01-02 00:22:41.780145: I tensorflow/stream_executor/cuda/cuda_dnn.cc:366] Loaded cuDNN version 8301
Could not load library cudnn_cnn_infer64_8.dll. Error code 193
Please make sure cudnn_cnn_infer64_8.dll is in your library path!
Answers:
It was simply because I can’t read the doc properly…
I installed all the latest versions of CUDA, cuDNN and Tensorflow GPU, but they aren’t compatible.
here is what helped me : https://www.tensorflow.org/install/source_windows#gpu
So I installed :
- tensorflow_gpu-2.6
- CUDA 11.2
- cuDNN 8.1
and guess what, everything works fine now !
So in case of :
Could not load library cudnn_cnn_infer64_8.dll. Error code 126
or
Could not load library cudnn_cnn_infer64_8.dll. Error code 193
Re-install CUDA with the recommended versions and don’t forget to update your PATH
My case.
The PATH has been duplicated.
error
PATH=****;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.3bin;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.3libnvvp;*****;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6bin;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libnvvp;
correct
PATH=****;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6bin;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libnvvp;
The cuda installers add path. Duplicated paths often will cause errors.
When trying to use Tensorflow (gpu), it won’t run because of this :
Could not load library cudnn_cnn_infer64_8.dll. Error code 193 Please make sure cudnn_cnn_infer64_8.dll is in your library path!
The thing is, that I have this lib :
and I’ve added the environnement variables :
Full error message :
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-01-02 00:22:39.438945: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 5468 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3070, pci bus id: 0000:01:00.0, compute capability: 8.6
2022-01-02 00:22:40.466945: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 5468 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3070, pci bus id: 0000:01:00.0, compute capability: 8.6
2022-01-02 00:22:41.646700: I tensorflow/stream_executor/cuda/cuda_blas.cc:1774] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
2022-01-02 00:22:41.780145: I tensorflow/stream_executor/cuda/cuda_dnn.cc:366] Loaded cuDNN version 8301
Could not load library cudnn_cnn_infer64_8.dll. Error code 193
Please make sure cudnn_cnn_infer64_8.dll is in your library path!
It was simply because I can’t read the doc properly…
I installed all the latest versions of CUDA, cuDNN and Tensorflow GPU, but they aren’t compatible.
here is what helped me : https://www.tensorflow.org/install/source_windows#gpu
So I installed :
- tensorflow_gpu-2.6
- CUDA 11.2
- cuDNN 8.1
and guess what, everything works fine now !
So in case of :
Could not load library cudnn_cnn_infer64_8.dll. Error code 126
or
Could not load library cudnn_cnn_infer64_8.dll. Error code 193
Re-install CUDA with the recommended versions and don’t forget to update your PATH
My case.
The PATH has been duplicated.
error
PATH=****;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.3bin;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.3libnvvp;*****;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6bin;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libnvvp;
correct
PATH=****;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6bin;C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.6libnvvp;
The cuda installers add path. Duplicated paths often will cause errors.