Cannot build CUDA 9.2 example project in Visual Studio 2017

The CUDA 9.2 example project is created by menu File → New → Project … and choosing CUDA 9.2 Runtime from the template in Visual Studio 2017. Nothing special is used. But I cannot build it in Visual Studio 2017. The error message is:

1>------ Rebuild All started: Project: testCUDA17, Configuration: Debug x64 ------
1>
1>E:\Temp\testCUDA17\testCUDA17>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -ccbin "C:\Program Files (x86)\Microsoft Visual Studio017\Enterprise\VC\Tools\MSVC4.14.26428\bin\HostX86\x64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include"  -G   --keep-dir x64\Debug -maxrregcount=0  --machine 64 --compile   -g   -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj "E:\Temp\testCUDA17\testCUDA17\kernel.cu" -clean
1>kernel.cu
1>Compiling CUDA source file kernel.cu...
1>
1>E:\Temp\testCUDA17\testCUDA17>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio017\Enterprise\VC\Tools\MSVC4.14.26428\bin\HostX86\x64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\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 "E:\Temp\testCUDA17\testCUDA17\kernel.cu"
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.2\include\crt/host_config.h(133): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!
1>kernel.cu
1>C:\Program Files (x86)\Microsoft Visual Studio017\Enterprise\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 9.2.targets(707,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio017\Enterprise\VC\Tools\MSVC4.14.26428\bin\HostX86\x64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\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 "E:\Temp\testCUDA17\testCUDA17\kernel.cu"" exited with code 2.
1>Done building project "testCUDA17.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

An msinfo file is here: Dropbox - File Deleted

Some of the environment info is below:

  • Windows 10 1803
  • Quadro K600
  • Driver 397.44
  • CUDA 9.2
  • Visual Studio 2017 version 15.7.1

So what part of my system is CUDA unhappy with? K600 is too old?

it seems CUDA cannot keep up with the monthly updates to Visual Studio 2017 that Microsoft are pushing in an agile fashion.

It may be that doing some hacks in host_config.h could fix the incompatibility, but of course that’s entirely unsupported.

BTW I am a little puzzled that there was no official release announcement yet.