MATLAB Answers

Getting error for NVIDIA CudNN with Matlab 2019b in Windows 10

136 views (last 30 days)
Susama Bagchi
Susama Bagchi on 1 Mar 2020
Edited: ChrisLyu on 8 Oct 2020 at 13:24
Hi,
I have installed Cuda9.2 along with cudNN following the instruction given in NVIDIA site in Windows 10. I am going to use deep learning in MATLAB 2019b.
When I used ---> coder.checkGpuInstall('full')
I got the below error and messages:
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : FAILED (Unable to find the 'NVIDIA_CUDNN' environment variable. Set 'NVIDIA_CUDNN' to point to the root directory of a NVIDIA cuDNN installation.)
TensorRT Environment : FAILED (Unable to find the 'NVIDIA_TENSORRT' environment variable. Set 'NVIDIA_TENSORRT' to point to the root directory of a TensorRT installation.)
Profiling Environment : PASSED
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
ans =
struct with fields:
gpu: 1
cuda: 1
cudnn: 0
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 1
Can anyone please help to resolve the issue?
With regards

  7 Comments

Show 4 older comments
ChrisLyu
ChrisLyu on 8 Oct 2020 at 7:38
>> setenv('NVIDIA_CUDNN','C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0')
>> getenv('NVIDIA_CUDNN')
ans =
'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0'
>> coder.checkGpuInstall('full')
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
TensorRT Environment : FAILED (Unable to find the 'NVIDIA_TENSORRT' environment variable. Set 'NVIDIA_TENSORRT' to point to the root directory of a TensorRT installation.)
Profiling Environment : PASSED
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
ans =
다음 필드를 포함한 struct:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 1

Sign in to comment.

Accepted Answer

cui
cui on 2 May 2020
coder.checkGpuInstall('full')
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : FAILED (Error generated while determining cuDNN library version 'getcuDNNVersion.cpp
C:\Users\Administrator\AppData\Local\Temp\tp21ea7936_7a49_41f9_ba3f_c12c8c253a5c\getcuDNNVersion.cpp: fatal error C1001: 编译器中发生内部错误。
(编译器文件“f:\dd\vctools\compiler\cxxfe\sl\p1\c\p0io.c”,第 2739 行)
要解决此问题,请尝试简化或更改上面所列位置附近的程序。
请选择 Visual C++
“帮助”菜单上的“技术支持”命令,或打开技术支持帮助文件来获得详细信息。
')
TensorRT Environment : FAILED (Unable to find the 'NVIDIA_TENSORRT' environment variable. Set 'NVIDIA_TENSORRT' to point to the root directory of a TensorRT installation.)
Profiling Environment : PASSED
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
ans =
struct with fields:
gpu: 1
cuda: 1
cudnn: 0
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 1
>> getenv('NVIDIA_CUDNN')
ans =
'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1'
Matlab R2020a , win10
how to solve this issue?

  4 Comments

Show 1 older comment
ChrisLyu
ChrisLyu on 8 Oct 2020 at 7:37
>> setenv('NVIDIA_CUDNN','C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0')
>> getenv('NVIDIA_CUDNN')
ans =
'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0'
>> coder.checkGpuInstall('full')
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
TensorRT Environment : FAILED (Unable to find the 'NVIDIA_TENSORRT' environment variable. Set 'NVIDIA_TENSORRT' to point to the root directory of a TensorRT installation.)
Profiling Environment : PASSED
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
ans =
다음 필드를 포함한 struct:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 1
ChrisLyu
ChrisLyu on 8 Oct 2020 at 13:22
You need Visual studio 2017 or earlier.
Run Matlab as administrator.

Sign in to comment.

More Answers (4)

Jaya Shankar
Jaya Shankar on 15 Mar 2020
Edited: Jaya Shankar on 15 Mar 2020
Hi Susama
Looks like the requisite environments for CUDNN and TENSORRT are not set correctly on your windows.
These environment variables should point to the location on your computer where these libraries were installed as described here
You can confirm if they are set correctly by running the following commands in MATLAB session
>> getenv('NVIDIA_CUDNN')
>> getenv('NVIDIA_TENSORRT')
If the above commands return empty , make sure to set the variables through you Windows's environment variable settings found via Control Panel ->System and Security->System->Advanced System settings.
Jaya

  1 Comment

Susama Bagchi
Susama Bagchi on 15 Mar 2020
Hi Jaya,
As per your given link, I already set the path and that can be seen from the below image. But when I tried your given code
>>getenv('NVIDIA_CUDNN')
I obtained below result:
ans
0x0 empty char array
So I would like to request you to let me know what variables I need to set in control panel.
Looking forward to hearing from you.
With regards
Susama

Sign in to comment.


Sourabh Kondapaka
Sourabh Kondapaka on 20 Mar 2020
Ensure that cuDNN library is installed in the correct directory.
Check Nvidia’s official documentation for installing in Windows :
These environment variables should point to the location on your computer where these libraries were installed as described here:
Important Note: The Operating system ( in your case , Windows 10) only uses environment variables which were made available when the system has started. So in order for windows 10 to be able to start using the new environment variables which you had just set you need restart your system. In other words, in order to use the new or edited environment variables you will need to restart your system.

  2 Comments

Susama Bagchi
Susama Bagchi on 20 Mar 2020
Hi,
I am using Windows 10 and MATLAB 2019b. My system has NVIDIA GEFORCE RTX 2060.
From MATLAB customer care, it hase been informed that only CUDA 10.1 is compatible with MATLAB 2019b. So I installed the same along with CUDA toolkit. I found from the below NVIDIA link that cuDNN is only a zip file containing 3 folders:
After unzipping, I moved the main folder as shown below:
But I am still facing problem.
Susama
Sourabh Kondapaka
Sourabh Kondapaka on 27 Mar 2020
The below link contains the approach for installing cudnn and then setting the environment variables in the Control Panel.
After this step it would be better to restart your PC and then check if the environment variables are available to Windows OS by following Jaya Shankar's Answer above.
Steps:
1) Follow the instructions in the above link for installing cuDNN library.
2) Set the environment variables by going to the control panel. Steps for this are also available in the same link and can be easily found online.
3) Restart your PC then open Matlab and check if the OS is able to access the environment variables by following Jaya Shankar's answer.

Sign in to comment.


yulei ji
yulei ji on 25 May 2020
I have the same problem.
coder.checkGpuInstall()
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED (Warning: Deep learning code generation has been tested with cuDNN v7.5. The provided cuDNN library v7.6 may not be fully compatible.)
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
What shuold I do

Stefano Marrone
Stefano Marrone on 18 Jul 2020
Hi, same problem here.
coder.checkGpuInstall
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
ans =
struct with fields:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 0
Did you solve it?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!