Cuda 9.2 and VS community

I was working so far with a trial version of VS pro and it was all good.
The trial is now done and I tried to move to VS community. This did not moved smoothly.
The same project that once worked stopped working…

long story short, after some struggle I get this error:
nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

I saw a few posts on this error over the internet however all of them talked about cmake and not VS.
any tip of how can i solve this?

PS: not sure if it helps, but I’m able to run the sdk examples projects : AppDec and AppDecD3D, and AppDecGL (on which my private project is based on).

your nvcc compile command line is messed up.

if you’re able to compile AppDecGL, but not your project, then some change you made to the project settings is causing this.

You should be able to capture the command line that generates this error from the VS output console.

Thanks for the replay. I was thinking the same, but I revert my code to the place it was just before I switched between pro and community and in which I know it used to work at that point. I even tried comparing both my project line and AppDecGL line in which is being compile and could find no real difference.

the line that fails as far as i can see is:
(Project_LOCATION)\TestApp\TestApp>"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 -Xcompiler /wd4819 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64" -x cu -I(Project_LOCATION)\PC\Internal\include -I$(Project_LOCATION)\PC\Internal\common -I$(Project_LOCATION)\PC\External -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -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 -DFREEGLUT_STATIC -DGLEW_STATIC -D_DEBUG -D_CONSOLE -D_LIB -D_CRT_SECURE_NO_WARNINGS -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fd”(Project_LOCATION)\TestApp\x64.Debug\TestApp\vc141.pdb" /FS /Zi /RTC1 /MDd " -o "(Project_LOCATION)\TestApp\x64.Debug\TestApp\" “$(Project_LOCATION)\External\nvidia\Utils\”

*$(Project_LOCATION) : is just me editing the line to be a bit more readable.

It is probably something really trivial that i miss, but I’m really new to cuda and it doesn’t make much sense to me.

I see at least 2 problems in the command line, but it’s not possible to identify exactly which project settings are causing them. This is sort of the difficulty with a tool like Visual Studio which includes a substantial obfuscation layer between the programmer and the compile command line generation.

  • if your Project_LOCATION contains any spaces in it, that will create problems without surrounding quotes on the overall switches that use those

  • this looks problematic to me:

-Xcompiler “/EHsc /W3 /nologo /Od /Fd”$(Project_LOCATION)\TestApp\x64.Debug\TestApp\vc141.pdb" /FS /Zi /RTC1 /MDd "

Your guess was indeed right…

My Project_location indeed had space in it, seems like after the reinstall of VS I used the wrong shortcut that had a space in it :\ now that i use the path without the space it seems to work fine.

Thanks a lot for the fast help.