AMD: the fragment shuffle fallback on RADV too (RDNA1 flicker) #1893
Open
CleoMenezesJr wants to merge 1 commit from
CleoMenezesJr/fix/radv-fragment-shuffle-fallback into main
pull from: CleoMenezesJr/fix/radv-fragment-shuffle-fallback
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1893
Loading…
Reference in a new issue
No description provided.
Delete branch "CleoMenezesJr/fix/radv-fragment-shuffle-fallback"
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?
Builds on #1507 (its three commits are included until it is merged; only the last commit is new).
Problem
On an RX 5500 XT (RDNA1 / NAVI14, Mesa RADV, Fedora, no mesh shaders so the compute mesh fallback runs), objects such as the ladder of Link's house in Kokiri Forest flipped frame to frame between correct, speckled/dotted and glowing white while moving or turning the camera (the "moving" half of #1126 / #997).
Bisect
Switches set in the game folder's hookshot_env.txt, same spot each run:
Change
has_broken_spirv_fragment_shuffleis now on forVK_DRIVER_ID_MESA_RADVas well asVK_DRIVER_ID_AMD_PROPRIETARY.tests/test_amd_fragment_warp.pyis updated and passes.RX_VK_FRAG_SHUFFLE_FALLBACK=0still keeps native shuffles.Testing
Tested on RDNA1 only. Other RADV GPUs (RDNA2/3/4, APUs) are untested. Reports welcome; if it turns out RDNA1-specific, the check can be narrowed.
Thanks for the bisect table, it makes this easy to follow. The change itself is small and correct for what it does. One thing to be aware of on scope, which is what I checked for.
The flag is gated on the driver id only, so it now turns on for every RADV device, not just RDNA1. That is the only behaviour change: AMD_PROPRIETARY keeps what it had, AMD_OPEN_SOURCE (AMDVLK), NVIDIA, Intel and others are untouched, and the flag only feeds the shader profile and the program-cache stamp (vk_shader.cpp:1064), so RADV users retranslate once and nothing else moves.
RX_VK_FRAG_SHUFFLE_FALLBACK=0still forces native shuffles, so anyone who regresses has an escape hatch.On RDNA2/3/4 and GCN under RADV this swaps native fragment-stage shuffles for the broadcast/select path with no evidence they were broken there. It should be correct but is slower in fragment shaders that use shuffles, and nobody has measured it. Your bisect also shows
RX_VK_WARP64=0fixes it too, so the real trigger may be the 64-lane path from #1507 rather than shuffles as such. If an RDNA2+ tester reports a perf hit or no flicker to begin with, narrowing this to RDNA1 (e.g. by device name or by whether the 64-lane path is active for the stage) would be the follow-up. Fine to land as is given that you said so in the description.Small things: the PR says it builds on #1507, so it should merge after that; and no CI checks are reported on this head commit yet, so the test run is the local one you mention. The test update matches the source change.
The change is one line, and the test passes on current main (I merged it locally and ran tests/test_amd_fragment_warp.py). But two things changed since you bisected. #1657 merged after this was opened. It handles RDNA1's wave32/wave64 stages: unpinned stages now take subgroup_max, which was the RX 5500 XT family's problem, and that may be what fixed the ladder. Could you re-run the same spot on current main without this patch, with RX_VK_FRAG_SHUFFLE_FALLBACK unset? Second, this turns the fallback on for every RADV device, Steam Deck included. On RADV max_subgroup_size is 64, so each fragment shuffle becomes 64 broadcasts and selects (ShuffleAbsolute in emit_spirv_warp.cpp). That's the most-used Linux AMD tier, and the cost hasn't been measured. If the flicker is still there on main, I'd narrow the check to RDNA1 or bring a Deck frame-rate number. CI hasn't run on this branch.
No new commits since my last review, so this is just a follow-up to @Joey-Magnus's point, which changes what I said.
I wrote "fine to land as is", but #1657 (RDNA1 wave32/wave64 stage handling) merged after this was bisected, and it targets the same RX 5500 XT family. I agree with Joey: please re-run the same spot on current main without this patch and with
RX_VK_FRAG_SHUFFLE_FALLBACKunset. If the ladder no longer flickers, this PR isn't needed. If it still does, the RADV-wide gate should be narrowed to RDNA1 (or come with a Steam Deck frame-rate number), since the Deck is RADV too and would pay the 64-wide broadcast/select cost in every fragment shuffle.#1507 is merged now, so a rebase on main would leave just the one commit here. CI still hasn't run on this branch.