LNK1112 error when link an x64 program on one x86 Link error trying to build on Vista 64 U

  • Vista 64 Ultimate SP1
  • Dual 8800GTX
  • 8 GB
  • Visual Studio 2005 SP1

I downloaded Cuda 2 beta last night. I installed the provided video driver, the toolkit and the SDK.

I tried to run the deviceQuery sample but, after putting the required DLL’s on the search path, I got an error code printed to the shell that said the application failed to initialise. (I’ll provide the error message when I get back to the machine later
today)

Undaunted I decided that I’d build that sample and debug to see what is causing the error return. As it turns out the error message in the subject line is as far as I got. I tried building other samples with the same error.

After some digging around I’m pretty sure that all x64 options are set properly, however, I’ve come to the conclusion that the output of the nvcc build step is producing a 32bit object file which the linker doesn’t like. I conclude this becuase the -ccbin path passed to nvcc is the one for the 32bit compiler? I tried reproducing the command line by passing “C:\Program Files\Microsoft Visual Studio 8\VC\bin\amd64” as the path to the compiler but nvcc didn’t like that.

What am I doing wrong? What little switch or option do I need to flip to make this all work? :blink:

Thanks, Vince

Sorry subject should read:

" LNK1112: module machine type ‘x64’ conflicts with target machine type ‘X86’ "

Too early in the morning :">

This is the error that I get.
popup.jpg

Is no one else using CUDA on 64bit Vista? Does this work at all or am I the only one seeing these problems?

The silence is mildly disturbing considering.

Thanks, Vince

Do the precompiled examples run good?

No, they do not. They all terminate in the same way. :(

The CUDA 2.0 beta runs perfect on my one (Vista 64 home premium).

A couple things you might check:

  1. Did you choose to install the x64 compiler when you install VS2005?

  2. Did you install Visual Studio 2005 Service Pack 1 Update for Windows Vista?

  3. In the “Configuration Manager”, is the “Active solution platform” set to x64 instead of Win32?

Hope it helps. Good luck. :)

Then there is something wrong with your CUDA installation. Try reinstalling the driver, that might help, because if none of the precompiled binaries work, you probably have a driver problem.

With that on board I went back to my last restore point before installing CUDA for the first time. I restored and reinstalled the driver then reinstalled CUDA and I’m happy to say that the apps have started to work. Don’t know what messed up the initial install???

One thing that’s curious is I have a pair of 8800GTX’s but device query reports 3 CUDA devices. I do have the two card SLI linked in case that has something to

do with it.

Now to figure out what the compiler issue is.

Thanks for the hint AND a big thanks to Microsoft for implementing restore points.


C:\Program Files (x86)\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win64\Release>deviceQuery.exe

There are 3 devices supporting CUDA

Device 0: “GeForce 8800 GTX”

Major revision number: 1

Minor revision number: 0

Total amount of global memory: 805306368 bytes

Number of multiprocessors: 16

Number of cores: 128

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 8192

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 1.40 GHz

Concurrent copy and execution: No

Device 1: “GeForce 8800 GTX”

Major revision number: 1

Minor revision number: 0

Total amount of global memory: 805306368 bytes

Number of multiprocessors: 16

Number of cores: 128

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 8192

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 1.40 GHz

Concurrent copy and execution: No

Device 2: “GeForce 8800 GTX”

Major revision number: 1

Minor revision number: 0

Total amount of global memory: 805306368 bytes

Number of multiprocessors: 16

Number of cores: 128

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 8192

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 1.40 GHz

Concurrent copy and execution: No

Test PASSED

Press ENTER to exit…

  1. Pretty sure …

  2. Definitely

  3. First thing I did.

I think I’m pretty good on all counts but I’ll triple check each and every item again. Thanks for the hints.

Regards,

Vince

Very strange. Reinstalling everything after the system restore fixed the build problems too! :o . I’m able to build the samples and step through them in the debugger.

Thanks to all. External Media