GPU coder :basic Code Generation failed

31 ビュー (過去 30 日間)
zhou caiwei
zhou caiwei 2022 年 9 月 29 日
コメント済み: Walter Roberson 2022 年 10 月 24 日
Visual studio 2019
MATLAB 2022A
CUDA 11.6,When I test
coder.checkGpuInstall:
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.)
Basic Code Generation : FAILED (GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
ans =
包含以下字段的 struct:
gpu: 1
cuda: 1
cudnn: 0
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 0
If I type in following codes in the commander line
gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.GpuId = 0;
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
results = coder.checkGpuInstall(gpuEnvObj)
the results is
Compatible GPU : FAILED (Invalid CUDA device id: 1. Select a device id from the range 0:0.)
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
Basic Code Generation : FAILED (GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
results =
包含以下字段的 struct:
gpu: 1
cuda: 1
cudnn: 0
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 0
>>mex -setup
MEX 配置为使用 'Microsoft Visual C++ 2019 (C)' 以进行 C 语言编译。
要选择不同的 C 编译器,请从以下选项中选择一种命令:
Microsoft Visual C++ 2019 (C) mex -setup:C:\Users\sunla\AppData\Roaming\MathWorks\MATLAB\R2022a\mex_C_win64.xml C
Microsoft Visual C++ 2022 (C) mex -setup:D:\MATLAB2022a\bin\win64\mexopts\msvc2022.xml C
要选择不同的语言,请从以下选项中选择一种命令:
mex -setup C++
mex -setup FORTRAN
I looked throught the answers about 'emlc:compilationError' and "Invalid CUDA device", but no answer could figures out my problem.
what wrong with my gpu coder?
  2 件のコメント
Chao Luo
Chao Luo 2022 年 10 月 10 日
Hi Caiwei,
Could you also show us the error message in the report by clicking "View report"?
Thanks,
Chao
Hariprasad Ravishankar
Hariprasad Ravishankar 2022 年 10 月 10 日
Hi Caiwei,
From the error message (Invalid CUDA device id: 1. Select a device id from the range 0:0.) it seems that the GpuId might have been 1?
Can you try running
>> gpuDeviceCount
and
>> gpuDeviceTable
to see if MATLAB is able to identify your gpu?

サインインしてコメントする。

回答 (2 件)

Walter Roberson
Walter Roberson 2022 年 9 月 29 日
I think Cuda Toolkit 11.6 is not supported in your release. I am having difficulty finding the toolkit version that is supported: 11.0 for the release before yours.
You might have to enable forward compatibility https://www.mathworks.com/help/parallel-computing/parallel.gpu.enablecudaforwardcompatibility.html#mw_f28510a0-2087-45eb-84d4-80a0b1248e37
  9 件のコメント
zhou caiwei
zhou caiwei 2022 年 9 月 30 日
MATLAB2022a is proved to be qualified
Walter Roberson
Walter Roberson 2022 年 10 月 24 日
See also https://www.mathworks.com/matlabcentral/answers/1825838-gpu-support-for-rtx-4090#comment_2430013 which indicates that R2021a is enough to generally use the RTX 3090, but that using GPU Coder could have problems, with a work-around suggestion there.

サインインしてコメントする。


zhou caiwei
zhou caiwei 2022 年 9 月 30 日
However, I'm not sure if other error would happens

カテゴリ

Help Center および File ExchangeGet Started with GPU Coder についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by