Compile OpenCv with Cuda

Hello,
It’s take about 5/6 hours to compile OpenCV with Cuda option.
What’s happen ? could you help ?
Thank you

There are two main reasons for this “in general”. Either of which may or may not apply to you;

  1. you are using something like Visual Studio and not ninja for compilation, and/or
  2. you are compiling for all device compute capabilities.

I suspect definitely (2) if it is taking 5/6 hours. If so passing -DCUDA_ARCH_BIN=7.2 where 7.2 should be the compute capability of the device you will be running your OpenCv program on should help. This will however result in an application which won’t execute on devices of any other compute capability.

Yes I use Visual Studio 2019. and compiling for all. Thx