Skip to content

FIX: dxcore include when compiling with older Windows SDK #25297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JulienMaille
Copy link
Contributor

@JulienMaille JulienMaille commented Jul 6, 2025

Description

Confirmed to work with Windows 10 SDK, version 1803 (10.0.17134.0)

@JulienMaille JulienMaille marked this pull request as ready for review July 6, 2025 15:02
@fs-eire
Copy link
Contributor

fs-eire commented Jul 7, 2025

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@fs-eire
Copy link
Contributor

fs-eire commented Jul 7, 2025

D:\a\_work\onnxruntime\onnxruntime\onnxruntime\core\platform\windows\device_discovery.cc(38,10): fatal error C1083: Cannot open include file: 'directx/dxcore.h': No such file or directory

the change is failing for the existing build.

Could you share more information how this change fixed your build? Is there a header file path change for a specific range of SDK?

@JulienMaille
Copy link
Contributor Author

@fs-eire That's weird.
So

  • with #include <directx/dxcore.h> it will include _deps\directx_headers-src\include\directx\dxcore.h
  • with #include <dxcore.h> I get D:\Dev\onnxruntime\ort-1.23.0\onnxruntime\core\platform\windows\device_discovery.cc(38,10): error C1083: Cannot open include file: 'dxcore.h': No such file or directory

Note that with Windows SDK v17134 there's no dxcore.h while when compiling for SDK v26100 it is present inC:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\dxcore.h

I suppose your pipeline doesn't populate _deps\directx_headers-src\?

@fs-eire
Copy link
Contributor

fs-eire commented Jul 7, 2025

Seems currently _deps\directx_headers-src\ only exists when building with --use_dml.

@skottmckay @snnn do we want to always include "directx_headers" for Windows build so that ORT can build against older Windows SDK

@JulienMaille
Copy link
Contributor Author

@fs-eire Do you have a pipeline that builds with --use_dml? Because I'm currently testing and it seems I need the same fix with latest Windows SDK.

@fs-eire
Copy link
Contributor

fs-eire commented Jul 7, 2025

I don't think we have an active DML CI pipeline.

@JulienMaille
Copy link
Contributor Author

For the record, These are my build parameters (when testing without forcing older sdk): --config Release --build_dir 'D:\dev\onnxruntime\bld-x64-1.23.0-mimalloc-ov2025.2.0' --skip_submodule_sync --build_shared_lib --parallel --use_dml --use_mimalloc --compile_no_warning_as_error --skip_submodule_sync --skip_tests --skip_onnx_tests --cmake_extra_defines 'CMAKE_POLICY_VERSION_MINIMUM=3.5 onnxruntime_ENABLE_MEMLEAK_CHECKER=OFF' onnxruntime_BUILD_UNIT_TESTS=OFF CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON --use_openvino MULTI:GPU,CPU

@JulienMaille
Copy link
Contributor Author

I see other includes in dml



but if really needed we could have

#if __has_include(<directx/dxcore.h>)
#include <directx/dxcore.h>
#else
#include <dxcore.h>
#endif
#if __has_include(<directx/dxcore_interface.h>)
#include <directx/dxcore_interface.h>
#else
#include <dxcore_interface.h>
#endif

Also as @fs-eire said, _deps\directx_headers-src\ are not only required for dml but also for device discovery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants