Skip to content

Add note for people debugging DirectML detection failures to check their Windows SDK version.#26452

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
BillyONeal:add-windows-sdk-note
Nov 13, 2024
Merged

Add note for people debugging DirectML detection failures to check their Windows SDK version.#26452
asmorkalov merged 1 commit intoopencv:4.xfrom
BillyONeal:add-windows-sdk-note

Conversation

@BillyONeal
Copy link
Copy Markdown
Contributor

@BillyONeal BillyONeal commented Nov 12, 2024

DirectML was first included with 10.0.18362.0, but dxcore.lib necessary to make the check pass was first in 10.0.19041.0.

I authored this PR because an internal customer was complaining about vcpkg failing to build OpenCV, but they were using Windows SDK 10.0.18362.0, causing this error:

-- No support for DirectML (d3d12, dxcore, directml libs are required)
[...]
-- Verifying WITH_DIRECTML=ON => 'HAVE_DIRECTML'=FALSE
CMake Warning at cmake/OpenCVUtils.cmake:785 (message):
  Option WITH_DIRECTML is enabled but corresponding dependency have not been
  found: "HAVE_DIRECTML" is FALSE
Call Stack (most recent call first):
  CMakeLists.txt:1907 (ocv_verify_config)
[...]
CMake Error at cmake/OpenCVUtils.cmake:797 (message):
  Some dependencies have not been found or have been forced, unset
  ENABLE_CONFIG_VERIFICATION option to ignore these failures or change
  following options:

  WITH_DIRECTML
Call Stack (most recent call first):
  CMakeLists.txt:1907 (ocv_verify_config)


-- Configuring incomplete, errors occurred!

I tested that the check fails on 10.0.18362.0 but passes on 10.0.19041.0, below:

D:\vcpkg\buildtrees\opencv4\src\4.9.0-de6494b280.clean\cmake\checks>set LIB=C:\Program Files\Microsoft Visual Studio\2022\Dogfood\VC\Tools\MSVC\14.43.34604\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Dogfood\VC\Tools\MSVC\14.43.34604\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64

D:\vcpkg\buildtrees\opencv4\src\4.9.0-de6494b280.clean\cmake\checks>cl "/IC:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um" .\directml.cpp dxcore.lib d3d12.lib directml.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34604 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

directml.cpp
Microsoft (R) Incremental Linker Version 14.43.34604.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:directml.exe
directml.obj
dxcore.lib
d3d12.lib
directml.lib
LINK : fatal error LNK1181: cannot open input file 'dxcore.lib'

D:\vcpkg\buildtrees\opencv4\src\4.9.0-de6494b280.clean\cmake\checks>set LIB=C:\Program Files\Microsoft Visual Studio\2022\Dogfood\VC\Tools\MSVC\14.43.34604\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Dogfood\VC\Tools\MSVC\14.43.34604\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64

D:\vcpkg\buildtrees\opencv4\src\4.9.0-de6494b280.clean\cmake\checks>cl "/IC:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um" .\directml.cpp dxcore.lib d3d12.lib directml.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34604 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

directml.cpp
Microsoft (R) Incremental Linker Version 14.43.34604.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:directml.exe
directml.obj
dxcore.lib
d3d12.lib
directml.lib

D:\vcpkg\buildtrees\opencv4\src\4.9.0-de6494b280.clean\cmake\checks>

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch I think so but am not positive
  • There is a reference to the original bug report and related work
    - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • [ ] The feature is well documented and sample code can be built with the project CMake

…eir Windows SDK version.

DirectML was first included with 10.0.18362.0, but dxcore.lib necessary to make the check pass was first in 10.0.19041.0.
@BillyONeal
Copy link
Copy Markdown
Contributor Author

The 'failed to compare abi dumps' failure seems unrelated to this change...

@asmorkalov asmorkalov added this to the 4.11.0 milestone Nov 13, 2024
@asmorkalov asmorkalov self-requested a review November 13, 2024 05:26
@asmorkalov asmorkalov self-assigned this Nov 13, 2024
@asmorkalov asmorkalov merged commit 8fe70a1 into opencv:4.x Nov 13, 2024
@asmorkalov asmorkalov mentioned this pull request Nov 13, 2024
@BillyONeal BillyONeal deleted the add-windows-sdk-note branch November 13, 2024 21:58
@BillyONeal
Copy link
Copy Markdown
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants