Platform: VS2013+CUDA 8.0
Executing “Compile” will pass, but “Executing “Recompile” or “Clean” will report an error.
nvcc fatal : Could not set up the environment for Microsoft Visual Studio using ‘C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/…/…/…/VC/bin/amd64/vcvars64.bat’
error MSB3721: 命令““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe” -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include” -I”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include” –keep-dir x64\Release -maxrregcount=0 –machine 64 –compile -DWIN32 -DNDEBUG -D_CONSOLE -D_LIB -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /O2 /FS /Zi /MD ” -clean”已退出,返回代码为 1。
Guess the reason may be the computer installed at the same time vs2017, vs2019, cuda 10.1 multiple versions caused by the previous only vs2013 and cuda 8.0 when there is no problem
Solution.
Find vcvars64.bat under C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64 and modify this sentence inside.
@if not “%WindowsSDK_ExecutablePath_x64%” == “” (
@set “PATH=%WindowsSDK_ExecutablePath_x64%;%PATH%”
)
to
@if not “%WindowsSDK_ExecutablePath_x64%” == “” (
@set “PATH=!WindowsSDK_ExecutablePath_x64!;!PATH!”
)
Read More:
- Error 1 error MSB3721: Command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe” -genco
- How to Solve error: command ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe‘ failed
- Error (active) e1696 cannot open source file “errno.H” rpgworld problems encountered in installing visual studio 2017
- How to Solve UE5 Compile Error: Error MSB3073
- QT Error: ‘C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe‘ failed
- [Solved] CMake Error: Could not create named generator Visual Studio 16 2019
- [Solved] Unity Error: Visual Studio Editor Package version 2.0.11 is available……..
- [Solved] Visual studio 2022 error LNK2019: unable to resolve external symbol for
- [Solved] CUDA error:-UserWarning: CUDA initialization: CUDA unknown error
- Solution for Visual Studio 2012 compilation error [error C4996:’scanf’: This function or variable may be unsafe.]
- [Solved] CMake Error: Could not create named generator Visual Studio 16 2019 -A Win64
- [Solved] QT Compile Error: nmake: fatal error u1077
- .NETproject compilation error. Type or namespace name could not be found. Visual studio automatically introduces dependency package (shortcut key)
- Visual Studio Code Error command ‘markdown.extension.onBackspaceKey’ not found
- visual studio Error D8016 ‘/ZI’ and ‘/Gy-‘ command-line options are incompatible
- Visual Studio SignTool Error: No certificates were found that met all the given criteria.
- How to Solve Microsoft.CppCommon.targets(279,5): error MSB3073
- Visual Studio 2012 error C4996: ‘scanf’: This function or variable may be unsafe.
- Cuda Runtime error (38) : no CUDA-capable device is detected
- [Solved] Android Studio Error: AAPT: error: file failed to compile