Ask Your Question

Problems building 2.4.4 64-bit vs9 with GPU/CUDA

asked 2013-05-02 09:51:23 -0600

RubeRad gravatar image

updated 2013-05-02 10:22:46 -0600

Hey, I looked around for a while but could not find an answer to my specific problem.

I was using the binary distribution of OpenCV 2.4.4, but that is not built with GPU/CUDA support. So I am building it myself. I got the 32-bit version built OK, but I am having trouble with the 64-bit.

The InstallGuide has a cryptic statement "generate solutions using CMake, as described above. Make sure, you chose the proper generator (32-bit or 64-bit)" Well, cryptic to me at least, since I'm a newb at cmake. It took me a couple of hours of searching to discover that I needed

cmake -G 'Visual Studio 9 2008 Win64' -DWITH_CUDA=ON ...

But it seems that is not quite enough. My debug and release builds each took hours, but produced almost nothing in the end. I dove into modules/core and tried to get started building just opencv_core.vcproj, but it dies apparently because while the OpenCV code is being built 64-bit, the CUDA part is only 32 bit.

Is there some extra switch I need to give cmake to fix this?

Here's the error:

> devenv /build 'Debug|x64' opencv_core.vcproj
1>------ Build started: Project: opencv_core, Configuration: Debug x64 ------
1>.\CMakeFiles\cuda_compile.dir\src\cuda\Debug\ : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

More info from the build log, apparently this build also uses cmake, and I don't see any 64-bit flags; how do I give flags to cmake in the first place, so that the inner cmake will use the right flags? See here:

V:\programs\cmake\bin\cmake.exe -D verbose:BOOL=OFF -D "CCBIN:PATH=c:\TrustedApps\Microsoft Visual Studio 9.0\VC\bin" -D build_configuration:STRING=Debug -D generated_file:STRING=V:/downloads/opencv_244/x64/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/Debug/ -D generated_cubin_file:STRING=V:/downloads/opencv_244/x64/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/Debug/ -P V:/downloads/opencv_244/x64/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-05-16 07:13:00 -0600

johnalexander gravatar image

I care...! One might acchieve an equivalent solution to your problem, but then for v2.4.4 and Visual Studios 2010, by following my steps indicated in this answer to my own question, posted a little while ago.

edit flag offensive delete link more

answered 2013-05-15 17:23:26 -0600

RubeRad gravatar image

Well not that anybody cares (thanks for nothin, OpenCV forums!), but I finally found a useful link via stackoverflow, see tutorial here: Only thing I had to change from that tutorial was the generator ("... win64").

edit flag offensive delete link more

Question Tools


Asked: 2013-05-02 09:51:23 -0600

Seen: 1,471 times

Last updated: May 16 '13