1
votes

I am runnung Visual Stadio2010, and have build the OpenCV2.4 with Cmake2.8, during the confugration have set :

WITH_CUDA flag on 
CUDA_SDK_ROOT_DIR :C:/ProgramData/NVIDIA Corporation/NVIDIA GPU Computing SDK 4.2
CUDA_TOOLKIT_ROOT_DIR: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v4.2

and then build the whole project in visual studio, successfully. I am using NVIDIA Quadro 5000, and have tested the examples in "OpenCV-2.4.0-GPU-demos-pack-win32", which all of the works without any error. also the core and highgui libraries function works fine too.but I cant run anything related to GPU functions in openCV. this code return me 0 which according to documentation means no device has been find:

int deviceCount =cv::gpu::getCudaEnabledDeviceCount();
  std::cout << "index " << deviceCount <<"\n";

which the same as device number number from the GPUdemopack examples, but any other gpu function shows me the following error:

OpenCV Error: No GPU support in unknown function file c:\slave\wininstallerMegaPack\src\opencv\modules\core\src\gpumat.cpp,line193

any body has any idea? please let me know. Thanks

3
Do the CUDA SDK samples compile and run? - Tom
I havent try them, is there any ready samples in the SDK? - user261002
I just run simpleGl.exe from C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\bin\win32\Release and it did work. - user261002
What driver do you have ? Why are you using 4.2 ? - Pavan Yalamanchili
OpenCV 2.4 needs at least CUDA 4.1, so it seems that your stuff should work. - karlphillip

3 Answers

1
votes

OpenCV 2.4 is still in beta and is not ready to be used for serious projects. It has several build problems on Windows and Mac OS X as far as I could test.

I suggest you stick with the 2.3.1 which is the last stable release. Don't use the 2.4 unless there's a feature in there that you really really need.

EDIT:

By the way, OpenCV 2.3.1 only supports CUDA 4.0.

1
votes

Run devicequery.exe from the Cuda SDK ( CUDA sdk 4.1\C\bin\win32\Release ) and check the compute capability value of your card.

Then in cmake for opencv, check the CUDA_ARCH_BIN includes this value.

Earlier cards only did 1.1 and don't have ARCH_PTX (the new CUDA binary format) - it's possible to make opencv build only for the new format - which doesn't need as much runtime compilation

1
votes
  1. You are saying that you had build OpenCV yourself, but the file path from error message (c:\slave\wininstallerMegaPack\...) clearly indicates that you are using prebuilt OpenCV from sourceforge. If you have really build OpenCV yourself, then you have to troubleshoot your environment and find why wrong binaries are used. (The simplest thing you can do - remove any OpenCV binaries from your PC and make a clean full build of both OpenCV and your app.)

  2. OpenCV 2.4 betas have a packaging bug making gpu-enabled binaries useless. So you have to rebuild the library from source or use OpenCV 2.3.1 (CUDA 4.0 indeed).

  3. GPU demos pack is tricky - it has own copy of all binaries it might need. However it can not be used for development.

  4. Final OpenCV 2.4 release is awaited in few days. Windows package will include working CUDA binaries.

EDIT:

OpenCV 2.4.0 is out!