Uh oh!
There was an error while loading. Please reload this page.
fix(windows): skip hybrid GPU hook on single-GPU systems - #4938
Conversation
…xgi.dll crash The NtGdiDdDDIGetCachedHybridQueryValue hook was introduced in LizardByte#3530 to prevent DXGI output reparenting on multi-GPU/hybrid systems. On single-GPU systems, this hook is unnecessary and causes an access violation (0xc0000005) in dxgi.dll at a consistent offset on Windows 11 24H2 build 29558+. The crash occurs because dxgi.dll's internal code path doesn't correctly handle the spoofed D3DKMT_GPU_PREFERENCE_STATE_UNSPECIFIED value on newer Windows builds, resulting in a crash loop where the service wrapper continuously restarts the process. This fix: - Enumerates DXGI adapters before installing the hook to detect single vs multi-GPU - Deduplicates adapters by VendorId+DeviceId (same physical GPU can appear as multiple DXGI adapters due to cross-adapter copies) - Skips the hook entirely on single-GPU systems where output reparenting is not a concern - Adds error handling for MH_Initialize and MH_CreateHookApi return values - Adds logging for hook installation status Tested on: RTX 4070 Ti (single GPU), Windows 11 24H2 build 29558, NVIDIA 591.86 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Guided-By: SeMmy
|
ReenigneArcher
commented
Apr 2, 2026
Thank you for the PR submission, but I noticed you didn't use our PR template. Please update the PR to use the correct template. You can find it at https://github.com/LizardByte/.github/blob/master/.github/pull_request_template.md?plain=1 |
cgutman
commented
Apr 9, 2026
Did you take a look at dxgi.dll and see if either:
If the bug is not specific to single GPU systems, we're just kicking the can down the road. We're going to have complaints from users with multi-GPU systems where skipping the hook is not an option. |
LizardByte-bot
commented
Aug 20, 2026
It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks! |
LizardByte-bot
commented
Aug 30, 2026
This PR was closed because it has been stalled for 10 days with no activity. |




Summary
NtGdiDdDDIGetCachedHybridQueryValueMinHook on single-GPU systems where it's unnecessary0xc0000005indxgi.dll) on Windows 11 24H2 build 29558+Problem
The hybrid GPU workaround hook introduced in #3530 causes an access violation in
dxgi.dllon recent Windows 11 builds (24H2, build 29558+) with single-GPU systems. The crash is deterministic — always at offset0x6cb2findxgi.dll— and creates an infinite crash loop where the service wrapper restartssunshine.exeevery ~6 seconds.Crash signature:
Root cause: the hook spoofs
D3DKMT_GPU_PREFERENCE_STATE_UNSPECIFIEDas the return value, but the updateddxgi.dllin build 29558 doesn't handle this state correctly on a code path that only executes when the hook is active.Fix
Before installing the hook, enumerate DXGI adapters to detect if the system has multiple physical GPUs:
Adapters are deduplicated by
VendorId+DeviceIdsince the same physical GPU can appear as multiple DXGI adapters.Also adds:
MH_Initialize()andMH_CreateHookApi()return valuesTest Plan
🤖 Generated with Claude Code