GPU Coder Error: CreateProcess failed: The system cannot find the file specified

23 vues (au cours des 30 derniers jours)
Marin Genov
Marin Genov le 30 Août 2021
Commenté : Justin Hontz le 27 Juil 2023
Hi,
I am trying to use the GPU coder to compile a MATLAB function of gpuArrays into a .mex file, but I keep getting the error "CreateProcess failed: The system cannot find the file specified" and I cannot figure out what is the issue (see below for the build log). Here is the setup:
  • MATLAB R2021a Update 5 - academic use;
  • Simulink is not installed;
  • Visual Studio 2017 (Community) as C/C++ compiler;
  • GTX 1060 6GB (Compute capability 6.1);
Here is a full Build Log:
[1/10] nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu_initialize.cu -o build\win64\find_matches_gpu_initialize.obj
FAILED: build/win64/find_matches_gpu_initialize.obj 
nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu_initialize.cu -o build\win64\find_matches_gpu_initialize.obj
CreateProcess failed: The system cannot find the file specified.
[2/10] nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu_data.cu -o build\win64\find_matches_gpu_data.obj
FAILED: build/win64/find_matches_gpu_data.obj 
nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu_data.cu -o build\win64\find_matches_gpu_data.obj
CreateProcess failed: The system cannot find the file specified.
[3/10] nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" rt_nonfinite.cu -o build\win64\rt_nonfinite.obj
FAILED: build/win64/rt_nonfinite.obj 
nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" rt_nonfinite.cu -o build\win64\rt_nonfinite.obj
CreateProcess failed: The system cannot find the file specified.
[4/10] nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu_terminate.cu -o build\win64\find_matches_gpu_terminate.obj
FAILED: build/win64/find_matches_gpu_terminate.obj 
nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu_terminate.cu -o build\win64\find_matches_gpu_terminate.obj
CreateProcess failed: The system cannot find the file specified.
[5/10] nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu.cu -o build\win64\find_matches_gpu.obj
FAILED: build/win64/find_matches_gpu.obj 
nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" find_matches_gpu.cu -o build\win64\find_matches_gpu.obj
CreateProcess failed: The system cannot find the file specified.
[6/10] nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" cpp_mexapi_version.cpp -o build\win64\cpp_mexapi_version.obj
FAILED: build/win64/cpp_mexapi_version.obj 
nvcc -c -rdc=true -Wno-deprecated-gpu-targets -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler "/source-charset:utf-8" -I "." -I "C:\Users\Marin\Desktop\MATLAB" -I ".\interface" -I "C:\Program Files\MATLAB\R2021a\extern\include" -I "." -DMW_CUDA_ARCH=610 -DMODEL=find_matches_gpu_mex -DMW_NEEDS_VERSION_H -arch sm_61 -I "C:\Program Files\MATLAB\R2021a/simulink/include" -I "C:\Program Files\MATLAB\R2021a/toolbox/shared/simtargets" cpp_mexapi_version.cpp -o build\win64\cpp_mexapi_version.obj
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed
  1 commentaire
Justin Hontz
Justin Hontz le 27 Juil 2023
Based on the diagnostic, it is possible that ninja (the build system used for compiling the MEX) is not able to find nvcc. Can you try the following:
  1. cd to the codegen directory. There should be a file in this directory called "SetEnv.bat".
  2. Open a system terminal in this directory.
  3. In the terminal, run SetEnv.bat. This command should add nvcc to the terminal path.
  4. In the terminal, run where nvcc. On success, this should print the path to the nvcc executable that ships with MATLAB.

Connectez-vous pour commenter.

Réponses (1)

fan
fan le 27 Juil 2023
Modifié(e) : fan le 27 Juil 2023
我之前也遇到过这个问题,我的matlab版本为2022b,VS版本有两个,2019和2022,显卡是3090,cuda版本为11.8,直接使用GPU coder产生的报错和你上面的一摸一样,无论怎样matlab都无法检测到2019或者2022的vs编译器,后来我将我的matlab2022b卸载了,装了一个2021a的版本,直接就通过了,我猜想两种原因:最开始我的cuda版本为12.2,它提示不支持12.2的cuda版本,我将cuda版本降低到11.8,就是说找不到C++编译器,cuda版本或许有一定原因;2.vs和matlab的安装顺序,先安装vs再安装matlab或许能解决这个问题,至于2022a和2022b,我并不认为是这个问题

Catégories

En savoir plus sur Get Started with GPU Coder dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by