Repository navigation
D3D12.X: with bounded pipeline waits, dispatches are not put off to the submit - #2581
brothernog wants to merge 1 commit into
Conversation
…he submit With XCL_PSO_WAIT_MS set, a dispatch whose pipeline is still being built is recorded at once instead of being put off to the submit (xcl-dev#2118): its bind waits at most XCL_PSO_WAIT_MS on the title's thread, as before. The submit's wait has the same bound, so the put-off only moved it. With XCL_PSO_WAIT_MS=1 a retail title's world start put off thousands of calls, a segment each; its command lists ran out of memory (Close: E_OUTOFMEMORY) and the device was removed (0x887a0001). Unset (the default), nothing changes.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
…ts, and keep split whole builds async Eliminate the remaining multi-second stalls observed past the 12 s per-frame pipeline wait window on cold/warm world frames: - Track in-flight wall-clock waits (`active_waiters` / `active_since`) in `pso_async::FrameWaitBudget` so staggered concurrent title threads share one hard wall-clock ceiling per kind per frame instead of each getting a fresh 12 s window (applied to both `FRAME_BUDGET_GFX`/`FRAME_BUDGET_CS` and `FRAME_WAIT`). - Skip deferring pending compute dispatches to submit in `list_x::defer` when `XCL_PSO_WAIT_MS` is set (#2581), when the current frame's compute wait window is already spent, or once 16 deferred segments have already been allocated on the current frame (prevents 512+ deferred segments and command-allocator/RAM churn). - Never compile `Chain::whole()` synchronously on a title/submit thread inside `dispatch_chain::dispatch` when scratch allocation fails under memory pressure or missing backing allocator: kick off `start_whole_async()` and return an error so the dispatch is skipped cleanly until the background whole build finishes, matching `whole_nonblocking`. Assisted-by: Antigravity (Gemini 4 Neon High)
|
Independent dual-PC NVIDIA full-workspace test report on clean head Tested
Not tested
AI use
|
…+ xcl-dev#2548 + xcl-dev#2579 + xcl-dev#2581 + xcl-dev#2598 + xcl-dev#2611 + xcl-dev#2615 + xcl-dev#2622) (cherry picked from commit 57e5c216e924452b59cd64862d2941006e24c28c)
When XCL_PSO_WAIT_MS is positive, record a dispatch immediately and use the same bounded bind wait instead of splitting one deferred command-list segment per call. This prevents bounded mode from exhausting command-list memory during large cold-pipeline bursts. Unset, zero, and malformed values preserve the default deferred-submit path. The change is stacked on atomic ExecuteIndirect stand-in classification. GNU Windows-target cargo check passed. Windows/MSVC, GPU, and title smoke execution were not available on this host. Adapted from PR xcl-dev#2581. Assisted-by: Codex (GPT-5.6-sol)
When XCL_PSO_WAIT_MS is positive, record a dispatch immediately and use the same bounded bind wait instead of splitting one deferred command-list segment per call. This prevents bounded mode from exhausting command-list memory during large cold-pipeline bursts. Unset, zero, and malformed values preserve the default deferred-submit path. The change is stacked on atomic ExecuteIndirect stand-in classification. GNU Windows-target cargo check passed. Windows/MSVC, GPU, and title smoke execution were not available on this host. Adapted from PR xcl-dev#2581. Assisted-by: Codex (GPT-5.6-sol)
Runs 4-6 on an RTX 5080 grew non-local video memory to 45 GB within a minute of the first intro frames and ended in E_OUTOFMEMORY and a device removal; run 7 with XCL_ALLOC_SWAP=0 stayed near 16 GB. The entry records the cause and the user's decision to adopt xcl-dev#2725, xcl-dev#2549, xcl-dev#2581 and xcl-dev#2707 through the gate. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RbZY1Ag73eDeCUZHpW3is
Commit: d5d694b Reviewer: Claude Code (Claude Opus 5.5), Opus worker, full read (findings) Review: sha256 a62622c16d253262ad9b5b40cbf5d29f6d9c16575a9956b233d7af56776ee98d
…s are left out With draws off the title's thread, a retail title on an RTX 5080 still stopped presenting 70 s after its loading screen: 31 of 32 compute waits built the pipeline in the call (up to 15 s each), and it then sat for 450 s behind about 35 ray-tracing resolve programs of 700 to 940 KB of DXIL that take up to 167 s each in the driver compiler. A waiting compute bind no longer takes the build job: the build is marked wanted, goes ahead of the workers' queue and is waited for, at most XCL_PSO_COMPUTE_WAIT_MS (default 120 s, 0: no limit); after that the pipeline is late and its dispatches are skipped until it is built. XCL_PSO_IMAGE_SKIP is now on unless set to 0: a big compute program that writes only images is not waited for and not put off to the submit. It writes no buffer, so no ExecuteIndirect can read stale counts from it. Tested on Windows 11, RTX 5080, driver 32.0.16.2140, on top of xcl-dev#2581, xcl-dev#2549 and xcl-dev#2707: cargo test -p xcl --lib -- pso_async:: bind:: list_x:: alloc_pool:: title_list:: : 95 passed, 0 failed; whole suite 1639 passed, 4 failed (the dxil fuzz_validate_and_gpu_0..3 that fail on this GPU without the change), 47 ignored, 45 SKIPPED lines. Not tested on AMD. Unit U5 of the stall-fix entry in decisions.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RbZY1Ag73eDeCUZHpW3is
|
Test report: in the world on an RTX 4080 16 GB with Tested
Not tested
AI use: Claude Code (Claude Sonnet 5.5 ported the two diffs, Claude Fable 5.2 ran the runs and wrote this). Follow-up, same day: at default waits the two PRs do not stop the removal. Three more world runs of the same tree with both PRs and without |
|
Two contributors checked independently and found that #2547 solves the same problem in a different way: #1607, group D131. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Independent test report under Wine/Proton (not native Windows) for head Tested
Retail title, release builds, 300 s per run (
(Put-off counts are the last power of two the log reported; dispatch counts are the last
What the change does in the title: with it, no dispatch was put off to the submit ( Not tested
AI use
|
With
XCL_PSO_WAIT_MSset, a dispatch whose pipeline is still being built is recorded at once instead of being put off to the submit (#2118). On an RTX 3050 withXCL_PSO_WAIT_MS=1,mainlost the device in 2 of 2 runs right after the retail title's world start; with this change the title presented to the end of every 240 s run (4 runs, 0 device removals). The runs that led here and what they show about the stop after the world start are in a comment on #2088: #2088 (comment)What changes
list_x::deferreturnsfalsewhenpso_async::waits_bounded(), soDispatchand a dispatchingExecuteIndirectwith an unbuilt pipeline take the path they took before D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind #2118: the bind waits at mostXCL_PSO_WAIT_MS, then the call is skipped as a stand-in's.XCL_PSO_WAIT_MS, so with a bound the put-off only moves the wait, and it costs a segment (a PC command list) per call. WithXCL_PSO_WAIT_MS=1the title's world start put off thousands of calls (the log's counter passed 8,192 in one run; up to 1,024 extra segments per list), the lists'ClosereturnedE_OUTOFMEMORY(thenE_FAIL), and the device was removed (0x887a0001, "invalid call").XCL_PSO_WAIT_MS=1.Closefailure.Files
hle/d3d12x/pso_async.rs:waits_bounded().hle/d3d12x/list_x.rs: the check at the top ofdefer.Tested
main08db802+ this PR (d5d694b):cargo test --release -p xcl --lib -- --test-threads=4: 1304 passed, 0 failed, 27 ignored.cargo clippy --release -p xcl --all-targets: 838 warnings on08db802and on this branch.XCL_NETWORK=0 XCL_PAGE_BUDGET_MB=4096; XCL and NVIDIA caches warm from earlier runs):XCL_PSO_WAIT_MSmaine1d84b7maine1d84b7Close→E_OUTOFMEMORY)e1d84b7(0a3d310, with a second change switched off byXCL_SKIPPED_COMPUTE_GUARD=0)e1d84b7(0a3d310), unset, after all the runs aboved5d694b)Closefailure)The default control was repeated last because driver blobs kept piling up over the runs: the title still stops with warm caches. Past that point, with
XCL_PSO_WAIT_MS=1, the title records 1,000–10,000 dispatches per 2 s but presents only about every 2 s; that slow phase is not explained here.Regression run
Default settings (
XCL_PSO_WAIT_MSunset, where this PR changes nothing), back to back,mainfirst, one run each; frame counts vary from run to run:main08db802:This PR (
d5d694b):Overlap
waits_bounded()follow the new default.mainnow.Not tested
XCL_PSO_WAIT_MSvalues other than 1; what the title draws with skipped dispatches; runs longer than 240 s.AI use
AI-assisted.