Repository navigation
D3D12.X: with XCL_LOOK_STATS=2 split a present's time on the submitter - #2955
thisguyStan wants to merge 1 commit into
Conversation
|
One accounting detail for the #2729 integration, checked at A standalone Windows x64 fixture compiled this head’s OpenAI Codex assisted with verification. |
On a 16 GB NVIDIA card in the world, presents took 93 % of the submitting thread's time (xcl-dev#2688), but a present was one entry with only its wait for the copy of the frame before apart, so where that time goes could not be told. Four more entries, timed with XCL_LOOK_STATS=2 only, as that wait is: - the wait for the present before it (PresentX's lock, the presenter's), - the copy (or composite) of the frame recorded and submitted, from the allocator's reset to its Signal, - the swap chain's Present, which DXGI holds while the frames before it are queued (a GPU-bound frame waits there), - the wait for a frame dump's copy (XCL_FRAME_DUMP, XCL_DUMP_TARGETS), up to 2 s each. With XCL_ACTIVITY they appear in "calls of the submitting thread (2 s)" next to "presents"; what a present spends besides them is the rest (the plane checks, the frame-rate line, the device-removal check). No change with the switch off. When the fallback presents on a submission (a title that does not call PresentX), its parts are timed inside ExecuteCommandLists rather than inside presents, as the copy wait already was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1a6ddc2 to
dd85383
Compare
|
Thanks, that's right: on the submission-driven fallback |
Targets
nvidia-dev(ecc0bb57). Part of #2688 (workstream 8).In the world, presents take most of the submitting thread's time on NVIDIA (93 % on an RTX 4080 in #2729's breakdown), but
calls of the submitting thread (2 s)shows a present as onepresentsentry with only its wait for frame N−2's copy (PresentCopyWait) apart, so where that time goes cannot be told. This adds four entries, timed only withXCL_LOOK_STATS=2like that wait:PRESENTX_LOCK,PRESENTER),Signal,Present, which DXGI holds while the frames before it are queued (a GPU-bound frame waits there),XCL_FRAME_DUMP,XCL_DUMP_TARGETS, up to 2 s).What a present spends besides them is the rest of
presents(the plane checks, the frame-rate line, the device-removal check). When the fallback presents on a submission (a title that does not call PresentX), these parts run insideExecuteCommandListsrather than insidepresents, as the copy wait already did; the doc comment on the entries says so. Diagnostics only: no change with the switch off. #2729 adds entries to the sameCalllist, and anis_sub_calllist of the calls that nest inside another (PresentCopyWaitamong them); the four new entries nest insidepresentstoo, so whichever lands second rebases and puts them there.What is in it
crates/xcl/src/hle/api_cost.rs:PresentLockWait,PresentRecord,PresentSwap,PresentDumpWaitand their names inCALLS.crates/xcl/src/hle/d3d12x/present.rs: the four timers around the two lock waits, the recording and submit,Present, and the frame-dump wait.Tested
rustc 1.100.0, DXC 1.9.2602.17; tests in debug, smokes in release.cargo test --workspace --no-fail-fast -- --test-threads=4ondd85383e: 1823 passed, 8 failed, 48 ignored.nvidia-devecc0bb57(run by name there):async_compute_pso_registers_real_pso_and_not_standin,console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays,texture_upload::tests::pieces_hold_the_texels_of_their_levels,split_compute_prefers_the_offline_whole_pipelineandtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(each in two test binaries).kernelx::tests::gpu_visible_fallback_memory_is_write_watchedpassed here; it failed once in an earlier full run on1a6ddc2c(assertion failed: !in_graphics_reservation(a)) and passes alone.scripts/smoke.ps1on1a6ddc2c(release; the same code asdd85383e) withXCL_LOOK_STATS=2,XCL_PREPARE=0, 60 s in the intro and menus (1354 frames, no device removal, no crash). Everycalls of the submitting thread (2 s)line (from 12 s on) has the new entries. From 14 s on, the parts add up to thepresentsentry within 0–4 ms per 2 s (the rest of a present); the first present (12 s) took 51 ms, of them 1 ms in the parts. From 26 s on, every 2 s:XCL_FRAME_DUMP): that entry is not printed.Regression run
60 s
scripts/smoke.ps1runs of the same title, all withXCL_PREPARE=0(as the othernvidia-devPRs' runs;e120925epredates the launch preparation and does not read it).mainis the commit before #2555 (e120925e), run on a copy of amain-only shader cache; thenvidia-devbase and this PR on copies of onenvidia-devshader cache.XCL_LOOK_STATSunset, so these show the switched-off path.main(e120925e):nvidia-devbase (ecc0bb57):This PR (
dd85383e):Not tested
XCL_FRAME_DUMP,XCL_DUMP_TARGETS) and the composite path of a present.AI use