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

조회 수: 20 (최근 30일)
Susama Bagchi
Susama Bagchi 2020년 3월 1일
답변: Tuong 2024년 3월 15일
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
ChrisLyu
ChrisLyu 2020년 10월 8일
Run Matlab as administrator.

댓글을 달려면 로그인하십시오.

채택된 답변

cui,xingxing
cui,xingxing 2020년 5월 2일
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
ChrisLyu
ChrisLyu 2020년 10월 8일
편집: ChrisLyu 2020년 10월 8일
You need Visual studio 2017 or earlier.
Run Matlab as administrator.

댓글을 달려면 로그인하십시오.

추가 답변 (7개)

yulei ji
yulei ji 2020년 5월 25일
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
  댓글 수: 2
Susama Bagchi
Susama Bagchi 2020년 5월 25일
Please contact MATLAB support services.
Lo jungle
Lo jungle 2021년 12월 26일
have you solve this probelm?

댓글을 달려면 로그인하십시오.


Tuong
Tuong 2024년 3월 15일
This is how I do it on Matlab R2023b + Window 10 x64
First I install CUDA 11.8
Then I install CUDNN 9.0 (it would be better to use CUDNN 8.7)
Then I do 3 copy steps
Copy step 1:
Copy all files from C:\Program Files\NVIDIA\CUDNN\v9.0\bin\11.8\ to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\
Copy step 2:
Copy all files from C:\Program Files\NVIDIA\CUDNN\v9.0\include\11.8\ to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include\
Copy step 3:
Copy all file from C:\Program Files\NVIDIA\CUDNN\v9.0\lib\11.8\x64\ to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64\
Now I add the environment variables like this
Restart my computer and open matlab again. I then type
gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'cudnn'; % it can be changed to 'tensort'
gpuEnvObj.DeepCodeexec = 1;
gpuEnvObj.DeepCodegen = 1;
results = coder.checkGpuInstall(gpuEnvObj)
Another test is to use gpucoderSetup on the matlab command prompt
You can then run checks

Jaya Shankar
Jaya Shankar 2020년 3월 15일
편집: Jaya Shankar 2020년 3월 15일
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
Susama Bagchi
Susama Bagchi 2020년 3월 15일
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

댓글을 달려면 로그인하십시오.


Sourabh Kondapaka
Sourabh Kondapaka 2020년 3월 20일
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.
  댓글 수: 4
Ritesh Panday
Ritesh Panday 2021년 3월 31일
Hi Sourabh, i've followed the steps on Nvidia's webpage, but the environment variable for cuDNN doesn't seem to autoset. I even tried adding it myself, but Matlab is not detecting it. As well, i'm getting the following error:
Error using coder.checkGpuInstall (line 33)
One or more of the system checks did not pass, with the following errors ...
cuDNN Environment: (Unable to find cuDNN header files in directory 'C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\cuda\include'. Check that the cuDNN headers are installed with the specified cuDNN SDK.)
Error in PedestrianDetectionExample (line 31)
coder.checkGpuInstall(envCfg);
I've tried all sorts of troubleshooting available in matlab forums, but they're not helping. This is really urgent, so i'd appreciate any help. Thank you!
Susama Bagchi
Susama Bagchi 2021년 4월 2일
Hi Ritesh,
It is better to contact the MATLAB support services. They are helpful and can resolve your issue.

댓글을 달려면 로그인하십시오.


Stefano Marrone
Stefano Marrone 2020년 7월 18일
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?
  댓글 수: 4
Ali Al-Saegh
Ali Al-Saegh 2021년 1월 12일
Hello,
Please anyone solved this problem, please help me.
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)

댓글을 달려면 로그인하십시오.


Sehairi K.
Sehairi K. 2021년 9월 5일
Hello
try this
% specify the CUDA install directory, you must have already copied cudnn files there
setenv('NVIDIA_CUDNN','C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3')
% specify the TensorRT path
setenv('NVIDIA_TENSORRT','C:\Program Files\NVIDIA GPU Computing Toolkit\TensorRT-8.0.3.4.Windows10.x86_64.cuda-11.3.cudnn8.2\TensorRT-8.0.3.4')
coder.checkGpuInstall('full')
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 1
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 1
profiling: 1

muhammad ahmad
muhammad ahmad 2021년 11월 17일
how did you resolve deepcodegen and deepcodeexec . do i need to install opencv for it
if so how can i do this
  댓글 수: 1
Hariprasad Ravishankar
Hariprasad Ravishankar 2021년 12월 3일
Hi Muhammad,
You do not need to install OpenCV. You can resolve deepcodegen and deepcodeexec by downloading NVIDIA CuDNN and NVIDIA TensorRT libraries and setting the environment variables 'NVIDIA_CUDNN' and 'NVIDIA_TENSORRT' to point to the install folder.
Here is the documentation page of the config settings to test deepcodegen and deepcodeexec using coder.checkGpuInstall, for reference

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with GPU Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by