Repository navigation
D3D12.X: a draw does not wait for a graphics pipeline still being built - #1798
isaacwingate wants to merge 1 commit into
Conversation
…till being built)
pso_async means a graphics pipeline still being built to go on with its stand-in, which draws nothing, while a worker builds it; only compute pipelines are waited for (a skipped dispatch would leave its outputs unwritten). But graphics_bound and ExecuteIndirect called resolve_wait, which waits for the build - and builds it on the title's thread when no worker has started it. With lazy pipelines that is every graphics pipeline's first draw. On an NVIDIA GPU the retail title of xcl-dev#505 had its threads held 1 - 5 s per draw in the driver's compiler as its world loaded: 25 graphics binds, 33.2 s in all within 25 s (counted with xcl-dev#899's log), and its hang watchdog ended the run. A test report on xcl-dev#889 (RTX 4080) found a title thread held in bind::execute_indirect -> resolve_wait at the abort. Draws and ExecuteIndirect now take their pipeline with resolve_for_bind: a graphics one still being built goes to the workers and the draw uses its stand-in (ExecuteIndirect skips, as it already did for a pending one); a compute one is waited for as before. With this, the same world load logged no graphics wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
141df97 to
55e7beb
Compare
|
Test report for #1798 on Linux / Wine / RADV, with the retail title of #505. Tested at head 141df97; the rebased head 55e7beb has the same patch. Without #1798, our longest earlier run (main + the local picks below, without #1798) ended with the title thread in Tested
Not tested
Written by Claude Code (Claude Opus 5.5) from the runs above. |
|
Instrumented retail comparison — RTX 5070 Ti / Proton The last logged wait snapshots show 20 graphics bind waits, 5,037 ms total on the base, and zero on the PR. The PR continued to log compute waits. The base completed the 150 s window, and the PR incurred a write access violation in Tested
The base exited Linux scope peaks were 15.17 and 16.00 GiB, with zero OOM kills. The runs are a locally instrumented comparison, and the early exit left the PR run without a completed smoke block. AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, checked the logs, and drafted this report. |
|
I repeated the retail loading run from my earlier report with and without the #684 fix. The control reproduced the same
The compute times are cumulative across threads and the runs reached different points. Neither scope recorded an OOM kill. Peak scope memory was 15.71 GiB without #684 and 15.07 GiB with it. Both builds used RTX 5070 Ti (16 GB, driver 620.73.04), Ryzen 7 9700X, 32 GB DDR5, CachyOS 7.3.5-2-cachyos, Proton Experimental AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, symbolized the crash, and drafted this report. |
|
Linux (Wine + vkd3d-proton) + NVIDIA test of Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, Tested
The count line is printed when one of its counters reaches a power of two, so 40 and 128 are floors (128 means 128 to 255), and the warning for a skipped In the 100 s run with it the loading pictures at 40, 60, 66 and 74 s were whole (frames kept), the last of them after 23 draws had used a stand-in. I kept no frames of the runs without it. The skipped A third pair of 100 s runs was slower from the start (A at 22.2 and 18.4 s): presents stopped at 90.2 s with it and 92.2 s without, and neither run had the burst of dispatches or a skipped Read
Not tested: past the point where presents stop, where a skipped call would show; frames of the runs without it; the preload of #690 on; #1652 and #267, which change the same wait; the rest of the suite; AMD and Intel. AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the tests and the six runs, compared the logs and frames and wrote this report. Posted without review by a person: the account owner was away and reads replies later. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
World-loading run of this PR on a 12 GB 32-lane NVIDIA card, where Setup: RTX 3060 12 GB (581.80), Windows 11 26200, 64 GB RAM, release, retail title. A pressed every 4 s from 20 s.
This PR's head
So on this card the draws no longer wait, and the title gets past the point where Written with Claude Code (Claude Opus 5.5) from runs on this machine. |
|
Code review on
Next step to unblock merge: Please rebase onto current |
|
Update: \Build and test (Windows, no GPU)\ is now green on \55e7beb\ (\CLEAN). One quick AMD confirmation on exact head \55e7beb\ (the prior RADV run was on \141df97) is all that remains before merge. |
|
Empirical verification on the Intel Arc A770 for the draw path with pending graphics pipelines.
Tested
19 failing tests25 SKIPPED messages from the full workspace runNot tested
AI use
|
pso_asyncmeans a graphics pipeline still being built to go on with its stand-in, which draws nothing, while a worker builds it; only compute pipelines are waited for (a skipped dispatch would leave its outputs unwritten). Butgraphics_boundandExecuteIndirectcalledresolve_wait, which waits for the build – and builds it on the title's thread when no worker has started it. With lazy pipelines that is every graphics pipeline's first draw. They now take their pipeline withresolve_for_bind, which waits for compute pipelines only. Part of #505.Related: #1652 (stacked on #1274, 10 files) also stops draws waiting, among other changes; #267 bounds the draw wait to 4 s. This is the small change on its own.
What is in it
crates/xcl/src/hle/d3d12x/bind.rs:pso_for_draw(=pso_async::resolve_for_bind) for draws (graphics_bound) andExecuteIndirect; a pending graphics pipeline's draw uses its stand-in, a pending one's ExecuteIndirect is skipped as before; compute is waited for as before. TheXCL_TRACE_FRAMElookup no longer waits either. Test:a_draw_does_not_wait_for_a_graphics_pipeline_still_being_built– fails without the change (the draw waited the build's 1.5 s and got the real pipeline).mainc4d37be: the only conflict was this test landing next toexecute_indirect_reads_the_arguments_written_before_it(both kept);execute_indirect'sfresh_indirect_argumentsis unaffected, both tests pass.Tested
cargo test --workspace -- --test-threads=4on 55e7beb: 960 passed, 0 failed, 43 ignored (SKIPPED:no wave64for the wave64 forms of the newlower/lower_dxilGPU tests,gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware; three wave32 per-lane cases off16_programs_on_the_gpu/f32_programs_on_the_gpurefused;heap_window_out_of_memory_falls_back_to_the_switch_form– no heap windows;pso_measurement_compiles_an_exact_synthetic_record– cannot disable the driver cache)XCL_NETWORK=0, with D3D12.X: log how long a bind waits for a pipeline still being built #899's wait log, through its world load (on main 1c87b1d, before this was rebased): without this, 25 graphics binds waited 33.2 s in all within 25 s as the world loaded (1 – 5 s each, mostly for a worker's build), next to the compute waits; with it, the same world load logged 0 graphics waits. On D3D12.X: compute pipelines are built ahead of their first bind #889 an RTX 4080 report found a title thread held inbind::execute_indirect→resolve_waitat the watchdog's abort.Regression run
Both with
XCL_COHERENT_MB=4095(without it the window is 512 MB or 4 GB depending on the commit free at the start, #284), one after the other.main:
PR:
Not tested
AI use
🤖 Generated with Claude Code