GPU diagnostics: record DXGI budget at buffer allocation failure #3753

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3753 into main
andrewpozdnakov7-jpg commented 2026-11-28 15:05:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T15:05:51Z.


In diagnostic builds, an out-of-memory result from CPU-visible buffer creation now records DXGI usage and budget for both memory segments at the point of failure. The device's adapter LUID selects the adapter. The two segment queries are independent, so the log can include the segment that answered.

The first matching error emits a snapshot. Further snapshots are limited to one per 20 seconds, while the existing per-failure warnings continue to carry the buffer size and the error. This gives the next diagnostic run for #3515 measurements to compare with the preceding frame report. DXGI query documentation

On Windows WARP with Agility 1.620.2, a fixture passed an ordinary HRESULT and two synthetic out-of-memory statuses to the reporting helper. Exactly one snapshot was logged, with the first out-of-memory buffer label and size and all four fields from the live DXGI queries. Both strict GPU Clippy configurations and the asset policy passed.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5541496426 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3753). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T15:05:51Z. --- In diagnostic builds, an out-of-memory result from CPU-visible buffer creation now records DXGI usage and budget for both memory segments at the point of failure. The device's adapter LUID selects the adapter. The two segment queries are independent, so the log can include the segment that answered. The first matching error emits a snapshot. Further snapshots are limited to one per 20 seconds, while the existing per-failure warnings continue to carry the buffer size and the error. This gives the next diagnostic run for #3515 measurements to compare with the preceding frame report. [DXGI query documentation](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_4/nf-dxgi1_4-idxgiadapter3-queryvideomemoryinfo) On Windows WARP with Agility 1.620.2, a fixture passed an ordinary HRESULT and two synthetic out-of-memory statuses to the reporting helper. Exactly one snapshot was logged, with the first out-of-memory buffer label and size and all four fields from the live DXGI queries. Both strict GPU Clippy configurations and the asset policy passed. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 15:09:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T15:09:46Z.


Windows CI passed on 370adb0, including both Clippy configurations and the workspace tests. The WARP fixture recorded one snapshot for the first synthetic out-of-memory status. It included both segment usage and budget values from DXGI. The second out-of-memory status and the unrelated HRESULT produced no extra snapshot. The next diagnostic log for #3515 can pair its first buffer warning with the new sample.

The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7241251435 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3753#issuecomment-7241251435). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T15:09:46Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46158046913/job/141018931232) passed on `370adb0`, including both Clippy configurations and the workspace tests. The WARP fixture recorded one snapshot for the first synthetic out-of-memory status. It included both segment usage and budget values from DXGI. The second out-of-memory status and the unrelated HRESULT produced no extra snapshot. The next diagnostic log for #3515 can pair its first buffer warning with the new sample. The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
ColorMeBoom commented 2026-11-28 15:27:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-28T15:27:27Z.


@andrewpozdnakov7-jpg Ran this on a machine that hits #3515, and it confirms the shared-memory hypothesis.

Setup:

  • RX 5700 XT 8 GB (RDNA1), driver 32.0.21045.29003;
  • 16 GB RAM, Windows 11 26300, commit limit 55.9 GB;
  • head 370adb0 built with --profile diag --features diagnostics;
  • own dump of 1.0.2.1, --console series-s.

The world loaded about 4 minutes in. The first no shared buffer came at 15:26:36, and the run ended 24 s later on a host command list did not close (0x8007000E). Both snapshots:

DXGI memory budget at buffer allocation failure buffer="shared" size=4194304 local_used_mb=5322.989568 local_budget_mb=7742.160896 nonlocal_used_mb=8127.709184 nonlocal_budget_mb=7861.652992
DXGI memory budget at buffer allocation failure buffer="shared" size=4194304 local_used_mb=5525.495808 local_budget_mb=7742.160896 nonlocal_used_mb=8130.039808 nonlocal_budget_mb=7861.652992
  • Non-local is over its budget: 8,128–8,130 MB used against 7,862 MB. That's the half-of-RAM shared limit (dxdiag: Shared Memory 8161 MB).
  • Local has room: 5,323–5,525 of 7,742 MB, about 2.2 GB left.
  • Totals: 4,944 no shared buffer and 4 no mapped buffer lines before the end. Only the two snapshots above were logged.

