Visual Studio 2010 - how to fix Error MSB3721 - exiting with code 1


i just set up Visual Studio and Nsight with CUDA 5. I got it working on my notebook, but not on my PC
When i try to compile my code i get the Error: MSB3721:

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.0.targets(592,9): error MSB3721: Der Befehl ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe” -gencode=arch=compute_10,code=“sm_10,compute_10” --use-local-env --cl-version 2010 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -G --keep-dir “Debug” -maxrregcount=0 --machine 32 --compile -g -D_MBCS -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o “Debug\” “d:\david heinemann\eigene dokumente\visual studio 2010\Projects\testcu\testcu\”” wurde mit Code 1 beendet.

In my Optinion i have set up everything correctly. I have no more idea where this error could come from.

And i just got another error, when trying to run the examples from the CUDA samples browser. It tells me, the cudart64_50_35.dll is missing. But when I search for it on my computer it’s there.

I hope you have a solution for this problem


funnily enough, i started my computer this morning and the error about missing the cudart64_50_35.dll is gone and i can run the examples.

Unfortunately the MSB3721 error in VS2010 remains. :-(

Finaly i got it working again.

After a new setup of the whole system, including a reinstallation of windows, everything works fine.
Then i installed my antivirus and i got the same error MSB3721 with code 1. Removing the antivirus software removes the error too.
I was using the COMODO Internet Secutriy.

So if you also have this Error, try again after removing your antivirus Software. Only disable the antivirus has no effect.

In another thread i read about running VS2010 as administrator. This also has no effect during the problem with the antivirus exists.

Hello –

I could use soem advice on setting up my environment …

I got a 64-bit machine with Windows 7, Nvidia Quadro 6000 gpu, and downloaded the Visual Studio 2012 professional from DreamsPark … but I can’t even get a “hello world” program to compile with nvcc … it says it can’t find cl.exe even though I included the location of cl.exe in PATH …

Been programming off an on with OpenGL … but stereo 3d and gpu computing is new to me …

Any advise would be greatly appreciated.



Hi Ric,

please post your compiler error.
Try to compile,link and start your code in VS using ctrl+F5 (not only f5)


Hi. After removing the antivirus also I am still getting error MSB3721
I think it’s not an issue with removing antivirus.
What should I do to get rid off this error?
I am using visual studio 2013 and cuda 6.5 in windows 8.1 system 64 bit

Hi, guys!

I was experiencing the same issue whenever I tried to run one of the CUDA samples after copying the sample to my own project directory. As far as I could perceive, in my case the error seemed to be related to the project path, because it worked ok after putting the project directory near the root and with no spaces in the path string.

I think you guys should give it a try to complete the diagnostic.

P. S.: I’m using CUDA 6.5 and VC++ Express 2013 in a Windows 8.1 (64 bits) system.

I have same issue in visual studio 2012 and cuda 6.5. Can anyone help me to fix this error



I am also having the same issue. VS 2012, CUDA 7 running on Tesla K20, GTX-660.

The error line (i have also tried sm_20, compute_20):

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 7.0.targets(593,9): error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\bin\nvcc.exe” -gencode=arch=compute_30,code=“sm_30,compute_30” --use-local-env --cl-version 2012 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64” -rdc=true -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\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 /Zi /RTC1 /MDd " -o x64\Debug\ “C:\Users\David Leon\Documents\Visual Studio 2012\Projects\GPUBDDAccelerator\GPUBDDAccelerator\”” exited with code 2.

Sorry for spam. The server returned 3 times the answer bad gateway.