unhelpful build error

Hello,

I’ve been trying to get a basic CUDA project going in VS2010 Pro on an x64 machine running Windows 7 Enterprise. I’ve also installed the 64-bit versions of everything on my system (dev drivers, the toolkit, the computing sdk). While building I get the following error:

[indent]1>AddCudaCompileDeps:
1>Skipping target “AddCudaCompileDeps” because all output files are up-to-date with respect to the input files.
1>AddCudaCompilePropsDeps:
1> Found “CudaToolkitCustomDir”.
1> Found “AdditionalDeps”.
1> Found “CompileOut”.
1> Found “Include”.
1> Found “Keep”.
1> Found “KeepDir”.
1> Found “NvccCompilation”.
1> Found “NvccPath”.
1> Found “RequiredIncludes”.
1> Found “TargetMachinePlatform”.
1> Found “CInterleavedPTX”.
1> Found “CodeGeneration”.
1> Found “GPUDebugInfo”.
1> Found “MaxRegCount”.
1> Found “PtxAsOptionV”.
1> Found “Defines”.
1> Found “Emulation”.
1> Found “HostDebugInfo”.
1> Found “FastMath”.
1> Found “Optimization”.
1> Found “Runtime”.
1> Found “RuntimeChecks”.
1> Found “TypeInfo”.
1> Found “Warning”.
1> Found “AdditionalOptions”.
1> Found “CommandLineTemplate”.
1>CudaBuild:
1> Compiling CUDA source file CudaTest.cu…
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 4.0.targets(357,9): error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.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\x86_amd64” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include” -G0 --keep-dir “x64\Debug” -maxrregcount=0 --machine 64 --compile -D_NEXUS_DEBUG -g -Xcompiler “/EHsc /nologo /Od /Zi /MDd " -o “x64\Debug\CudaTest.cu.obj” “C:\Users\RverBick\Desktop_\code\cudaTst\cudaTst\CudaTest.cu”” exited with code 1.[/indent]

I get a similar error when I do a clean:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 4.0.targets(441,9): error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe” -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include” -G0 --keep-dir “x64\Debug” -maxrregcount=0 --machine 64 --compile -D_NEXUS_DEBUG -g -Xcompiler “/EHsc /nologo /Od /Zi /MDd " -o “x64\Debug\CudaTest.cu.obj” “C:\Users\RverBick\Desktop_\code\cudaTst\cudaTst\CudaTest.cu” -clean” exited with code 1.

I’ve created an x64 configuration property and set up my project as shown here: #2782 » Blog Archive » Using CUDA and Thrust with VS 2010 Part 2: x64 Builds

I even downloaded his sample project and got the same error which means the problem is probably with the setup of my environment. If I open a VS2010 prompt and run vcvarsx86_amd64.bat then copy and paste, for example, the “clean” command shown above and run it, it works. If I copy and paste the build command, I get the following output:

M\cudaTst\CudaTest.cu"
CudaTest.cu
tmpxft_000004dc_00000000-0_CudaTest.cudafe1.gpu
tmpxft_000004dc_00000000-5_CudaTest.cudafe2.gpu
CudaTest.cu
tmpxft_000004dc_00000000-0_CudaTest.cudafe1.cpp
tmpxft_000004dc_00000000-11_CudaTest.ii
C:/Users/RverBick/AppData/Local/Temp/tmpxft_000004dc_00000000-11_CudaTest.ii :
fatal error C1033: cannot open program database ‘c:\program files (x86)\microsoft visual studio 10.0\vc\vc100.pdb’

At this point I have no idea what to change. Has anyone seen a similar problem resolved?

Thanks

Progress:

I uninstalled and reinstalled the computing sdk, nsight and the toolkit and a miracle has happened. The error persists in VS but if I open a command prompt, do a vcvarsx86_amd64.bat then copy and paste the clean then build command everything seems to work fine. I’ve shown my command line text below:

C:\Users\RverBick>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\n
vcc.exe” -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_
amd64” -I"…/…/common/inc" -I"…/…/…/shared/inc" -I"C:\Program Files\NVIDIA G
PU Computing Toolkit\CUDA\v4.0\include" -G0 --keep-dir “x64\Debug” -maxrregcou
nt=0 --machine 64 --compile -D_NEXUS_DEBUG -g -Xcompiler "/EHsc /nologo /Od
/Zi /MTd " -o “x64/Debug/concurrentKernels.cu.obj” “C:\ProgramData\NVIDIA Corp
oration\NVIDIA GPU Computing SDK 4.0\C\src\concurrentKernels\concurrentKernels.c
u” -clean

C:>cd “ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\concur
rentKernels”

C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\concurrentK
ernels>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe” -g
encode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code=
“sm_20,compute_20" --use-local-env --cl-version 2010 -ccbin “C:\Program Files (
x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64” -I"C:/ProgramData/NVIDIA Cor
poration/NVIDIA GPU Computing SDK 4.0/C/common/inc” -I"C:/ProgramData/NVIDIA Cor
poration/NVIDIA GPU Computing SDK 4.0/shared/inc" -I"C:\Program Files\NVIDIA GPU
Computing Toolkit\CUDA\v4.0\include" -G0 --keep-dir “x64\Debug” -maxrregcount
=0 --machine 64 --compile -D_NEXUS_DEBUG -g -Xcompiler "/EHsc /nologo /Od /
Zi /MTd " -o “x64/Debug/concurrentKernels.cu.obj” “C:\ProgramData\NVIDIA Corpor
ation\NVIDIA GPU Computing SDK 4.0\C\src\concurrentKernels\concurrentKernels.cu”

concurrentKernels.cu
tmpxft_00000f64_00000000-3_concurrentKernels.compute_10.cudafe1.gpu
tmpxft_00000f64_00000000-7_concurrentKernels.compute_10.cudafe2.gpu
concurrentKernels.cu
tmpxft_00000f64_00000000-0_concurrentKernels.compute_20.cudafe1.gpu
tmpxft_00000f64_00000000-11_concurrentKernels.compute_20.cudafe2.gpu
concurrentKernels.cu
concurrentKernels.cu
tmpxft_00000f64_00000000-3_concurrentKernels.compute_10.cudafe1.cpp
tmpxft_00000f64_00000000-20_concurrentKernels.compute_10.ii
Note: including windows.h
Note: including math.h
Note: including assert.h
Note: including windows.h
Note: including math.h
Note: including assert.h

So things “seem” to be working if I do things manually. This obviously isn’t a viable long term solution. The other problem I have is that in the “Cuda c/c++” properties in VS, even if I replace the “…/…/C/common/inc” and “…/…/shared/inc” references with the right include locations, VS still uses the original ones during the build. If I fix this, things might finally start working External Image ???

I have the same problem. Can you better describe the solution please. I have reinsatlled the system more then one time.

To be clear, I haven’t really solved anything. I can build things through a command line but not through the VS 2010 environment. I think though, that if I can figure out (or someone could share) how to change the include paths fed into nvcc then this error should go away. For the time being I’ve just installed VS 2008 and (almost) everything worked right out of the gate.

I think 1000 people must have the same problem, but nobody can solve this problem. I think its a NVIDIA bug and we must wait for a solution.

I admit I did not really look through all your data but…

I believe you’re encountering the multi-threaded build problem. I’m assumign you have multiple projects in the solution. If so then it is a visual studio problem…not nvidia.
Select Tools->Options->Projects and Solutions->Build and Run
Then set ‘maximum number of parallel project builds’ to 1.

The problem is that visual studio stomps all over itself while building multiple projects that reference the same files. If the intermediate directory is the same for the projects then it stomps on iteself with the vc90.pdb file (one thread deletes it then starts filling it in while the seconds thread does the same thing killing the results of the first or you will get file access errors).
If you fix that problem by renaming the .pdb from each project then it sill stomp on itself if you use any common .c files. (It will overwrite copies of the .o file and get file access errors)

The other solution is to build one project at a time (I know, I know…)

Can you realy compile the template under Win7 (64Bit) with a 64Bit compiler?

I have set the maximum number of parallel project builds to 1 but this have no effect.

Can somebody compile the template projekt under Win7 64Bit with a 64 Bit compiler?

I have this problem (or at least a very similar one) too. It definitely does not have anything to do with build order or whatsoever: When I start the command in the command line, I get this very strange error:

nvcc fatal   : Compiler 'cl' in PATH different than the one specified with -ccbin

If the compiler option “-ccbin” expects the same that is written in PATH, it would be completely useless ?! Why this check? What is going on there?

It would be nice if somebody of Nvidia would comment on how to get, e.g., the bandwith example compiled under VS2010, as I have the feeling that many people have problems to get started.

For being clear: I use Windows 7 64Bit , VS2010 Professional SP1 and installed

cudatoolkit_4.0.17_win_64.msi

devdriver_4.0_winvista-win7_64_270.81_general.exe

gpucomputingsdk_4.0.19_win_64.exe

I had exactly same problem (at CUDA 4.0.targets(357,9) ). In order to solve it u need to create environment variable (Control Panel → System → Advanced system properties → Environment variables → New…) named CudaToolkitDir which basically points to the same path as CUDA_PATH one (F:\CudaToolkit\v4.0\ for me). Hope it`ll solve your problem too External Image

Please add this to Cuda 6.5 props.

Visual Studio 2010, 2012, 2013 are affected

$(VCInstallDir)bin\amd64