So on a 16 GB machine the shared buffers fill the non-local segment while the card's own memory still has headroom. The paging file doesn't affect it.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7241480548 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3753#issuecomment-7241480548). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-28T15:27:27Z. --- @andrewpozdnakov7-jpg Ran this on a machine that hits #3515, and it confirms the shared-memory hypothesis. **Setup:** - RX 5700 XT 8 GB (RDNA1), driver 32.0.21045.29003; - **16 GB RAM**, Windows 11 26300, commit limit 55.9 GB; - head `370adb0` built with `--profile diag --features diagnostics`; - own dump of 1.0.2.1, `--console series-s`. The world loaded about 4 minutes in. The first `no shared buffer` came at 15:26:36, and the run ended 24 s later on `a host command list did not close (0x8007000E)`. Both snapshots: ``` DXGI memory budget at buffer allocation failure buffer="shared" size=4194304 local_used_mb=5322.989568 local_budget_mb=7742.160896 nonlocal_used_mb=8127.709184 nonlocal_budget_mb=7861.652992 DXGI memory budget at buffer allocation failure buffer="shared" size=4194304 local_used_mb=5525.495808 local_budget_mb=7742.160896 nonlocal_used_mb=8130.039808 nonlocal_budget_mb=7861.652992 ``` - **Non-local is over its budget:** 8,128–8,130 MB used against 7,862 MB. That's the half-of-RAM shared limit (`dxdiag`: Shared Memory 8161 MB). - **Local has room:** 5,323–5,525 of 7,742 MB, about 2.2 GB left. - **Totals:** 4,944 `no shared buffer` and 4 `no mapped buffer` lines before the end. Only the two snapshots above were logged. So on a 16 GB machine the shared buffers fill the non-local segment while the card's own memory still has headroom. The paging file doesn't affect it. AI use: Claude Code (Claude Opus 5.5).
andrewpozdnakov7-jpg commented 2026-11-28 15:36:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T15:36:06Z.


Thanks for capturing the RX 5700 XT run. At the first shared-buffer failure the process was about 266 MB over its non-local DXGI budget, with about 2.4 GB below its local budget. The close error came 24 seconds later. That first snapshot documents non-local budget pressure in this run. DXGI defines its budget as an application usage target. DXGI budget fields

Follow-up 092bbcc sits directly on 370adb0. It adds a DXGI snapshot when a host command list close, reset, or prelude reports E_OUTOFMEMORY. The command-list snapshot has a separate 20-second rate limit, so a recent buffer warning still allows the first command failure to be sampled. This makes it possible to compare the AMD close error with the prelude error in #3515 if someone gets another normal run on either machine.

With synthetic HRESULTs on WARP 1.0.22 and Agility 1.620.2, the original head emitted one buffer snapshot. The follow-up emitted one buffer snapshot and one command-list snapshot, each with four DXGI fields. Repeated failures in each category were throttled. Both debug-layer settings gave the same result. The clean GPU diagnostics suite had 246 passes and one ignored in each setting. Strict GPU Clippy and asset policy passed.

Please retain the Git author if cherry-picking the follow-up. If folding it into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7241592317 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3753#issuecomment-7241592317). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T15:36:06Z. --- Thanks for capturing the RX 5700 XT run. At the first shared-buffer failure the process was about 266 MB over its non-local DXGI budget, with about 2.4 GB below its local budget. The close error came 24 seconds later. That first snapshot documents non-local budget pressure in this run. DXGI defines its budget as an application usage target. [DXGI budget fields](https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_4/ns-dxgi1_4-dxgi_query_video_memory_info) [Follow-up `092bbcc`](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/3753-command-list-budget) sits directly on `370adb0`. It adds a DXGI snapshot when a host command list close, reset, or prelude reports `E_OUTOFMEMORY`. The command-list snapshot has a separate 20-second rate limit, so a recent buffer warning still allows the first command failure to be sampled. This makes it possible to compare the AMD close error with the prelude error in #3515 if someone gets another normal run on either machine. With synthetic HRESULTs on WARP 1.0.22 and Agility 1.620.2, the original head emitted one buffer snapshot. The follow-up emitted one buffer snapshot and one command-list snapshot, each with four DXGI fields. Repeated failures in each category were throttled. Both debug-layer settings gave the same result. The clean GPU diagnostics suite had 246 passes and one ignored in each setting. Strict GPU Clippy and asset policy passed. Please retain the Git author if cherry-picking the follow-up. If folding it into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3753:upstream-pr/3753'
git switch 'upstream-pr/3753'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3753'
git switch 'upstream-pr/3753'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3753'
git switch 'upstream-pr/3753'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3753'
git switch 'main'
git merge --squash 'upstream-pr/3753'
git switch 'main'
git merge --ff-only 'upstream-pr/3753'
git switch 'main'
git merge 'upstream-pr/3753'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!3753
No description provided.