CUDA build Error with VS2019 + CUDA 10.2

Hello,
I am a total nube in regards to CUDA. So possibly I am doing something silly.

I have a win10 setup with vs2019 and CUDA 10.2 installed as per instructions.

I can build windows applications ok. When I build the test CUDA project with no modifications from my side, I get the error : “”

Using “CudaCompile” task from the task factory “XamlTaskFactory”.
1> Task “CudaCompile”
1> cmd.exe /C “C:\Users\AppData\Local\Temp\tmpd5938a11293b42e4a082b1c1fb81bd96.cmd”
1> “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe” -gencode=arch=compute_30,code="sm_30,compute_30" --use-local-env -ccbin “I:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.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 /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj “h:\Users\source\repos\TryCUDA\kernel.cu”
1> The system cannot find the path specified.
1>
1> h:\Users\source\repos\TryCUDA>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe” -gencode=arch=compute_30,code="sm_30,compute_30" --use-local-env -ccbin “I:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.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 /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj “h:\Users\source\repos\TryCUDA\kernel.cu”
1> I:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.2.targets(764,9): error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe” -gencode=arch=compute_30,code="sm_30,compute_30" --use-local-env -ccbin “I:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.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 /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj “h:\Users\source\repos\TryCUDA\kernel.cu”” exited with code 1.
1> Done executing task “CudaCompile” – FAILED.
1> Done building target “CudaBuildCore” in project “TryCUDA.vcxproj” – FAILED.

“”

Now I have been looking for which part of the command did the path check fail on…

So I decided to run it in command prompt. Here is what I got.

“”

C:>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe” -gencode=arch=compute_30,code="sm_30,compute_30" --use-local-env -ccbin “I:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.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 /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MDd " -o x64\Debug\kernel.cu.obj “h:\Users\source\repos\TryCUDA\kernel.cu”

C:>

“”

i.e. No errors and no complaints about path not found.

How can I debug this further?

I’ve verified that the path variables are all correct and align with the command.

Please any help will be greatly appreciated.

Thanks,
Abe.

hi Abe,

may I just ask you have you already fixed this or not, cuz I’m facing the same problem

No I haven’t. I forgot about this issue.
-Abe