Unable to compile cuda file with MATLAB 2017a, VS2017 and cuda 9
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm trying to compile one .cu file with MATLAB 2017a, cuda version 9 and Visual studio 2017. It is showing
>>mexcuda -v moveVariableToCUDA.cu
Warning: The selected C++ compiler is not supported for CUDA compilation. Searching for a supported compiler.
> In mexcuda (line 89)
Trying MEX options 'C:\Program Files\MATLAB\R2017a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2015.xml'...FAILED
Trying MEX options 'C:\Program Files\MATLAB\R2017a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2013.xml'...FAILED
Trying MEX options 'C:\Program Files\MATLAB\R2017a\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\R2017a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2015.xml NVCC_FLAGS="" -v moveVariableToCUDA.cu
Verbose mode is on.
... Looking for compiler 'NVIDIA CUDA Compiler' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\').
... Looking for environment variable 'VS140COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe' ...No.
*Did not find installed compiler 'NVIDIA CUDA Compiler'*.
Error using mex
No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2017a/.
Error in mexcuda (line 157)
[varargout{1:nargout}] = mex(mexArguments{:});
3 Kommentare
Walter Roberson
am 18 Jan. 2018
Could you check under C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7 to see if there is a devenv.exe somewhere there? It appears to be a key front-end for compiling for VS.
Antworten (1)
Andreas Hösl
am 1 Feb. 2018
Hmmm it might not be connected but I had the problem that Matlab insists on a specific CUDA toolkit. 2017b, as far as I know, starts to support CUDA 8, 2017a doesn´t. Anyway, in my case adapting the config file nvcc_msvcpp (in the log it looks for it under "C:\Program Files\MATLAB\R2017a\toolbox\distcomp\gpu\extern\src\mex\win64\nvcc_msvcpp2015.xml'...FAILED") worked: copy it to a local folder, and look which compiler and CUDA version it requires. Replace by what you have and hope for the best. Compile with -f nvcc_msvcpp201x_custom.xml.
0 Kommentare
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!