perf(vk): submits are not batched on a discrete RDNA 4 card on RADV #1893
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1893
Loading…
Reference in a new issue
No description provided.
Delete branch "Molier/Longshot:perf/radv-rdna4-no-batch"
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 discrete RDNA 4 card under RADV, batching the replay's queue submits makes the frame about a quarter longer. While submits are held the GPU has short idle gaps, and the card's clock management reads them as low load: the shader clock sits near 1.6-1.7 GHz instead of 2.3-2.6 GHz. With each submit sent at once the same work finishes much sooner. This PR leaves
batch_submitsoff forrdna4() && discrete()on RADV. Every other RADV card keeps today's rule: the Radeon 8060S of issue 413, where batching took the submit from 70 to 6 ms a frame, and the RDNA 2/3 cards nobody has measured either way.To see it on
main: an RX 9070 XT on Linux,hf48rununcapped, with and withoutRX_VK_BATCH=0.Read first:
gpu/vk/device_policy.h(batch_submits, its comment and the one-line rule),tests/test_device_policy.py(the newRX 9070 XT, RADVfixture).Testing
Tested: CachyOS (kernel 7.4), Ryzen 7 5800X, RX 9070 XT, Mesa 26.2.6 RADV; renderer built from
main@89c3d21eand from this PR in the same way and swapped into one game folder. The game boots and plays throughhf48runand the heavy route (Hyrule Field, Market, Castle) with the log sayingbatched submits offon this PR andononmain. Picture: I saw nothing wrong in play, but have no pixel comparison. Shots from the two arms are not of the same frame, and two runs of the same arm already differ in 38 % of pixels, so a diff says nothing.tests/test_device_policy.pyandtests/test_switch_table.pypass; the new fixture fails onmain(RX 9070 XT, RADV: batch_submits is 1, expected off).Still to test:
RX_VK_BATCH=0against the default onhf48run, to see whether the rule should cover RDNA 2/3 too (by hand, or @Beanstalk on an RDNA 2/3 runner).discrete()); nothing to do.Measurements
Verdict: throughput +33 % (median frame 17.0 -> 12.8 ms on hf48run); hitch time on the capped heavy route unchanged.
Setup: CachyOS, Ryzen 7 5800X, RX 9070 XT, Mesa 26.2.6 RADV; 2560x1440, render scale 1, no upscaler, fullscreen.
hf48rununcapped, 3 interleaved runs a side after one warm-up each; heavy route capped at 60, 2 interleaved runs a side. GPU busy and the currentpp_dpm_sclklevel sampled at 10 Hz during the hf48run runs.89c3d21e8f6712b1The same A/B as a switch on the official nightly-612 (3 runs a side,
RX_VK_BATCH=0against the default) gave 62 -> 81 fps, with clock medians of 1715 against 2589 MHz. For comparison, holding amdgpu's peak power state (RX_VK_GPU_CLOCK=peak, the Steam Deck's rule) pins this card at about 2.48 GHz and gives 71 fps; with batching off as well it is 79, slightly below batching off alone. So the clock hold is not the fix on a desktop card.The work per frame is not identical: in an earlier pair of runs, batching off had the same frames, presents and submits, but 5.8 % fewer draws and 8 % fewer dispatches, and the game waited on GPU results about half as long (9 % against 22 % of the frame). The likely reason is that occlusion results arrive sooner, which culls more. The clock difference accounts for the rest: GPU time per frame was 8.8 against 11.8 ms.
Risks
RX_VK_BATCH=1turns it back on.RX_VK_BATCH=1is the A/B.Checklist
Ready for review
main; the title is a Conventional Commit.tests/test_device_policy.pyandtests/test_switch_table.pypass (the fullmise run testnot run here).main.third_party/untouched; nothing GPL-incompatible.When it applies
RX_VK_BATCHrow ingpu/vk/switches.defsays the new default, and Measurements has the numbers that chose it.Assisted-by:trailer.Ready to merge
Possibly related, for context:
rdna4()classification.Recommendation: Request changes. The RX 9070 XT shows a substantial throughput gain, but the new default also applies to other discrete RDNA 4 cards without evidence that the extra unbatched submit cost is safe there. The reported runs also omit the low-frame-rate and tail-frame-time measurements needed to rule out worse pacing.
Disabling batching improves the measured RX 9070 XT route and keeps the existing override, with a small, focused policy change. Before applying that default across the whole discrete RDNA 4 family, either narrow it to the measured card or measure representative affected cards and CPU-bound settings; also report average FPS, 1% lows and p99 frame time on the target and heavy routes.
Does it help: Yes on the tested RX 9070 XT: three interleaved runs show median frame times of 16.3–17.6 ms before versus 12.4–13.1 ms after, and median-per-run FPS of 56.9–61.2 versus 76.4–80.4. Heavy-route time in frames >=40 ms is 10.9 versus 11.0 s pooled, but 1% lows and p99 are not reported; benefit and cost on other affected RDNA 4 cards are unproven.
Other systems: RADV discrete RDNA 4 alone changes; integrated RADV, RDNA 2/3, Windows AMD, NVIDIA, Intel and Steam Deck retain their policy. Earlier submits change occlusion-result timing and increase queue-submit calls; the author saw no visual issue in play, but has no matched-frame comparison and CPU/pacing costs are not established across affected setups.
Switches: RX_VK_BATCH defaults off instead of on for discrete RDNA 4 on RADV; on for other non-GCN RADV, off elsewhere. The table is updated and RX_VK_BATCH=1 restores batching. The broader new default is not yet supported by measurements beyond one card.
Reviewed:
8f6712b15cagainst89c3d21ea1: Read the full diff, changed policy rule and surrounding facts, fixture and switch row, PR description and comments, base AGENTS.md, CONTRIBUTING.md, standards, measurement skill and PR template. Tool output truncated the full device_policy.h, switches.def and test_device_policy.py; their changed sections were read but their remaining contents were only skimmed. Searched batch policy consumers and open overlapping PRs; did not run code or tests. docs/review-checklist.md does not exist at base.; nothing run (a code review).Checked and fine:
Blocking (to change before merge)
Testing: Author reports in-game RX 9070 XT runs and passing device-policy and switch-table tests; full mise run test and CI are pending. No independent execution in this review.
Overlaps and merge order: Open #1839 changes DeviceFacts::rdna4() to include PCI IDs, expanding this new batching exception to additional devices if both merge. Coordinate and re-evaluate the combined default and tests whichever merges second; no direct duplicate found.
Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.
@ -550,3 +552,3 @@// measured on one card// (corrected: GCN by the one definition, radv_gcn. To go back: f.radv() && !(f.sg32_stages == 0 && f.subgroup_size > 32))p.batch_submits = f.radv() && !f.radv_gcn();p.batch_submits = f.radv() && !f.radv_gcn() && !(f.rdna4() && f.discrete());This changes the default for every discrete RDNA 4 RADV card, but the A/B covers one 9070 XT/CPU/driver. On a different card or CPU-bound system, the extra queue submits could outweigh the gain. Please narrow the rule to measured hardware or measure representative affected configurations before applying it family-wide.
Could the A/B also report average FPS, 1% lows and median/p99 frame times for both the target and heavy routes? The pooled >=40 ms totals do not show whether an individual run or the tail got worse when submits were unbatched.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.