Repository navigation
D3D12.X: with bounded pipeline waits, dispatches are not put off to the submit - #2581
Open
brothernog wants to merge 1 commit into
Open
brothernog wants to merge 1 commit into
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.
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
raylitebull
added a commit
that referenced
this pull request
Nov 26, 2026
…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)
Contributor
|
Independent dual-PC NVIDIA full-workspace test report on clean head Tested
Not tested
AI use
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.