0
votes

I have Visual Studio 2015 and latest CUDA version 8.0.60.

When I create a CUDA template in VS, in default example when calling a device function getting error about "<<< >>>" and say's "expected an expression" and another error is MSB3721 that say's:

Severity Code Description Project File Line Suppression State Error MSB3721 The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_21,compute_20\" --use-local-env --cl-version 2015 -ccbin "D:\Program Files (x86)\Microsoft Visual Studio 14.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\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 "D:\c++ project\xhfy\xhfy\kernel.cu"" exited with code 1. xhfy C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets 689

What can I do to fix this error?

Thanks.

2
The MSB3721 error is a generic error. It means a previous nvcc compile command failed but does not tell you why. To discover why, you'll need to look previous to that point for an actual nvcc error report, or else increase your VS verbosity and recompile until you see the nvcc actual error output before the MSB3721 error. Regarding the "<<< >>>" error, that is probably just intelligence. Google "CUDA red underline"Robert Crovella
i did what you said and here the result: nvcc fatal : Compiler 'cl.exe' in PATH different than the one specified with -ccbinhassan sadeghein
The PATH environment variable has to match your VS install. If you have both 2013 and 2015 installed, then there are some changes that are necessary. In this case it would seem that your PATH was set up for 2013 but you were working with VS 2015 without updating your PATH accordingly. As you state in your answer, by switching to the VS 2013 toolset, a different cl.exe is specified for the ccbin option to nvcc, and this apparently matched your PATH variable.Robert Crovella

2 Answers

3
votes

I changed my platform toolset to Visual Studio 2013 and it worked perfectly.

0
votes

I modified cmakelists.txt, and it worked.

I got GTX1016, so I changed arch=compute_75,code=sm_75 into arch=compute_61,code=sm_61.