mexcuda not finding CUDA 10.0 even after I specify it via setenv('MW_NVCC_PATH',...)
11 次查看(过去 30 天)
显示 更早的评论
I have set the path of MW_NVCC_PATH to setenv('MW_NVCC_PATH','C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin')
If I do a verbose mexcuda
Trying MEX options 'C:\Program Files\MATLAB\R2018b\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2017.xml'...FAILED
Trying MEX options 'C:\Program Files\MATLAB\R2018b\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2015.xml'...FAILED
Trying MEX options 'C:\Program Files\MATLAB\R2018b\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013.xml'...FAILED
Trying MEX options 'C:\Program Files\MATLAB\R2018b\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2012.xml'...FAILED
Warning: No supported host compiler found, or other problem with the environment.
Continuing with selected compiler to provide detailed diagnosis.
> In mexcuda (line 130)
mex -largeArrayDims -f C:\Program Files\MATLAB\R2018b\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2017.xml NVCC_FLAGS="" -v mexGPUExample.cu
Verbose mode is on.
... Looking for compiler 'NVIDIA CUDA Compiler' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 15.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\').
... Executing command 'set "vcroot=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"&for /f "delims= " %a in ('type "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"') do @if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\%a\bin\HostX64\x64\cl.exe" call echo %vcroot%' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\10\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 15.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 15.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\').
... Executing command 'set "vcroot=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"&for /f "delims= " %a in ('type "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"') do @if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\%a\bin\HostX64\x64\cl.exe" call echo %vcroot%\VC\Tools\MSVC\%a' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 15.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' KitsRoot10 ...Yes ('C:\Program Files (x86)\Windows Kits\10\').
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' KitsRoot10 ...Yes ('C:\Program Files (x86)\Windows Kits\10\').
... Executing command 'echo off&set "sdkversion="&(for /f %a IN ('dir "C:\Program Files (x86)\Windows Kits\10\include\" /b /ad-h /on') do ( @if exist "C:\Program Files (x86)\Windows Kits\10\include\%a\ucrt\" set "sdkversion=%a" ))&call echo %sdkversion%' ...Yes ('10.0.17763.0').
... Looking for environment variable 'MW_NVCC_PATH' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin').
... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64\cudart.lib' ...Yes.
... Looking for folder 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64' ...Yes.
... Looking for environment variable 'MW_NVCC_PATH' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin').
... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc.exe' ...Yes.
... Executing command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc --version | findstr /c:"release 9.1" > NUL && echo C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin' ...No.
... Looking for environment variable 'MW_NVCC_PATH' ...Yes ('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin').
... Looking for file 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc.exe' ...Yes.
... Executing command '"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc" --version | findstr /c:"release 9.1" > NUL && echo C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin' ...No.
Did not find installed compiler 'NVIDIA CUDA Compiler'.
Warning: Version 9.1 of the CUDA toolkit could not be found. If installed, set MW_NVCC_PATH environment variable
to location of nvcc compiler.
> In mexcuda (line 157)
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.
Error in mexcuda (line 157)
[varargout{1:nargout}] = mex(mexArguments{:});
0 个评论
回答(1 个)
Joss Knight
2018-12-30
As it says there in the error message, you need CUDA 9.1, not 10.
5 个评论
Joss Knight
2020-3-31
copyfile(fullfile(matlabroot,"toolbox","parallel","gpu","extern","src","mex","win64","nvcc_*.xml"),".")
Find the options file nvcc_*.xml of interest to you. Its name includes your Visual Studio version (e.g. "msvcpp2017") and the suffix "_dynamic" if you are compiling with dynamic parallelism.
Edit this file and change all references to 9.1 to 10.0 (or equivalent).
Force mexcuda to use this options file using the -f option.
另请参阅
类别
在 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!