Skip to content

Error building with BUILD_CUDA_STUB on machine without CUDA #2724

@rtimpe

Description

@rtimpe
System information (version)
  • OpenCV => 4.4
  • Operating System / Platform => ubuntu 20
  • Compiler => gcc 9.3
Detailed description

I'm trying to build opencv on a system without CUDA using -DWITH_CUDA=ON and -DBUILD_CUDA_STUBS=ONand using the extra modules from opencv_contrib. I'd expect to be able to build all of the cuda modules as stubs (similar to the behavior in opencv 2). Instead I get the following error:

opencv_contrib-4.4.0/modules/cudaarithm/src/lut.hpp:10:10: fatal error: cuda_runtime.h: No such file or directory
   10 | #include <cuda_runtime.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Is this a bug, or am I misunderstanding the BUILD_CUDA_STUBS option?

Steps to reproduce

Build opencv from source using the above options.

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions