Measurements on RTX 5070 Ti + 9800X3D: in-place memory, barriers, submit-thread profile #2614
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Reference
No Branch/Tag specified
main
github-pr/3295
beta
docs/changelog-3483-3500
github-pr/3294
github-pr/2975
github-pr/2815
feat/gate-driver-start
feat/skip-pipelines-release
perf/lazy-compare
perf/mwaitx-wait
test/prio-ceiling-main
fix/ab-cpu-stdout
fix/gate-old-crashes
diag/ab-cpu
test/main-0312
github-pr/3291
diag/indirect-clamp-census
feat/barrier-enhanced
perf/texture-frame-ceiling
perf/dstorage-threads
fix/console-queue-dma-tables
fix/port-descriptors-record-parts
fix/frame-waits-fence
fix/console-sampler-words
fix/graphics-userdata-spill
fix/xg-reserved-layout-rotation
fix/barrier-console-flags
fix/switches-wait-test-child
test/list-value-waits
test/lot-gxdk-0412
fix/bvh-compacted-size
docs/i18n-quickstarts
feat/native-pipeline-slots
fix/clippy-leonida-gpu
fix/list-value-producers
fix/descriptor-page-straddle
fix/xmem-low-window
fix/ffx-jitter-never-zero
fix/run-stdout-closed
github-pr/2892
github-pr/2896
feat/warm-save-every
github-pr/2980
github-pr/2994
github-pr/3005
github-pr/3010
github-pr/3136
github-pr/3303
github-pr/3220
github-pr/3143
github-pr/3330
github-pr/3226
github-pr/3187
carry/3395
github-pr/2946
github-pr/2947
github-pr/2945
github-pr/2983
github-pr/3001
github-pr/3372
github-pr/3128
github-pr/3296
github-pr/2588
github-pr/3119
github-pr/3378
fix/crash-diagnostics
feat/dlss-mip-bias
fix/retired-out-of-order
fix/dxr-postbuild-barrier
fix/amd-relay-default
fix/removed-report-wait
feat/heap-twin
feat/vram-margin
github-pr/2472
github-pr/3123
github-pr/3088
assets/annonce-v1
github-pr/2794
github-pr/3300
github-pr/3304
github-pr/3308
github-pr/3367
github-pr/3369
fix/launcher-dlss-diagnostics
github-pr/3269
github-pr/2957
github-pr/3205
fix/crash-zero-guard
github-pr/3185
github-pr/3099
github-pr/3104
github-pr/3348
github-pr/3379
github-pr/3377
perf/darner-title-priority-ceiling
github-pr/3376
gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github-pr/3373
github-pr/3368
github-pr/3198
gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github-pr/3346
github-pr/3375
github-pr/2958
github-pr/3151
github-pr/3307
github-pr/3278
github-pr/3374
fix/runtime-test-conservative-fixtures
github-pr/3366
ci/shard-semantic-linux
github-pr/3354
docs/fg-limit-fps-switch
github-pr/3365
fix/read-file-hard-link
github-pr/3364
fix/book-slot-heap-never-read
github-pr/3361
github-pr/3263
github-pr/3360
github-pr/3353
github-pr/3331
fix/alias-later-queued-submissions
github-pr/3352
github-pr/3228
github-pr/3349
claude/gallant-sagan-aamatr
github-pr/3200
github-pr/3132
github-pr/3323
github-pr/3332
github-pr/3340
github-pr/3311
github-pr/3334
github-pr/3297
github-pr/3256
github-pr/2567
github-pr/2851
d3d12/agility-sdk-621
github-pr/3164
github-pr/3114
github-pr/3050
github-pr/3113
github-pr/3326
github-pr/3144
github-pr/2642
github-pr/3072
github-pr/2789
github-pr/2643
github-pr/3009
github-pr/3035
github-pr/3031
github-pr/2686
github-pr/2834
github-pr/3321
github-pr/3325
github-pr/3290
github-pr/3324
github-pr/3130
claude/fervent-curie-m19lnr
github-pr/3309
github-pr/3305
github-pr/3306
github-pr/3302
github-pr/3301
github-pr/3345
github-pr/3211
github-pr/3027
github-pr/3286
github-pr/3235
github-pr/3265
github-pr/3275
codex/skip-no-hit-ray-passes
github-pr/2823
github-pr/2911
github-pr/3262
github-pr/3125
github-pr/3206
github-pr/3250
github-pr/3238
github-pr/3188
github-pr/2952
github-pr/3217
github-pr/3168
t3/preserve-fsr-sdk-restart-path
t3/propagate-host-failure-hresult
github-pr/3209
t3/launcher-custom-parameters
github-pr/3207
github-pr/3183
github-pr/3160
github-pr/3201
ci/less-to-run
github-pr/2930
github-pr/2797
github-pr/2999
perf/native-compute-shader-forms
github-pr/3191
github-pr/3011
github-pr/3019
github-pr/2996
gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
claude/blissful-franklin-ukp7ag
github-pr/3141
github-pr/3156
github-pr/3150
github-pr/3153
github-pr/3163
github-pr/3142
github-pr/3139
github-pr/2841
github-pr/3069
github-pr/3098
github-pr/3107
github-pr/3071
github-pr/2774
github-pr/2889
github-pr/3075
github-pr/2661
github-pr/3064
github-pr/3054
github-pr/3049
github-pr/2855
github-pr/2943
github-pr/3016
github-pr/2887
github-pr/3006
github-pr/3003
github-pr/2993
notes/card-time-and-plant-flicker
github-pr/2989
feat/vulkan-rs
github-pr/2985
github-pr/2951
github-pr/2982
github-pr/752
github-pr/792
github-pr/2877
github-pr/2654
github-pr/2893
github-pr/2948
github-pr/2944
github-pr/2919
github-pr/2915
archive/ci/less-to-run/20261202T1121Z
github-pr/2800
github-pr/2822
github-pr/2833
github-pr/2840
github-pr/2831
github-pr/2832
github-pr/2801
github-pr/2890
github-pr/2891
github-pr/2664
github-pr/2807
rt-call-trace
github-pr/2755
perf/ahead-split
github-pr/2587
github-pr/2698
github-pr/2609
github-pr/3219
docs/readme-runtime-proposal
github-pr/2017
github-pr/1741
github-pr/1667
codex/coord-claim-check-20261124-7e48
v1.1.0
v1.0.1
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy#2614
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
On a CPU-strong PC with a PCIe 5.0 x16 card, mandy stands at about 31 fps (Series S, 720p), and the frame is set by the submitting thread, not the card. Neither title memory in place nor dropping the title's barrier waits helps here:
LEONIDA_BARRIER_TEST=groupsandbothleave the frame and the card's busy share where they were (29 to 31 fps, 69%).Setup
7b907de52(diag build, DLSS)play-nvidia.ps1defaults: Series S, 720p to 1080p by DLSSe95020b2…5a08993Each test is one start from the same autosave, standing with no input for about 3 minutes; frame generation and game actions off (
LEONIDA_FRAME_GEN=1,LEONIDA_GAME_ACTIONS=0). Figures are medians of the 5 s frame lines after the first 100 s. One run per setting, so treat differences under 2 fps as noise.Title memory in place
All three in-place forms lose badly here, as they did on the RTX 4060 Ti: four times the link width does not change it, so the card's wait is on round trips, not bandwidth.
LEONIDA_PORT_CONSTANTS=1LEONIDA_INPLACE=1(+_PROBE=1)LEONIDA_INPLACE=2Prep falls by 2 to 5 ms in every form, but the card becomes the wall at once. Port 1 placed the whole 185 MB region (one region, one 174 MB buffer). In place 1 held 73 to 76 windows (344 to 360 MB) and turned down 525 to 712 as view memory. The probe's census found 294 sections of 4,679 MB, all
SEC_RESERVEand so refused as heaps.Barriers
Leaving the waits out entirely gains nothing on this PC, so narrowing them cannot either.
LEONIDA_BARRIER_TEST=groupsLEONIDA_BARRIER_TEST=bothThe frame line counts about 885 to 895 waits a frame for the title's barrier groups standing. With them gone the picture breaks (mostly white, as expected) and the card's busy share does not move.
We also wrote an experiment that keeps the groups' own scope (one global enhanced barrier from the union of their
SyncBeforeto theirSyncAfter, and none whereSyncBeforeis none). It built cleanly on7b907de52but was not run, since the result above bounds it.Submitting thread profile
The submitting thread is about 89% busy and no one cost owns it; the driver and the write tracking are the largest pieces.
LEONIDA_PROFILE=100,160,2,…withLEONIDA_PROFILE_ONLY=leonida-submit, standing: 19,533 samples ofleonida-submit, symbolized against the build's PDB. Shares are inclusive, so they overlap.Host::submit←send_late←execute_partsshadow::wide/wide_help(refresh_spans 16.5%, refresh_textures 3.0%, flush 4.2%)nvwgf2umxundersubmit(6.9%),Close(4.4%), D3D12Core and win32u (3.3%)Shadow::update_free→watch::writeswatch::kernel_written←ask_run←ask_ahead←ask_onceRwLock::write_contended←watch::guards←writes←update_freeCondvar::wait←queue::ahead_of_framehost::stale_under_flights→merge_under_writescopy_mapped+leonida_safe_copy_atThe frame line agrees: about 6,400 refreshes a frame, about 5,400 of them known to copy nothing; prep 23 to 24 ms; the card 69% busy and the copy-back thread waiting 15 ms a frame for it. The title's submitting thread runs about 11.5 ms of its own between submissions, so its own work plus ours is the frame.
Lead: the constant ring's allocator
Every fresh per-draw constant buffer and buffer-data upload comes from one chunked bump allocator, so the title could tell us which bytes it wrote instead of us finding them. Read in Ghidra from 1.0.2.1 (addresses at the image's preferred base, starting from D33T0X/Native-Runtime's back-end map, ledger X-605 to X-610):
144d9efd0144d9f510/144d9f200memcpythe CPU's bytes in, write the view (GPU address = ring GPU base + the pointer's offset from the ring's CPU base)144d9f3e0144d9f450, then144d9f420144d9f4501400049b0and retires the old one (144da9f80)144d9f420140006b10Seven call sites use
144d9f3e0(14555e570,144d9f200,144d9f510,1400378c0,144e51a90,14248d6d0,1404f4210). Native-Runtime's notes give the game's ring chunk as 131,072 bytes × 216; if this is that ring, it is 27 MB, the size of the 32-bit heap's0x8404part. That match is an inference, not checked.The idea: hook the chunk hand-out (
1400049b0) or the allocation (144d9f450) and note each new range as written by the title's CPU, so the ring needs no write watch, guards or compare. By the profile above, the tracking this could remove for the ring is at most part of the 10 to 15% inwatch::writesandkernel_written: an estimate of 2 to 4 ms a frame, not measured.Other notes
02384a60fda6f2d0(CS_DefragHeap_ComputeRelocations),ae0deeafe219c15c,5e3dd99e0f067aee,407eca669212d400,18d957e62926ed3e. The precompile's "217 do not translate" counts every container in the package.LEONIDA_PIPELINE_WAIT_MS=10000the first run in the world stood still for minutes while about 3,500 shaders and 3,200 pipelines were made; players coming from VIctory-NVIDIA read it as a hang. Pointing them to the F1 menu's SHADER WAIT MS "0 SKIP" for the first run, or saying so at launch, would help.Your four results land on a runtime that already has open items in exactly those places, so it is worth saying which ones so the numbers are not re-derived.
First, which runtime this is (checked, not assumed):
LEONIDA_BARRIER_TESTandplay-nvidia.ps1live ind3d12/(
d3d12/crates/leonida-gpu/src/copystat.rs,indirect.rs,list.rs). So your report is about the Rust runtime, not thegta6rtone, and theitems below are the Rust crate's.
1. "In place is 2 to 4 times slower." That is the shape of a family already claimed and being worked in
d3d12/:RS-SEND-DIRECT- a byte the title writes into a copy that lives on the card is copied twice on the CPU;RS-SEND-POOL-TRIM- the per-submission send memory rounds every buffer to a power of two;RS-FETCH-SHRINK- the buffers card pieces are fetched into grow to the largest fetch and never shrink;RS-INPLACE-FREEandRS-INPLACE-PROTECT- what blocks title memory in place (the title'sVirtualFreefails with error 87, itsVirtualProtectfails).Your "99 to 100 % card busy at 7-14 fps" is the measurement those items need to be judged against, and PCIe 5.0 x16 is the useful part: it removes
the bandwidth explanation and leaves the CPU-side copies.
2. "Barriers are not the wall." A negative result with two knob settings behind it is worth as much as a positive one, and it saves a slot
somebody would otherwise spend there. If you can state the two recipes exactly (
LEONIDA_BARRIER_TEST=groupsand=both, same start, sameautosave, same 3 minutes), that becomes a citable measurement rather than an impression.
3. The submitting thread at ~25 of 32 ms is the number I would chase next, and
RS-EXACT-WAIT,RS-VALUE-WAITS-RELEASEandRS-TITLE-ALLOC-WATCHare the claimed items that touch what a submission does before it reaches the driver.4. Your ring-allocator lead - per-draw constants from one chunked ring - is the kind of thing that needs its own item rather than a sentence at
the end of a report. If you can name the hook and what it showed, someone can claim it.
One thing I cannot do from here: confirm any of this against your numbers, because I have no Rust-runtime build on a 50-series card. What I can say is
that the report is specific enough to be acted on, which is more than most, and that its two most useful properties are the PCIe 5.0 link and the
barrier result.
Written with an AI assistant.
Thanks. Answers in order.
Recipes. Every run is the same command from a fresh process, only the switch changes:
with
<switch>empty (baseline),LEONIDA_BARRIER_TEST = 'groups',LEONIDA_BARRIER_TEST = 'both',LEONIDA_PORT_CONSTANTS = '1',LEONIDA_INPLACE = '1'; LEONIDA_INPLACE_PROBE = '1', orLEONIDA_INPLACE = '2'. Build7b907de52(diag, DLSS). The baseline and the three in-place runs were made back to back within about 25 minutes; the two barrier runs about 90 minutes later, from the same build. Every run loaded the title's autosave at the same spot, and after a short while without input the title's idle camera took over and went round its views (the draw counts cycle between about 5,500, 7,500 and 11,500 a frame), so the runs measure the same scenes. Each run: load in, no input for about 3 minutes, close. The figures are medians of the 5 s frame lines, leaving out the first 20 lines (about 100 s, the load). One run per setting.One correction on in place. The data does not point at CPU-side copies. In all three in-place runs the submitting thread's prep went down (23.2 ms to 18.0 / 19.4 / 20.9 ms) while the card went from about 70% to 99-100% busy. So the frame got longer on the card, not on the CPU: with PCIe 5.0 x16 ruling out bandwidth, that reads as the card waiting on round trips to title memory over the bus. I'd be glad to rerun any of the RS- items against this when they land.
Submitting thread. One more data point for RS-TITLE-ALLOC-WATCH and the rest:
LEONIDA_WRITE_SITEScut the title's write faults from about 1,860 to 970 a frame (about 32 to 23 ms of all threads' time) with no change in the frame (29.8 to 29.4 fps), so on this PC those faults are not on the critical path.Ring allocator. Fair point: there is no hook yet, only a reading of the code in Ghidra (the table in the issue:
144d9f3e0->144d9f450, chunks from1400049b0). The write-sites result also makes me think it would save less here than I first estimated. I'll open it as its own issue once there is a hook and a measurement behind it, rather than a reading alone.