Skip to content

sys: Use DXCore for accelerator discovery - #1351

Open
xieofxie wants to merge 8 commits into
mainfrom
feature/0f4706bf-cd8e-46d9-b4d3-2875cb96df5d
Open

sys: Use DXCore for accelerator discovery#1351
xieofxie wants to merge 8 commits into
mainfrom
feature/0f4706bf-cd8e-46d9-b4d3-2875cb96df5d

Conversation

@xieofxie

@xieofxie xieofxie commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use Windows DXCore as the primary source of GPU/NPU adapter identity in winml sys
  • keep WMI/PnP as descriptive enrichment for driver and manufacturer, and as a compatibility fallback when DXCore is unavailable
  • preserve one native row per physical adapter, so identical display names no longer require WMI-to-ORT matching
  • surface the DXCore adapter LUID in text, compact, and JSON output as a side product of native system discovery

Discovery behavior

DXCore returns the adapter name, hardware IDs, and LUID together. winml sys now creates accelerator rows from that inventory, then joins WMI/PnP metadata by hardware ID or name. ONNX Runtime remains responsible only for execution-provider inventory and EP-specific facts; it no longer assigns the top-level device LUID.

CPU discovery remains WMI-based and reports LUID: N/A because CPU devices do not have a Windows graphics/compute adapter LUID.

Hardware observations

Feature Selected configuration Discovered device LUID
TensorRT RTX GPU --ep nvtensorrtrtx --device gpu NVIDIA GeForce RTX 4080 0x00000000_0x000175F5
QNN GPU --ep qnn --device gpu Qualcomm(R) Adreno(TM) X1-85 GPU 0x00000000_0x00012AC1
QNN NPU --ep qnn --device npu Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Hexagon(TM) NPU 0x00000000_0x000135AA

All three accelerator paths were revalidated through DXCore on this revision. QNN GPU inference completed at 0.743 ms mean latency and 1,345.89 samples/sec.

GPU: NVIDIA GeForce RTX 4080 (LUID: 0x00000000_0x000175F5) | CPU: Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz (LUID: N/A)

Validation

  • 134 expanded sysinfo/device unit tests passed
  • 2 hardware E2E device-shape and cross-view tests passed
  • direct DXCore probe returned the physical NVIDIA GeForce RTX 4080 and filtered the software Basic Render Driver
  • QNN NPU model selection succeeded
  • required mypy check passed for 440 source files
  • Ruff clean on changed Python files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@xieofxie
xieofxie requested a review from a team as a code owner August 24, 2026 10:55
hualxie and others added 2 commits August 25, 2026 11:49
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@xieofxie xieofxie changed the title Show device LUIDs in winml sys sys: Show device LUIDs in winml sys Aug 25, 2026

@zhenchaoni Zhenchao Ni (zhenchaoni) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two device-to-LUID matching issues that can produce missing or incorrect identifiers.

Comment thread src/winml/modelkit/commands/sys.py Outdated
Comment thread src/winml/modelkit/commands/sys.py Outdated
hualxie and others added 2 commits August 26, 2026 16:59
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@xieofxie xieofxie changed the title sys: Show device LUIDs in winml sys sys: Use DXCore for accelerator discovery Aug 26, 2026
@xieofxie

Copy link
Copy Markdown
Contributor Author

The review discussion exposed that top-level LUID assignment should not depend on ORT-to-WMI name matching. Commit 6563659 replaces that design: DXCore now owns each GPU/NPU row and returns its name, hardware IDs, and LUID together; WMI/PnP only enriches descriptive fields. This also handles multiple physical adapters with identical display names because each DXCore row already carries its own identity.

hualxie and others added 3 commits August 26, 2026 18:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@xieofxie

Copy link
Copy Markdown
Contributor Author

Latest Qualcomm retest confirms the native path: DXCore returned Adreno X1-85 (0x00000000_0x00012AC1) and Snapdragon X Elite Hexagon NPU (0x00000000_0x000135AA). QNN GPU inference measured 0.743 ms mean latency / 1,345.89 samples/sec; QNN NPU selection succeeded. The prior lint failure was a mypy-only ctypes annotation issue, fixed in a2ab36e; mypy -p winml.modelkit now passes all 440 source files.

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