▶ After upgrading to Visual Studio 2017 and CUDA 9.1, the following error occurred when compiling the previous CUDA C program directly:
1 Severity Code Description Project File Line Suppression Status 2 Error (active) E0029 Expression cudaProject d:\Code\CUDA\cudaProject\cudaProject\kernel.cu should be entered 116 3 Error (active) E0029 Expression cudaProject d should be entered: \Code\CUDA\cudaProject\cudaProject\kernel.cu 118 4 Error MSB3721 Command " " D:\Program\CUDA9.1\bin\nvcc.exe " -gencode=arch=compute_30,code=\ " sm_30,compute_30\" --use-local-env --cl-version 2017 -ccbin " D:\Program\VisualStudio2017\VC\Tools\MSVC\ 14.13.26128 \ bin\ HostX86 \x64 " -x cu -ID:\Program\CUDA9.1\include -ID:\Program\CUDA9.1\include -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj "D:\Code\CUDA\cudaProject\cudaProject\kernel.cu"”已退出,返回代码为 2。 cudaProject D:\Program\VisualStudio2017\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 9.1.targets 707 5 错误 C1189 #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! cudaProject d:\program\cuda9.1\include\crt\host_config.h 135
● After the instruction (http://tieba.baidu.com/p/5476899594), the project version was downgraded from Visual Studio 2017 (v141) to Visual Studio 2015 (v140) and the compilation passed.