Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Two issues with CUDA_ENABLE_DELAYLOAD #23187

@mbechard

Description

@mbechard

System Information

OpenCV version: 4.7.0
Operating System / Platform: Windows 10
Compiler & compiler version: Visual Studio 2019

Detailed description

When using delayloading on Windows, the libraries using the /DELAYLOAD flag also need to link with delayimp.lib. I had to manually add this via CMAKE_SHARED_LINKER_FLAGS=delayimp.lib to get delayloading to compile.

Also, it would be nice if the python binary also applied the delay-loading to it's link stage as well. So we could import cv2 and not immediately load all of the CUDA binaries.

Steps to reproduce

Try compiling on Windows with
CUDA_ENABLE_DELAYLOAD=ON
BUILD_SHARED_LIBS=ON

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the 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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions