compiling OpenCV with CUDA and OpenGL

asked 2013-04-16 10:23:25 -0600

paul gravatar image

Hi.

I am trying to use Brox's gpu optical flow algorithm in OpenCV. I read that for this, OpenCV must be recompiled with CUDA and OpenGL enabled. I am using OpenCV 2.4.9 (? - the 'master' branch from the repository), CUDA 5.0 and VS 2010 Express under Windows 7 64 bit. I have the latest updates for the OS, VS and my graphics card (GTX 660).

I build the solution with CMake, WITH_CUDA and WITH_OPENGL ticked. It builds successfully, although some libraries (WEBP, GIGEAPI) are not found. I don't know if this is relevant. In CMake, I did not touch the detected CUDA options (path found correctly and if I understand correctly, it wants to build for multiple computing capabilities, etc.).

When I try to compile the solution in VS, 16 build fail, sadly, opencv_gpu among them. The error messages are the following:

1, Error    36  error C2065: 'CV_StsBadArg' : undeclared identifier C:\CODE\opencv-master\modules\softcascade\test\utility.cpp  78  1   opencv_test_softcascade

2, Error    1212    error C2065: 'CV_StsNotImplemented' : undeclared identifier C:\CODE\opencv-master\modules\gpu\src\arithm.cpp    80  1   opencv_gpu

3, Error    1218    error C3861: 'cvLoad': identifier not found C:\CODE\opencv-master\modules\gpu\src\cascadeclassifier.cpp 787 1   opencv_gpu

4, Error    1518    error LNK1104: cannot open file '..\..\..\lib\Debug\opencv_gpu249d.lib' C:\CODE\opencv_build\modules\gpu\perf4au\LINK   gpu_perf4au

and 13 other LNK1104s for different projects, all failing to link opencv_gpu249d.lib)

There are many other C2065s, C2228s, C3861s, C2146s, C2059s and the like, but I figure that they must be caused by the same reason.

Any help or advice is welcome. If there is a solution to this without having to recompile, I'm open for that too.

Thanks.

edit retag flag offensive close merge delete

Comments

I've experimented some issues with the opencv tests and perf tests, try to unactivate them. This is not a "real" answer, but it could help for tests. If you experiment "real" issues with these part of OpenCV, please report it to the bug tracker, because I don't experiment them anymore... :(

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2013-04-16 10:30:05 -0600 )edit

Please, use 2.4 branch. master is unstable (it is used as develop branch).

Vladislav Vinogradov gravatar imageVladislav Vinogradov ( 2013-04-16 10:55:23 -0600 )edit