D3D12.X: DRED is switched on before the process's first device #2967
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2967
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2967"
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?
@throny on GitHub · 2026-11-27 05:40 UTC · original
throny:dred-before-first-device→nvidia-dev· +72 −22 · 3 files · 1 commits · draftWith
XCL_DRED=1, a device removal onnvidia-devhas answered every DRED query with0x887a0004("not enabled") since the launch preparation landed: no page-fault line, no breadcrumbs. The DRED settings only count for devices created after they are set, and the preparation's runner creates a device before the title's backend applied them. This PR applies them before the process's first device. Fixes #2920.What is in it
crates/xcl/src/gpu/agility.rs:dred_request()(readsXCL_DRED, as before:pagefaultleaves the breadcrumbs off) andenable_dred_once()(once per process, same settings and log lines as the code it replaces), called at the start ofagility::create_device. Every device of a title process is made there: the runner, preflight, the title's backend,xcl shaders, textures.crates/xcl/src/hle/d3d12x/real.rs: the old block is one call to the same function (it keeps the log line before the device).crates/xcl/src/gpu/agility_tests.rs:dred_request_reads_the_variable, andcreate_device_sets_dred_first, which fails when the call is removed fromcreate_device(checked: 9 passed, 1 failed without it; 10 passed with it).Side effect to know:
XCL_DRED=1now also applies in the launcher's preflight and inxcl shaders, because their devices go through the same function. Nothing changes whenXCL_DREDis unset.Tested
cargo test -p xcl --lib gpu::agility(debug): 10 passed, 0 failed, 0 ignored.nvidia-deva5e2d851with this change and local test patches,XCL_DRED=1. The device was removed 145 s after the first game frame. The log now has "DRED on" at start-up and, at the removal, the DRED device state, a page-fault line and the breadcrumb answer ("no list was in flight"), where the same setup logged "DRED: no breadcrumbs (0x887a0004)" in 20+ earlier removals.Regression run
On the base commit (
nvidia-dev; the block on a commit ofmainthat the check asks for is still queued) and on this PR's head, same title, 120 s,XCL_DREDunset:Not tested
AI use
🤖 Generated with Claude Code
@LocranKing on GitHub · 2026-11-27 12:20 UTC · original
Tested PR #2967 (
f058e4ea) on Windows 11 (gpu::agilityunit tests +180 ssmoke run withXCL_DRED=1).Environment
32.0.16.2140)nvidia-devDXIL cache (XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PREPARE_GRAPHICS=0,XCL_DRED=1), Series S (lockhart) profile.Unit tests
cargo test --locked -p xcl --lib -- gpu::agility --nocaptureonf058e4ea:dred_request_reads_the_variableandcreate_device_sets_dred_first).180 sSmoke Run (XCL_DRED=1,lockhart)D3D12: DRED on (page faults and the lists' last operations)was logged at0.441 s(before startup shader preparation creates the first device, and ~15 s beforetimer: finestat15.895 s). Onnvidia-devbaselines without this PR, DRED wasn't logged until after launcher/preparation (15.48 s–40.96 s).exit: 0x0,0crashes,0device removals,1734frames (PresentX 1734), heavy world activity started at113.01 s, peak commit28011 MB, peak local VRAM10035 MB, peak non-local5016 MB.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.