GPU coder check fail for deep learning cuDNN code generation and execution

I run gpu checks on r2024a/b over Nvidia RTX4080 Laptop with all combinations of VS2017/2019/2022 + Cuda11.8-12.2/cuDNN8.7-9.2/TensorRT8.5.1.7-8.6.1.6, and always got the deepcodegen & deepcodeexec fails as below :
>>gpuEnvObj = coder.gpuEnvConfig('host');
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'cudnn';
gpuEnvObj.DeepCodegen = 1;
gpuEnvObj.DeepCodeexec = 1;
results = coder.checkGpuInstall(gpuEnvObj)
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
Host Compiler : PASSED
Basic Code Generation : PASSED
Basic Code Execution : PASSED
Deep Learning (cuDNN) Code Generation: FAILED (GPU code generation failed with an error. View report for further information: View report)
results =
struct with fields:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 0
hostcompiler: 1
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 0
tensorrtdatatype: 0
deepcodeexec: 0
The Error Report always shows as below :

Answers (1)

Hello,
I suspect that that the "GPU Coder Interface for Deep Learning Libraries" support package is not installed in your support package root.
Can you please inspect your support package root by executing:
installDir = matlabshared.supportpkg.getSupportPackageRoot
Can we try updating your support package root using the command
matlabshared.supportpkg.setSupportPackageRoot(installDir)
You can then try to reinstall the support package and rerun the coder.checkGpuInstall command.

8 Comments

Thank you for the quick response. The "GPU Coder Interface for Deep Learning Libraries" had already installed & re-installed in "C:\ProgramData\Matlab\SupportPackages\R2024b", "C:\ProgramData\Matlab\SupportPackages\R2024b\toolbox\shared\dlcoder_base\supportpackages\gpucoder_dl_targets\+dltargets\+cudnn\ , ...\+tensorrt\, and the related subdirectories for couple times last month and last week, and NO help !
As the error GPU Coder Report Viewer, 23 error messages show "Calling code generation implementation function 'coder.internal.xxx' from user function 'coder.internal.DeepLearningNetwork .yyy' is not supported."
I have also tested cuDNN samples on the Lambda stack in WSL2 and Windows Anaconda respectively, and they all compile and execute successfully.
My system is Intel i9 13980HS + NVidia RTX 4080 Laptop + Windows 11 23H2.
Any suggestion to solve out ?
I couldn't reproduce this in R2024b.
Can you please reply with the output of
>> which coder.internal.DeepLearningNetwork
Thank you for the response.
>> which coder.internal.DeepLearningNetwork
C:\ProgramData\Matlab\SupportPackages\R2024b\toolbox\shared\dlcoder_base\supportpackages\shared_dl_targets\+coder\+internal\@DeepLearningNetwork\DeepLearningNetwork.p % coder.internal.DeepLearningNetwork constructor
Apparently, It is corresponding to the first error message in the GPU Coder Report Viewer : "Calling code generation implementation function 'coder.internal.addDependentFile' from user function 'coder.internal.DeepLearningNetwork (constructor)' is not supported. Please contact Technical Support for assistance."
I have updated to the Windows 11 24H2, but the deeplearning code generation (cuDNN/TensorRT) errors still exist !
Thanks for your response. I don't see any issue with your setup.
I noticed that your mldatx is located inside C:\ProgramData\Matlab\SupportPackages\R2024b, so I assume you're attempting to generate code from that directory. Can you please try generating code from another directory?
Otherwise, I would recommend reaching our to Technical Support to assist you better.
Your query : "I assume you're attempting to generate code from that directory."
> No.
I just run checkGpuInstall (or using coder.checkGpuInstall('full') and gpucoderSetup) in Matlab Command Window, then always got the result below, i.e. deepcodegen & deepcodeexec failed for cuDNN and TensorRT, and its corresponding GPU Coder Report Viewer as shown in the last submitted comment :
>> gpuEnvObj = coder.gpuEnvConfig('host');
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'cudnn'; % or 'tensorrt'
gpuEnvObj.DeepCodegen = 1;
gpuEnvObj.DeepCodeexec = 1;
results = coder.checkGpuInstall(gpuEnvObj)
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
Host Compiler : PASSED
Basic Code Generation : PASSED
Basic Code Execution : PASSED
Deep Learning (cuDNN) Code Generation: FAILED (GPU code generation failed with an error. View report for further information: View report)
results =
struct with fields:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 0
hostcompiler: 1
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 0
tensorrtdatatype: 0
deepcodeexec: 0
To be sure, do you see the same error when running gpu codegen outside of coder.checkGpuInstall?
For example
function out = foo()
net = imagePretrainedNetwork('squeezenet');
out = predict(net, dlarray(ones(227,227,3,'single'), 'SSC'));
end
codegen -config coder.gpuConfig foo
Thank you for your patient listening.
The same fail result (with almost the same error content in the GPU Coder Report Viewer) as below :
>> codegen -config coder.gpuConfig foo
Calling code generation implementation function 'coder.internal.prefer_const' from user function 'coder.internal.dlnetwork
(constructor)' is not supported. Please contact Technical Support for assistance.
Code generation failed: View Error Report
That's unfortunate. We need to take a closer look at your setup. I definitely recommend creating a ticket with Technical Support.

Sign in to comment.

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Asked:

on 4 Dec 2024

Community Treasure Hunt

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

Start Hunting!