D3D12.X: XCL_BACKGROUND_COMPILES=0 stops the driver's second compiles #1552
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!1552
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1552"
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?
@Digit4w on GitHub · 2026-11-24 17:34 UTC · original
Digit4w:background-processing-off→main· +78 −0 · 4 files · 1 commits · openXCL_BACKGROUND_COMPILES=0turns the driver's background work off on the title's device and on the device ofxcl shaders --pipelines. Part of #1269.NVIDIA's driver compiles a compute pipeline a second time on D3D12's background threads once
CreateComputePipelineStatehas returned: as long again, with the same memory. @QemmHD saw that in #156, and thatSetBackgroundProcessingMode(DISABLE_BACKGROUND_WORK)is refused with0x887A002D. With Windows Developer Mode on the call is taken and the second compile is gone. Unset, nothing changes. Refused, the log says why and nothing changes.What is in it
gpu/agility.rs:background_compiles_off(device)(the switch, the call, the reason of a refusal), with its tests ingpu/agility_tests.rshle/d3d12x/real.rs: the title's device, one log lineshaders.rs: the device of--pipelines, one line on stderrTested
RTX 4070 SUPER 12 GB (driver 32.0.16.2101), Ryzen 5 7600, 32 GB, Windows 11 26200 with Developer Mode on, rustc 1.100.0; tests debug, everything else release
cargo test --workspace --no-fail-fast -- --test-threads=4(XCL_ADAPTER=nvidia) one25f6d3, which is onmaine1d84b7: 1426 passed, 0 failed, 46 ignored.SKIPPED, 25 lines: 21 "no wave64", 3 f16 / f32 programs refused in the per-lane form (#1426),
heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).The three new tests pass; the GPU one took the off-and-on path here.
The head before the rebase (
035eead, the same change on an oldermain),xcl shaders <one translated CS> --precompile --only cs --pipelineswith heap windows, cold driver cache, one process each:XCL_BACKGROUND_COMPILES=0The same call as a local patch on
930e8b4, one translated CS per process (switch form): 146.7 s printed, 147.0 s wall and 145.6 s of CPU with background work off; another program with it on: 97.6 s printed, 199.2 s wall, 197.6 s of CPU.XCL_PSO_DISK_CACHE=0(noGetCachedBlob) does not remove the second compile.The same local patch in a retail title's loading up to its world start, XCL's driver cache off (
XCL_PSO_DISK_CACHE=0) and the driver's own cache cold, two runs each way in the order off, on, on, off. The fresh compute pipelines of two runs paired by DXIL size, time of the first over the second:The process used 4.29 and 4.45 cores up to the world's start with background work on, 3.57 and 3.58 with it off. A program of 994 844 B of DXIL finished before the title's watchdog only with it off (66 s and 68 s). The title stopped at the same place in all four runs: this does not get it past the world's start.
Regression run
All three through the same script, 60 s, with
XCL_ADAPTER=nvidia XCL_NETWORK=0 XCL_TRACE_FAULTS=1 XCL_FRAME_DUMP=300and A pressed at 14, 17 and 21 s.main:
this PR's head:
this PR's head with
XCL_BACKGROUND_COMPILES=0(its log:D3D12: the driver's background compiles are off (XCL_BACKGROUND_COMPILES=0)):Not tested
0x887A002Dhere with the local patch, before Developer Mode was turned on.e1d84b7: they were made before the rebase and not repeated.AI use
🤖 Generated with Claude Code
@lows78 on GitHub · 2026-11-24 18:08 UTC · original
Test report for #1552 at
7a92dcdf8c5a599e819f6fc5d5d165505ed43c57(clean tree), on an RTX 4090 without Developer Mode, which the description lists as not tested on this commit. I am not a graphics developer: Claude Code ran this on my PC, and I can rerun things if that helps.Tested
XCL_SAMPLE_*unset.cargo build --workspace && cargo test --workspace -- --test-threads=4:main9e3831e, one run: 776 passed, 0 failed, 41 ignoredXCL_BACKGROUND_COMPILES=0, one run: 779 passed, 0 failed, 41 ignoredcoherent_buffer_sanitizes_console_flags_and_statedid not fail in any of these runsgpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)gpu_background_work_is_turned_off_and_on_againtook the refusal path here:not taken here: Windows takes it in Developer Mode only (0x887a002d)xcl run <testgame> -- --hello), one run each with the variable unset,0and1: exit 0,failures: 0, no[FAIL]line in all three. Only0logs a line:Not tested
xcl shaders --pipelines, retail titles (nosmoke.ps1run), release builds, AMD, IntelAI use
@MatyEjsr on GitHub · 2026-11-24 18:25 UTC · original · edited 2026-11-26 13:33 UTC
Updated verification of #1552 at
e25f6d3a94e888e27413a7c621483f3e40781c8d(clean tree) on NVIDIA Ampere, with Developer Mode on. This replaces the earlier report on7a92dcd.git range-diffshows the same code rebased ontoe1d84b7; the only change is a removed trailer in the commit message. It also merges cleanly onto currentmain(b49be18), and the PR is still open at this head. Nothing in the replies since my earlier report asked for a further check on this commit; the Developer Mode refusal path was covered on AMD at an earlier head and is still not re-run here.Tested
XCL_SAMPLE_*unset.cargo test --workspace -j 8 --no-fail-fast -- --test-threads=8: 1426 passed, 0 failed, 46 ignoredXCL_BACKGROUND_COMPILES=0: 1426 passed, 0 failed, 46 ignored. Every device the suite creates throughreal::initloggedthe driver's background compiles are off(16 times), with no refusal.cargo test -p xcl --lib gpu::agility::tests -- --nocapture --test-threads=1: 11 passed.gpu_background_work_is_turned_off_and_on_againtook the off-then-onOkpath.e2etest_title_runs_and_game_folder_is_untouchedwithXCL_BACKGROUND_COMPILES=0: passed, and logged the "off" line.gpu::dxil::kernel,gpu::recomp::lower,lower_dxil,gpu::recomp::tests)d3d12SDKLayers.dllor no debug layer: 3Regression run (retail title, 60 s, release;
main= this PR's merge base)The PR head with
XCL_BACKGROUND_COMPILES=0(the switch is accepted on a title:D3D12: the driver's background compiles are off (XCL_BACKGROUND_COMPILES=0)at 0.445 s):Head against base: 99.1 % of the frames and 100.1 % of the peak commit with the switch unset, and 100.5 % / 99.6 % with
=0. The video memory at the end is the same in all three runs (6125 MB local).Not tested
xcl shaders --pipelineson this head (checked at7a92dcd)nvidia-devAI use
@nnonno91 on GitHub · 2026-11-24 18:26 UTC · original
Independent AMD check of the Developer Mode refusal at
035eead87a265cd8f5b9686c542179fedd4d8860.Tested
XCL_ADAPTER='AMD Radeon'.cargo build --workspace --lockedpassed.cargo test --locked -p xcl --lib -- background_compiles developer_mode gpu_background_work --test-threads=1 --nocapturepassed all three tests. The device test printed the Developer Mode refusal0x887a002d.cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 779 passed, 0 failed, 41 ignored, and one GPU skip (heap_window_out_of_memory_falls_back_to_the_switch_form, no heap windows).cargo test --locked -p xcl --test background_switch_probe -- --exact background_switch_reaches_the_shader_cli --nocapture --test-threads=1(temporary probe) calledxcl shaders <synthetic folder> --precompile --pipelinesin two subprocesses sharing the same shader input and using separate XCL caches withXCL_PSO_DISK_CACHE=0. Each made one pipeline and refused zero. WithXCL_BACKGROUND_COMPILESunset there was no status line. Setting it to0produced the Developer Mode refusal0x887a002donce on stderr.cargo test --locked -p xcl --test e2e -- --exact test_title_runs_and_game_folder_is_untouched --nocapture --test-threads=1passed in separate runs with the switch unset and set to0. The bundled title used the real AMD backend and finished both runs. Only the0run logged the Developer Mode refusal.Not tested
Developer Mode enabled on AMD, actual background compilation or performance, and retail titles.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) wrote the temporary CLI probe, ran the checks, and drafted this report.
@Aniseto on GitHub · 2026-11-24 18:01 UTC · original · edited 2026-11-24 18:28 UTC
Ran the three new tests at
035eead(re-run after the head moved from7a92dcd):Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
All three still pass on the new head.
gpu_background_work_is_turned_off_and_on_againtouches the real device (0.48 s on this run); the other two are parsing and logging checks.Not tested: a title run with the switch flipped (no unpacked title here), RDNA2/RDNA4 and Intel GPUs, Wine, release profile, native wave64.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - built the PR's head commit from a clean tree and ran the tests on this machine; no local changes were made.
@DavidM1911 on GitHub · 2026-11-24 19:19 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
@DavidM1911 on GitHub · 2026-11-26 05:48 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
github-bot referenced this pull request2026-11-26 13:02:36 +00:00
@thehollowedone on GitHub · 2026-11-26 13:34 UTC · original
Independent Windows/NVIDIA check of #1552 head
e25f6d3in a clean detached worktree. This checks the current PR revision; it does not repeat the author's cold-driver timing claim.Tested: Windows 11 build 26300 with Developer Mode enabled; Ryzen 7 9800X3D, RTX 3080 Ti 12 GiB (NVIDIA 621.35), rustc 1.99.1 MSVC, debug build.
XCL_ADAPTER=3080and a writable localXCL_DXIL_CACHEwere set for the tests.cargo build --offline --locked --workspace: passed.cargo test --offline --locked -p xcl --lib gpu::agility::tests -- --nocapture --test-threads=1: 11 passed, 0 failed, 0 ignored. The device test printed no refusal; its source printsnot taken hereon that branch, so the off/on calls succeeded on the Windows default adapter. This test does not print that adapter's identity.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4, with the switch unset: 1,426 passed, 0 failed, 46 ignored across 37 targets; 25 GPUSKIPPEDnotices.XCL_BACKGROUND_COMPILES=0: 1,426 passed, 0 failed, 46 ignored; the same 25 skips. Runtime initialization loggedthe driver's background compiles are off16 times and no refusal. The suite logs identify the real RTX 3080 Ti backend.Small test-coverage suggestion:
gpu_background_work_is_turned_off_and_on_againcurrently returns a passing result onErr(e)after printingnot taken here. On a machine without Developer Mode, its pass count therefore includes a path that did not exercise off/on. The repository'sskip_testhelper would make that missing coverage visible.Suggested test-only change
Not tested: controlled cold NVIDIA caches, compile time or GPU-time change, AMD/Intel, retail title smoke, or the
xcl shaders --pipelinesCLI hook. The two suite runs establish regression behavior on this host, not a speedup.AI use: Codex (GPT-6.2 Sol) checked the exact diff and test path, ran the commands, and drafted this report.
@ClosetPie107 on GitHub · 2026-11-26 13:57 UTC · original
AMD RX 9070 (RDNA4, RADV / Linux) test report on
e25f6d3aSetup
experimental-11.0-20261112), DXVKv3.1.1-209, patched vkd3d-protonmaster(ec207194,dxil-spirvb540c8a2), DXC1.9.2609.5x86_64-pc-windows-gnubuildTested
gpu::agility::tests(xcl-<hash>.exe agility:: --test-threads=1,XCL_ADAPTER=9070):705 MiB), includinggpu_background_work_is_turned_off_and_on_again.XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0 XCL_BACKGROUND_COMPILES=0 XCL_COHERENT_MB=1024):exit=0(841presents, 0 crashes, 0 device removals).SetBackgroundProcessingModereturns0x80004001(E_NOTIMPL), and XCL cleanly logs:D3D12: XCL_BACKGROUND_COMPILES=0 was not taken, the driver's background compiles stay on: 0x80004001and continues normally.
Not tested
e25f6d3a, Windows (where Developer Mode allowsSetBackgroundProcessingMode), NVIDIA,xcl shaders --pipelines.AI use
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.