GPU: log the TDR settings, and warn when a GPU hang would freeze the PC #1082
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1082
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1082/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@bvtterbroot on GitHub · 2026-11-24 15:34 UTC · original
bvtterbroot:gpu-tdr-level→main· +150 −1 · 4 files · 1 commits · merged 2026-11-25 00:12 UTCWith
TdrLevelset to 0, Windows never resets a hung GPU, so a slow or hung world frame freezes the whole PC and the runtime never sees a device removal it could report (#1054). Reports of "the PC froze" don't say whether that setting is in play; this makes the log say it.Closes #1054.
What
crates/victory-gpu/src/tdr.rs: readsTdrLevel,TdrDelayandTdrDdiDelayfromHKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers(RegGetValueW, DWORD only; a missing value reads as Windows' default).VICTORY_D3D12_WARP), one info line logs the three values, withdefaultwhere one is not set:TdrLevel0 (a hang freezes the PC) and 1 (a timeout is a blue screen), saying to deleteTdrLevelor set it to 3 and raiseTdrDelayinstead. Levels 2 and 3 and an unset value don't warn, and neither does a raisedTdrDelayalone.windows-sysinvictory-gpugains theWin32_System_Registryfeature;Cargo.lockis unchanged.This complements #537, which documents raising
TdrDelay/TdrDdiDelayin the README; it touches no README lines, so the two don't conflict.Tested
Windows 11, AMD Radeon RX 7900 XTX, driver 26.11.2, Rust 1.98.1, at
ffe310e:cargo test --workspace --locked: all pass, including the 5 newtdr::tests(warnings for 0 and 1; none for unset, 2, 3 or a raised delay alone; a missing value reads asNone).cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: clean.rustfmt --checkontdr.rs: clean.Tdr::read()on this machine giveslevel: Some(3), delay: Some(8), ddi_delay: None, the same asreg queryfor that key.Not tested: a run of the title (I don't have a dump), so the log line has not been seen in a real run's log, and the warning path has not been seen with
TdrLevelactually set to 0 (only in unit tests). Not run under Wine, where the key is normally absent and the line logsdefaultfor all three.🤖 Generated with Claude Code
@Zipettte on GitHub · 2026-11-24 16:29 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
42961e8:cargo test -p victory-gpupasses, 55 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
E:\GTA\GTA6.Xbox(Series X 版,208.6 GiB… #855