Fails to build with CUDA enabled

System information (version)
  • OpenCV => 4.3.0-527-ga711e2aa41 (master latest)
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2019
Detailed description

Have cloned latest master branch, as well as opencv-contrib master branch to separate folders.
Cuda version: 11.0RC (latest)

Build fails with an error:

Building NVCC (Device) object modules/world/CMakeFiles/cuda_compile_1.dir/__/core/src/cuda/Release/
nvcc fatal   : A single input file is required for a non-link phase when an outputfile is specified
CMake Error at (message):
Error generating

The same exact building process worked fine with opencv-4.2.0 and cuda 10.2

Steps to reproduce
  1. Clone opencv and opencv-contrib from git
  2. init vars for MKL and TBB:
"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\tbb\bin\tbbvars.bat" intel64
"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\bin\mklvars.bat" intel64
  1. Cmake it:
  1. Build with:
msbuild INSTALL.vcxproj -m -p:Configuration=Release
  1. It fails. 😲

Here’s the full console output:

Issue submission checklist
  • [v] I report the issue, it’s not a question
  • [v] I checked the problem with documentation, FAQ, open issues,, Stack Overflow, etc and have not found solution

  • [v] I updated to latest OpenCV version and the issue is still there
  • [v] There is reproducer code and related data files: videos, images, onnx, etc

1 possible answer(s) on “Fails to build with CUDA enabled