microsoft / microsoft/vcpkg

[opencv4] Port ABI hash should consider CUDA toolkit version used during build

Open
#51,163 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
CMake
Stars
27.5k
Forks
7.7k
Avg merge
2d 19h
Merged PRs (30d)
321

Description

**Describe the bug**
Just encountered this minor bug related to changing/upgrading system CUDA toolkit versions after building the `opencv4` port.

**Environment**
- OS: Windows 11
- Compiler: VS 2022 (17.14.29)

**To Reproduce**
Steps to reproduce the behavior:
1) Install CUDA 12.8
2) Build `opencv4` port with `cuda` feature
- Generated `OpenCVConfig.cmake` in `vcpkg_installed\x64-windows\share\opencv4` will have a hard-coded variable set for the CUDA version used during build: `set(OpenCV_CUDA_VERSION "12.8.61")`
- This hard-coded version is checked against the install CUDA toolkit version; if they mismatch, `find_package()` will fail
3) Update CUDA to 12.8 Update 1
- Port will not rebuild and will just use the cached port files
4) `find_package()` will fail due to a CUDA version mismatch: `12.8.61` vs `12.8.93`

**Expected behavior**
IMO: The `opencv4` port should use the system CUDA toolkit version in its ABI calculation so that a port rebuild is triggered

Contributor guide

Open the contributing guide

Research direction

Start with the opencv4 port's ABI calculation and the generated vcpkg_installed\x64-windows\share\opencv4\OpenCVConfig.cmake from the reproduction. Verify how the installed CUDA toolkit version is detected and included in the ABI inputs. Done means changing from CUDA 12.8 to 12.8 Update 1 triggers an opencv4 rebuild and prevents the version mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.