views:

1850

answers:

3

I am running Windows 7 64bit, with Visual Studio 2008. I installed the CUDA driver's and SDK. The SDK comes with quite a few examples including compiled executable and source code. The compiled executable's run wonderfully. When I open the vc90 solution's and go to build in Win32 configuration I get this error:

Error   1 fatal error LNK1181: cannot open input file '.\Release\bandwidthTest.cu.obj' bandwidthTest bandwidthTest

Build log:

1>------ Build started: Project: bandwidthTest, Configuration: Release Win32 ------
1>Compiling with CUDA Build Rule...
1>"C:\CUDA\bin64\nvcc.exe"    -arch sm_10 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin"    -Xcompiler "/EHsc /W3 /nologo /O2 /Zi   /MT  " -I"C:\CUDA\include" -I"../../common/inc" -maxrregcount=32  --compile -o "Release\bandwidthTest.cu.obj" "c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\bandwidthTest\bandwidthTest.cu" 
1>nvcc fatal   : Visual Studio configuration file '(null)' could not be found for installation at 'c:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/../..'
1>Linking...
1>LINK : fatal error LNK1181: cannot open input file '.\Release\bandwidthTest.cu.obj'
1>Build log was saved at "file://c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\bandwidthTest\Release\BuildLog.htm"
1>bandwidthTest - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

if I attempt to compile in x64 it doesnt build at all and just skips the project

1>------ Skipped Build: Project: bandwidthTest ------
1> 
========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========

I am new to C++, having been doing C# for a while. I certain this something small that I am missing, but any clues you could provide would be appreciated.

+2  A: 

Check if you have x64 compiler installed. Then change project type to x64. I had the same problem when trying to compile 32bit cuda program with 64bit win7.

Also make sure you have added 64bit libs and includes to the search path.

beermann
+1  A: 

You need to make sure that all the tools match. So if you have the 64-bit Visual Studio compiler installed then you should install the 64-bit version of the CUDA toolkit.

If you only have the 32-bit Visual Studio compiler, then you should be able to install the 32-bit CUDA toolkit. Ideally you would install all the 64-bit tools. Then you will be able to build both the 64-bit and 32-bit (cross-compile) examples.

Tom
A: 

You're focusing on the wrong error message.

The .obj file doesn't exist because the nvcc compile step failed.

nvcc fatal   : Visual Studio configuration file '(null)' could not be found for installation at 'c:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/../..'
Die in Sente