Add opt-in VICTORY_NO_TDR switch to disable the direct queue's GPU timeout #3252

Open
github-bot wants to merge 2 commits from github-bot/gh-3252 into main AGit
Owner

@⁠Moonwolf711 on GitHub · 2026-11-26 14:39 UTC · original
Moonwolf711:no-tdr-queue-flag → main · +27 −0 · 2 files · 2 commits · open

The title can submit one indivisible multi-second GPU workload per frame (everything between waits is a single command-list burst). The default two-second TDR watchdog then removes the device mid-frame and the process exits through DXGI_ERROR_DEVICE_HUNG (0x887A0007) — the run-ending GPU fault the README warns about.

Change

When the existing VICTORY_NO_TDR switch is set, create the direct command queue with D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT instead of the default. This is per-queue and process-local, so Windows keeps TDR protection for every other process on the machine — no TdrDelay registry edits needed.

Verification (RX 6600 XT, driver-level translate cache warm)

  • Without the flag: every run ends in device removal after roughly a minute of world streaming, log shows DXGI_ERROR_DEVICE_HUNG at the present.
  • With VICTORY_NO_TDR=1: the same build runs past frame 3000 at a steady 30 fps with zero device faults, and the run continues. The saved host pipeline library is written normally at exit.

The switch defaults to off, so nothing changes for existing users.

**@⁠Moonwolf711** on GitHub · 2026-11-26 14:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/3252) `Moonwolf711:no-tdr-queue-flag` → `main` · +27 −0 · 2 files · 2 commits · open The title can submit one indivisible multi-second GPU workload per frame (everything between waits is a single command-list burst). The default two-second TDR watchdog then removes the device mid-frame and the process exits through `DXGI_ERROR_DEVICE_HUNG` (0x887A0007) — the run-ending GPU fault the README warns about. ## Change When the existing `VICTORY_NO_TDR` switch is set, create the direct command queue with `D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT` instead of the default. This is per-queue and process-local, so Windows keeps TDR protection for every other process on the machine — no `TdrDelay` registry edits needed. ## Verification (RX 6600 XT, driver-level translate cache warm) - Without the flag: every run ends in device removal after roughly a minute of world streaming, log shows `DXGI_ERROR_DEVICE_HUNG` at the present. - With `VICTORY_NO_TDR=1`: the same build runs past frame 3000 at a steady 30 fps with zero device faults, and the run continues. The saved host pipeline library is written normally at exit. The switch defaults to off, so nothing changes for existing users.
The title can submit one indivisible multi-second GPU workload per frame
(everything between waits is a single command list burst). The default
two-second TDR watchdog then removes the device mid-frame and the process
exits through DXGI_ERROR_DEVICE_HUNG (0x887A0007) - the run-ending GPU
fault the README warns about.

Create the direct command queue with
D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT when the existing
VICTORY_NO_TDR switch is set, instead of asking users to edit the
machine-wide TdrDelay registry value. Other processes keep normal TDR
protection.

Verified on RX 6600 XT: without the flag every run ends in a device
removal after roughly a minute of streaming; with VICTORY_NO_TDR=1 the
same build runs past frame 3000 at 30 fps with no device faults.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:47:55 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 14:49 UTC · original · approved these changes

Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):

  • Opt-in VICTORY_NO_TDR cleanly sets D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT on the host direct queue without changing default behavior when unset.
  • Verified CreateCommandQueue and host GPU execution succeed with VICTORY_NO_TDR=1 on both RTX 5090 and WARP (
    esource::tests::buffer_data_reaches_the_host_texture passed on both).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 14:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3252#pullrequestreview-6076159854) · **approved these changes** Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP): - Opt-in VICTORY_NO_TDR cleanly sets D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT on the host direct queue without changing default behavior when unset. - Verified CreateCommandQueue and host GPU execution succeed with VICTORY_NO_TDR=1 on both RTX 5090 and WARP ( esource::tests::buffer_data_reaches_the_host_texture passed on both). - cargo clippy -p victory-gpu --all-targets -- -D warnings: clean. - cargo xtask policy: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Diagnostics on the GPU fault that ends runs: the debug layer reports
'TDR ... on a different Device Context' - the timeout fires on a queue
the flag did not cover. The shader-emit host's validation queues were
created without it; any title-driven helper queue left the same way
keeps the exposure.

Apply D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT to all queue
creations when the switch is set. In victory-shader, which cannot reach
victory-gpu's switch module, the same 'set and not 0' check is made
inline.
Author
Owner

@⁠Moonwolf711 on GitHub · 2026-11-26 16:24 UTC · original

Update pushed (5c2ff9d): the flag now covers every command queue, not only the direct one.

Follow-up evidence: a diagnostics build (VICTORY_D3D12_DEBUG=1) that hit the same device removal reported the debug layer's reason as DXGI_ERROR_DEVICE_RESET: "The hardware took an unreasonable amount of time to execute a command on a different Device Context... TDR has been triggered" — i.e. the timeout fired on a queue the direct-queue-only flag did not protect. The same run's final state also showed thousands of live ID3D12Heap/ID3D12CommandAllocator/ID3D12GraphicsCommandList objects (the debug layer's "Kernel memory failure... memory leak" hint), so the timeout switch addresses the watchdog dimension of the fault; a separate resource-lifetime dimension may remain.

The shader-emit host's validation queues now get the flag too (with an inline env check, since victory-shader cannot reach victory-gpu's switch module).

**@⁠Moonwolf711** on GitHub · 2026-11-26 16:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/3252#issuecomment-7197599485) Update pushed (`5c2ff9d`): the flag now covers **every** command queue, not only the direct one. Follow-up evidence: a diagnostics build (`VICTORY_D3D12_DEBUG=1`) that hit the same device removal reported the debug layer's reason as `DXGI_ERROR_DEVICE_RESET`: *"The hardware took an unreasonable amount of time to execute a command on a different Device Context... TDR has been triggered"* — i.e. the timeout fired on a queue the direct-queue-only flag did not protect. The same run's final state also showed thousands of live `ID3D12Heap`/`ID3D12CommandAllocator`/`ID3D12GraphicsCommandList` objects (the debug layer's "Kernel memory failure... memory leak" hint), so the timeout switch addresses the watchdog dimension of the fault; a separate resource-lifetime dimension may remain. The shader-emit host's validation queues now get the flag too (with an inline env check, since `victory-shader` cannot reach `victory-gpu`'s switch module).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3252/head:github-bot/gh-3252'
git switch 'github-bot/gh-3252'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3252'
git switch 'github-bot/gh-3252'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3252'
git switch 'github-bot/gh-3252'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3252'
git switch 'main'
git merge --squash 'github-bot/gh-3252'
git switch 'main'
git merge --ff-only 'github-bot/gh-3252'
git switch 'main'
git merge 'github-bot/gh-3252'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3252
No description provided.