Skip to content

Windows: type ComputeAccelerator (MCDM) drivers as GPU or NPU - #534

Open
rwmcguir wants to merge 3 commits into
oneapi-src:masterfrom
rwmcguir:russ_mcdm_support
Open

rwmcguir wants to merge 3 commits into
oneapi-src:masterfrom
rwmcguir:russ_mcdm_support

Conversation

@rwmcguir

Copy link
Copy Markdown
Contributor

Drivers under GUID_DEVCLASS_COMPUTEACCELERATOR were always typed NPU, so GPU-only init never loaded an MCDM (compute-only) GPU driver. Type them from the device's DXCoreAttributes hardware-type GUID (GPU or NPU). If absent, fall back to a delimited npu/vpu/gpu token in the DLL file name. Otherwise keep the legacy NPU default for older NPU drivers.

Drivers under GUID_DEVCLASS_COMPUTEACCELERATOR were always typed NPU, so
GPU-only init never loaded an MCDM (compute-only) GPU driver. Type them from
the device's DXCoreAttributes hardware-type GUID (GPU or NPU). If absent,
fall back to a delimited npu/vpu/gpu token in the DLL file name. Otherwise
keep the legacy NPU default for older NPU drivers.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The registry parser can read beyond its buffer when string data lacks a NUL terminator.

1 open finding
What changed in this PR

Classifies Windows compute-accelerator drivers as GPU or NPU for correct loader initialization.

Changes:

  • Reads DXCore hardware-type attributes.
  • Falls back to DLL filename tokens, then legacy NPU behavior.
File Description
source/​loader/​windows/​driver_discovery_win.cpp Adds Windows compute-driver type detection.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread source/loader/windows/driver_discovery_win.cpp Outdated
Find each entry's terminator with memchr within the returned data size and
treat an unterminated entry as invalid, instead of relying on strlen.
Skip a zero-length value, use only the bytes the second query returns, and
cut the path at the first NUL. An unterminated value is still accepted.
The stored path no longer keeps the trailing NUL from the registry.

This branch has not been deployed

No deployments
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