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

**URL:** https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033
**Category:** Usage
**Tags:** os:linux, lang:cuda
**Created:** [April 15, 2020, 2:52pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033 "2020-04-15T14:52:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![raisa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/raisa/32/422_2.png) [@raisa](https://discourse.cmake.org/u/raisa)
#### Post date: [April 15, 2020, 2:52pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033/1 "2020-04-15T14:52:55Z")

</div>

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](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 ?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 15, 2020, 3:30pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033/2 "2020-04-15T15:30:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![raisa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/raisa/32/422_2.png) [@raisa](https://discourse.cmake.org/u/raisa)
#### Post date: [April 15, 2020, 3:34pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033/3 "2020-04-15T15:34:17Z")

</div>

@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 ?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 15, 2020, 3:37pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033/4 "2020-04-15T15:37:23Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![raisa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/raisa/32/422_2.png) [@raisa](https://discourse.cmake.org/u/raisa)
#### Post date: [April 15, 2020, 3:48pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033/5 "2020-04-15T15:48:02Z")

</div>

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

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 15, 2020, 4:09pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033/6 "2020-04-15T16:09:58Z")

</div>

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