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

18 ビュー (過去 30 日間)
Marin Genov
Marin Genov 2021 年 8 月 30 日
コメント済み: Justin Hontz 2023 年 7 月 27 日
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 件のコメント
Justin Hontz
Justin Hontz 2023 年 7 月 27 日
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.

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

回答 (1 件)

fan
fan 2023 年 7 月 27 日
編集済み: fan 2023 年 7 月 27 日
我之前也遇到过这个问题,我的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,我并不认为是这个问题

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by