Repository navigation
Conversation
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.
There was a problem hiding this comment.
🟡 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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.