How do I properly build OpenCV 4.3 with CUDA 10.1 support ?

Anyone successfully build OpenCV with Cuda using CMake on Linux (Ubuntu) ? I encountered this error :

OpenCV requires enabled 'cudev' module from 'opencv_contrib'

I’m using OpenCV 4.3, with Cuda 10.1 and my machine is running Ubuntu 18.04. This issue has been reported to github before, here : https://github.com/opencv/opencv/issues/14205

But the fix issued by OpenCV is a fix from last year (April 2019) and for the version (ver 4.3, April 2020), the fix is applied already but the error is still there. I also tried to include the extra module (contrib module, also version 4.3) but encountered more error instead :

CMake Error at cmake/OpenCVModule.cmake:288 (message):
      No modules has been found:
      /home/raisa/Downloads/Compressed/opencv_contrib-4.3.0
    Call Stack (most recent call first):
      cmake/OpenCVModule.cmake:370 (_glob_locations)
      modules/CMakeLists.txt:7 (ocv_glob_modules)

OpenCV Python: during development append to PYTHONPATH: /home/raisa/Documents/OpenCV/opencv-4.3.0-build/python_loader
    CMake Error at modules/core/CMakeLists.txt:40 (message):
      CUDA: OpenCV requires enabled 'cudev' module from 'opencv_contrib'
      repository: https://github.com/opencv/opencv_contrib

Anyone who have OpenCV compiled with CUDA using CMake on your Ubuntu, can you give some advice ?

This is a CMake discourse instance. Your question is OpenCV-specific, so I suggest asking somewhere OpenCV developers are likely to see it. Raising the issue on their issue tracker is likely to get a better response.

@ben.boeckel I’m guessing this has something to do with CMake settings that’s why I asked here as well. Do I need to delete my question ?

It’d be a question here if CMake itself has a problem. From your question, it just looks like something else is needed in the CUDA setup on your machine yet for OpenCV to be happy (it seems to correctly giving error messages about what it thinks is wrong).

But maybe @robert.maynard can give a quick answer?

@ben.boeckel never mind ! I got this, there was something in CMakeList, as indicated here : https://github.com/opencv/opencv_contrib/issues/2409.

Thanks by the way. Should I close my question now ?

Mark your last reply as the “solution”. Nevermind, I did so :slight_smile: . No need to delete the information here in case someone else does stumble across it.