MatConvNet error on vl_compilenn on GPU
10 次查看(过去 30 天)
显示 更早的评论
I have
- Matlab R2020a on win10_x64 OS
- Visual Studio 2019
- Cuda 11.1, the latest cudnn
- matconvnet-1.0-beta25
I am trying to compile MatConvNet with the following command
vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc', ...
'cudaRoot', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1', ...
'enableCudnn', true, 'cudnnRoot', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1');
And getting an error even after following some suggestions from the users with the same problem. I have tried changing cl_path to the path where cl.exe is located and set -O to -O0 in the vl_compilenn. Now, here is my error
E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(89): error: identifier "cudnnConvolutionFwdPreference_t" is undefined
E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(94): error: identifier "cudnnConvolutionBwdFilterPreference_t" is undefined
E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(99): error: identifier "cudnnConvolutionBwdDataPreference_t" is undefined
E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(141): error: identifier "cudnnConvolutionFwdPreference_t" is undefined
E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(147): error: identifier "cudnnConvolutionBwdFilterPreference_t" is undefined
E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\src\bits\datacu.hpp(153): error: identifier "cudnnConvolutionBwdDataPreference_t" is undefined
6 errors detected in the compilation of "E:/Matlab/R2020a/matconvnet-1.0-beta25/matlab/src/bits/data.cu".
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored.
data.cu
Error using vl_compilenn>nvcc_compile (line 615)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\nvcc" -c -o
"E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\mex\.build\bits\data.obj"
"E:\Matlab\R2020a\matconvnet-1.0-beta25\matlab\src\bits\data.cu" -DENABLE_GPU -DENABLE_DOUBLE
-DENABLE_CUDNN -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include" -O0 -DNDEBUG
-D_FORCE_INLINES --std=c++11 -I"E:\Matlab\R2020a\extern\include"
-I"E:\Matlab\R2020a\toolbox\parallel\gpu\extern\include"
-gencode=arch=compute_50,code=\"sm_50,compute_50\" --compiler-options=/MD
--compiler-bindir="C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64" failed.
Error in vl_compilenn (line 487)
nvcc_compile(opts, srcs{i}, objfile, flags) ;
Please, suggest what can I do to avoid this problem
5 个评论
Eduardo de Jesus Reis
2024-7-11
What exactly would this solution be? I can't understand chinese and I couldn't get the translator to work on that page.
Umar
2024-7-11
Hi Suzy,
You need to ensure that the cuDNN headers and libraries are correctly specified in the compilation command. Here is an updated command that includes the necessary cuDNN flags:
vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc', ... 'cudaRoot', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1', ... 'enableCudnn', true, 'cudnnRoot', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1', ... 'cudaFlags', {'-I"C:\path\to\cudnn\include"', '-L"C:\path\to\cudnn\lib"', '-lcudnn'});
By adding the cudaFlags parameter with the appropriate paths to cuDNN include and library directories, you ensure that the compiler can find the necessary definitions for cuDNN preferences, resolving the undefined identifier errors.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!