1

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

4

3 に答える 3

1

OpenCV 2.4はまだベータ版であり、深刻なプロジェクトに使用する準備ができていません。私がテストできる限り、WindowsMacOSXでいくつかのビルドの問題があります。

最後の安定したリリースである2.3.1を使用することをお勧めします。本当に必要な機能がない限り、2.4を使用しないでください。

編集:

ちなみに、OpenCV2.3.1はCUDA4.0のみをサポートしています。

于 2012-04-23T19:06:25.733 に答える
1
  1. 自分でOpenCVをビルドしたと言っていますが、エラーメッセージ(c:\slave\wininstallerMegaPack\...)からのファイルパスは、sourceforgeからビルド済みのOpenCVを使用していることを明確に示しています。自分でOpenCVを実際に構築した場合は、環境のトラブルシューティングを行い、間違ったバイナリが使用されている理由を見つける必要があります。(実行できる最も簡単な方法-PCからOpenCVバイナリを削除し、OpenCVとアプリの両方のクリーンなフルビルドを作成します。)

  2. OpenCV 2.4ベータ版にはパッケージングのバグがあり、GPU対応のバイナリが役に立たなくなります。したがって、ソースからライブラリを再構築するか、OpenCV 2.3.1(実際にはCUDA 4.0)を使用する必要があります。

  3. GPUデモパックには注意が必要です。必要になる可能性のあるすべてのバイナリの独自のコピーがあります。ただし、開発には使用できません。

  4. OpenCV2.4の最終リリースが数日で待たれます。Windowsパッケージには、動作するCUDAバイナリが含まれます。

編集:

OpenCV 2.4.0がリリースされました!

于 2012-04-26T18:26:58.060 に答える
1

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

于 2012-04-23T15:51:40.593 に答える