Dan
Dan

Reputation: 61

Trouble with nvcc when building Opencv 2.4.3 with cuda5 support on windows 7

I have trouble to build OpenCV 2.4.3 library with support of CUDA (version 5) using cmake. The problem seems to come from nvcc according to another thread here: Why won't OpenCV compile in NVCC?. But this does not explain how to install OpenCV.

Any answer that can help me will be very appreciated!

My system setup:

Computer: Dell46 precision M4700 machine with Windows 7 professional, 64bit os 
Compiler: Microsoft Visual Studio 2008, 
CMake version: 2.8.10.2 
CUDA: 5.0

Below is a sample of errors while building Opencv once I set 'Use Cuda' Yes in cmake configure:

Error   3   fatal error : Option '--cubin (-cubin)' is not allowed when compiling for multiple GPU code instances   nvcc
Error   4   fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_core243.lib'  opencv_test_ml
Error   5   fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_core243.lib'  opencv_perf_video
Error   6   fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_core243.lib'  opencv_test_features2d
Error   7   fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_core243.lib'  opencv_perf_nonfree
Error   8   fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_core243.lib'  opencv_perf_photo
etc.

Upvotes: 3

Views: 1436

Answers (1)

Dan
Dan

Reputation: 61

:) Very happy to finally find the solution! As suggested by the first error shown above, -cubin is not allowed, so the solution is to remove this option. Step-by-step solution is:

  1. cmake-gui, select OpenCV source path and specify build path. Configure (check "with cuda"), Generate.
  2. Go to build path of opencv (you specified in cmake-gui), open CMakeCache.txt.
  3. Set CUDA_BUILD_CUBIN:BOOL to OFF as shown below:
  4. Build your opencv with VC++.

<CMakeCache.txt>: 
//Generate and parse .cubin files in Device mode.
CUDA_BUILD_CUBIN:BOOL=OFF

Good luck!

Upvotes: 2

Related Questions