2018-05-18 CUDA 9.2 is the latest CUDA 9.1 works with VS 15.0 and 15.4 CUDA 9.2 works with VS 15.0 and 15.6 Latest VS is 15.7. Installed VS 15.4.5 a few days ago, from https://docs.microsoft.com/en-us/visualstudio/productinfo/installing-an-earlier-release-of-vs2017 (It was hard to find this.) I was able to compile a simple portable C program. VS 15.4.5 is the last one supposed to be compatible with 9.1. 9.2 released in the meanwhile. I have GTX1070 Downloaded latest "390" drivers. 397.64. Downloaded and install CUDA 9.1.85. It failed, mostly it said Not installed, plus: ------------------------------------------------------------------------------------------------------ Visual Studio Integration 9.1 Failed NVIDIA GeForce Experience 3.10.0.95 A newer or same version is present PhyX System Software 9.17.0524 A newer or same version is present ------------------------------------------------------------------------------------------------------ I tried installing more bits of VS. Didn't help. Tried skipping the VS integration. CUDA installed. After install with skipping VS integration, tried to load samples. Get 180 errors like ------------------------------------------------------------------------------------------------------ C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1\0_Simple\asyncAPI\asyncAPI_vs2017.vcxproj : error : Unable to read the project file "asyncAPI_vs2017.vcxproj". C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1\0_Simple\asyncAPI\asyncAPI_vs2017.vcxproj(37,5): The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 9.1.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. ------------------------------------------------------------------------------------------------------ From Videodr0me on discord: ------------------------------------------------------------------------------------------------------ got it to build - nightmare though.... after the windows "creators" update (more 0 productiviy update), both cuda 9.1 installs for VS 2017 and cuda 9.0 installs for VS2015 fail. They fail at the visual studio integration. The only thing that worked for me was manually extracting the files in the CUDA9.0 installer (you can unzip it fine) manually copying the MSBuildextensions to C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\BuildCustomizations...... there are other ways with complete wiping everything related to nvidia and rolling back to an earlier driver, but others repored mixed success with those ------------------------------------------------------------------------------------------------------ Manually copied CUDA 9.1.props and 3 others from from MSBuildExtensions in the CUDA install exe to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\. (They've shuffled things since CUDA 9.0.) Tried to load samples. Takes a lot longer than before, seems promising but get ------------------------------------------------------------------------------------------------------ C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1\0_Simple\asyncAPI\asyncAPI_vs2017.vcxproj : error : An equivalent project (a project with the same global properties and tools version) is already present in the project collection, with the path "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1\0_Simple\asyncAPI\asyncAPI_vs2017.vcxproj.filters". To load an equivalent into this project collection, unload this project first. ------------------------------------------------------------------------------------------------------ Don't know how to unload it. Right-clicking a project and reloading apparently loaded it OK. 180 to do... Won't build though. ------------------------------------------------------------------------------------------------------ 1>------ Build started: Project: asyncAPI, Configuration: Debug x64 ------ 1>Compiling CUDA source file asyncAPI.cu... 1> 1>C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1\0_Simple\asyncAPI>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_37,code=\"sm_37,compute_37\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" --use-local-env --cl-version 2017 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64" -x cu -I./ -I../../common/inc -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\/include" -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MTd " -o x64/Debug/asyncAPI.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1\0_Simple\asyncAPI\asyncAPI.cu" 1>asyncAPI.cu 1>LINK : fatal error LNK1104: cannot open file 'gdi32.lib' 1>Done building project "asyncAPI_vs2017.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ------------------------------------------------------------------------------------------------------ From a forum in Apr 2017, not sure its relevant. ------------------------------------------------------------------------------------------------------ Every time I try to run my code I get this ERROR I've tried everything, installing the SDK .. but still the same ERROR. 1>------ Build started: Project: ConsoleApplication6, Configuration: Debug Win32 ------ 1>LINK : fatal error LNK1104: cannot open file 'gdi32.lib' ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I'm using Windows 7 and VS2012. ------------------------------------------------------------------------------------------------------ reply: ------------------------------------------------------------------------------------------------------ If anyone has this problem on Visual Studio 2017, it is an issue with the Windows 10 Creators Update. A workaround is to select the "Windows 10 SDK (10.0.15063.0) for Desktop C++ x86 and x64" under the "Desktop development with C++" workload in the Visual Studio Installer. ------------------------------------------------------------------------------------------------------ (Later: a similar problem, for windows.h not gdi32.lib, and with different numbers, occurs) Gave up on 15.4.5 and 9.1. Uninstalled CUDA. Uninstalled VS 15.4.5. Installed VS 15.7.1. Chose Workloads: Desktop development with C++, Linux. Can't compile simple portable C program. #include causes an error, can't open source file. From Stackoverflow: ------------------------------------------------------------------------------------------------------ Fix: change "Properties->General->Windows SDK Version" to 10 ------------------------------------------------------------------------------------------------------ It was 8.1. Why was it 8.1? This is a brand new project in VS 15.7. And why wouldn't 8.1 SDK contain stdio.h? Changed to 10 and can build simple portable C program. Downloaded CUDA 9.2. Stuck at 41%. Tried pausing and resuming, but it just pretended to be finished. Got 639M file of 1.5G. Try dload again. Stuck at 33%. Try a third time. Got stuck at 22%. Giving up. Later, dloaded it on 4th attempt. It installed OK, with VS integration. Can load the samples. Try to build simpleZeroCopy. Get an error about incompatibility with VS 15.7.1 from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h, this bit: ------------------------------------------------------------------------------------------------------ #if _MSC_VER < 1600 || _MSC_VER > 1913 #error -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! ------------------------------------------------------------------------------------------------------ Changed that 1913 to 1914. Now get an error about windows.h. ----------------------------------------------------------------------------------------------------- 1>------ Build started: Project: simpleZeroCopy, Configuration: Debug x64 ------ 1>Compiling CUDA source file simpleZeroCopy.cu... 1> 1>C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\0_Simple\simpleZeroCopy>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_37,code=\"sm_37,compute_37\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64" -x cu -I./ -I../../common/inc -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\/include" -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MTd " -o x64/Debug/simpleZeroCopy.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\0_Simple\simpleZeroCopy\simpleZeroCopy.cu" 1>C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\common\inc\helper_timer.h(59): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory 1>simpleZeroCopy.cu 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\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\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_37,code=\"sm_37,compute_37\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64" -x cu -I./ -I../../common/inc -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\/include" -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MTd " -o x64/Debug/simpleZeroCopy.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\0_Simple\simpleZeroCopy\simpleZeroCopy.cu"" exited with code 2. 1>Done building project "simpleZeroCopy_vs2017.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ----------------------------------------------------------------------------------------------------- Used VS installer to install Windows SDK 10.0.16299.0, which is under Desktop development with C++. Apparently you can do Desktop development with C++ without windows.h?? Hmm. Still fails to find windows.h. Right click simpleZeroCopy, choose Retarget projects, select Windows SDK 10.0.16299.0. It was set as 10.0.17..., a later one, which is not installed?? (Later: figured out how to retarget all projects in solution.) Succeeded building simpleZeroCopy: ----------------------------------------------------------------------------------------------------- 1>------ Build started: Project: simpleZeroCopy, Configuration: Debug x64 ------ 1>Compiling CUDA source file simpleZeroCopy.cu... 1> 1>C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\0_Simple\simpleZeroCopy>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" -gencode=arch=compute_37,code=\"sm_37,compute_37\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64" -x cu -I./ -I../../common/inc -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\/include" -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MTd " -o x64/Debug/simpleZeroCopy.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\0_Simple\simpleZeroCopy\simpleZeroCopy.cu" 1>simpleZeroCopy.cu 1> Creating library ../../bin/win64/Debug/simpleZeroCopy.lib and object ../../bin/win64/Debug/simpleZeroCopy.exp 1>simpleZeroCopy_vs2017.vcxproj -> C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\0_Simple\simpleZeroCopy\../../bin/win64/Debug/simpleZeroCopy.exe ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ------------------------------------------------------------------------------------------------------ When I ran it under debugger, it says Project is out of date, would you like to build it? asyncAPI - Debug x64. Saying yes runs something in terminal too fast to see. Running it again and it still thinks something is out of date. I found asyncAPI.exe in C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\bin\win64\Debug and when I ran this from a BAT file like this: ------------------------------------------------------------------------------------------------------ asyncAPI.exe PAUSE ------------------------------------------------------------------------------------------------------ it appears to work: ------------------------------------------------------------------------------------------------------ C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\bin\win64\Debug>asyncAPI.exe [asyncAPI.exe] - Starting... GPU Device 0: "GeForce GTX 1070" with compute capability 6.1 CUDA device [GeForce GTX 1070] time spent executing by the GPU: 12.24 time spent by CPU in CUDA calls: 0.04 CPU executed 1536 iterations while waiting for GPU to finish C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\bin\win64\Debug>PAUSE Press any key to continue . . . ------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------ Alexander Lyashuk on lczero group. https://groups.google.com/d/msg/lczero/o_LDQ5AIfNg/WaM4dlC6BQAJ With new meson build system, it should be easier. I'll plan to simplify process a bit more, but for now the process is following: 1. Install CUDA and Cudnn (I used 9.0 but any should work. No integration with MSVS needed) 2. Install MSVS (I used 2015 but 2017 should also work) 3. Install python3 4. Install meson: "pip3 install --upgrade meson" 5. Edit lc0/build-cuda.cmd (change paths to your cuda and cudnn files, and update visual studio path and version if it's not 2015 or installed in different location) 6. Run build-cuda.cmd It will generate msvs project, then pause (hit enter), then build. 7. It should have lc0 built. ------------------------------------------------------------------------------------------------------