Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

visual studio 2010 - CUDA 4.2. toolbox & VS2010

I am trying to compile Cuda SDK examples but I am getting "MSB3721 error" since "nvcc" is "exited with code 1". Complete output:

"C:Program Files (x86)MSBuildMicrosoft.Cppv4.0BuildCustomizationsCUDA 4.2.targets(361,9): error MSB3721: The command ""C:Program FilesNVIDIA GPU Computing ToolkitCUDAv4.2in vcc.exe" -gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" -gencode=arch=compute_30,code="sm_30,compute_30" --use-local-env --cl-version 2010 -ccbin "C:Program Files (x86)Microsoft Visual Studio 10.0VCinx86_amd64" -I"./" -I"../../common/inc" -I"../../../shared/inc" -I"C:Program FilesNVIDIA GPU Computing ToolkitCUDAv4.2include" -G --keep-dir "x64Debug" -maxrregcount=0 --machine 64 --compile -g -Xcompiler "/EHsc /nologo /Od /Zi /MTd " -o "x64/Debug/bandwidthTest.cu.obj" "C:ProgramDataNVIDIA CorporationNVIDIA GPU Computing SDK 4.2CsrcandwidthTestandwidthTest.cu"" exited with code 1."

Cuda toolkit 4.2 is used on Win7 x64 Ultimate system with VS2010 Ultimate. The error remains when the "win32" option in "Configuration management" is used.

Are there any suggestions?

!!!!! Finally after reading all available NVIDIA manuals about "Getting started with CUDA" after reinstalling Win7+VS2010+CUDA drivers more than 10 times after building a new computer (Z77 mobo + i7 + GTX550Ti) and after waiting for months the NVIDIA forum resurrection I found out that the problem with the nvcc build error "exited with code 1" was disappeared when the "Run as administrator" option was selected on the VS2010 shortcut on my desktop!!!!!! Although I was using an administrator account (the only account on the PC) it was impossible to build any of the CUDA Examples. The executables were running without any problem but I couldn't build the source code using VS2010!

!!!!!Thank you all for your support!!!!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I would try to start from scratch. Remove CUDA, Nsight, and Visual Studio. Reboot. Manually remove any program folders that might be left. I can't guarantee that it's safe to remove these, but if any other NVIDIA or Microsoft products break because of this, I'd just fix those after having fixed CUDA:

C:Program Files (x86)Microsoft Visual Studio 10.0
C:Program Files (x86)Microsoft Visual Studio 9.0
C:Program Files (x86)NVIDIA Parallel Nsight 2.1
C:Program Files (x86)NVIDIA Parallel Nsight Monitor 2.1
C:Program FilesMicrosoft Visual Studio 10.0
C:Program FilesNVIDIA GPU Computing Toolkit

Manually remove any left over app data folders:

C:Users<your user folder>AppDataRoamingNVIDIA
C:Users<your user folder>AppDataRoamingNVIDIA Corporation

You might want to look for registry keys as well.

Then reinstall everything. Nsight comes with CUDA, so I'd first install VS then Nsight. That should be all that is required. Then, create a CUDA project from scratch.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...