Repository navigation
fix(agc): run the device startup probes as RDNA when a PS4 title has selected GCN shaders - #20156
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Test report, NVIDIA on Windows: no regressions; the new
Single run each. AI-assisted (Claude Code). |
|
Windows + NVIDIA (Blackwell) run of head Setup: Windows 11 Pro, NVIDIA GeForce RTX 5070 Ti, driver 621.01, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 UCRT, Release,
AI-assisted: yes |
…selected GCN shaders A PS4 title selects GCN shader decoding on its first Gnm submit, and the Vulkan device can open after that. The device's f32 flush, f32 denormal preserve and f16 conversion probes are RDNA programs, so they were decoded as GCN and the device failed to open with 'unknown GCN instruction family'. The probes now run with GCN decoding turned off and the selection is restored after them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> # Conflicts: # core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
5ce3be4 to
3f69349
Compare
|
Linux and NVIDIA validation-layer run of the current head, since the existing layer runs are on Windows. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor The pattern is the one from the description: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^agc_driver_(gcn|float|f16|f32|device|two_device)' -V
No new AI-assisted: yes (Claude Code) |
|
Bloodborne (CUSA00900 01.09) on Windows: this pull request fixes its startup stop. Before this pull request, Bloodborne aborts about 2.5 s in with
The title with this PR: it gets past the probes, runs its first compute dispatch and opens AI-assisted: yes. Claude Code ran the merge, the build, the tests and the title run, and drafted this comment. The numbers come from runs on this machine. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The startup probes are scoped to RDNA decoding with restoration on normal exit and exceptions, and the new test checks that GCN selection is restored.
What I ran
Reviewed head 951474295f5980af1730d161bf6ca6f287093920. I read the prepared description, commits, manifest, diff, the full added test, and the changed source ranges in VulkanDevice.cpp; repository files were read through repo_read.py. No tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | No concrete defect found |
| Tests | not run | Results in the description are author reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The changed test registration/build configuration and other callers of the process-wide GCN selection were not inspected. VulkanDevice.cpp was too large for the prepared files, so only lines 230–250 and 2770–2865 were read. files.json was unavailable through the reader; the manifest lists three changed files, two included in the review bundle and one excluded as too large. Test results and reported title behavior were not independently verified.
To get this to a good state
Nothing is required.
|
Windows + AMD run; I found no AMD run in the description or in the comments. Head Setup: Windows 11 25H2 (build 26200), AMD Radeon 760M integrated graphics (
AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above). |
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
What
A PS4 title selects GCN shader decoding for the whole process (
ShaderRecompiler::SetGcnGuestShaders(true)) on its first Gnm submit. When the Vulkan device opens after that, its three startup probes fail: the f32 flush, f32 denormal preserve and f16 conversion probes are RDNA programs built intolibSceAgcDriver, and they were decoded as GCN. The device constructor throws and the title stops:0xd54b000eis word 10 ofMixedCodeinFloatFlushProbe.cpp, an RDNA VOP3 instruction.VulkanDevice's constructor now turns GCN decoding off for the three probes and restores the previous selection after them, also when a probe throws.agc_driver_gcn_device_startup_probesselects GCN first, then opens a device, and checks that the selection is still on afterwards.docs/dev/debt/libSceAgcDriver.mdrecords the remaining limit: the selection is process-wide, so a guest shader that another thread recompiles during the probes of a second device would be decoded as RDNA in that time.No shader, pipeline or draw path changes; only which decoder the three probe programs go through.
Tested
Windows 11 Pro 10.0.26300, i5-6600K, NVIDIA GeForce RTX 3070 (driver 621.01), WinLibs GCC 16.2.0, CMake 4.4.4, Ninja, Release,
BUILD_TESTING=ON, onmaina44e050e82.New test
agc_driver_gcn_device_startup_probes: passes on this branch. With only theVulkanDevice.cppchange reverted and the test kept, it fails with the message above.Related tests: the tests matching
^agc_driver_(gcn|float|f16|f32|device|two_device)include the float flush and f16 conversion probe tests, the GCN execution tests and the two-device tests.Validation layer comparison, same machine and GPU, Vulkan SDK 1.4.363.1 (
VK_LAYER_KHRONOS_validation), withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layerandctest --test-dir build -R "^agc_driver_(gcn|float|f16|f32|device|two_device)" -V, each side rebuilt from its own source:Insert instance layer "VK_LAYER_KHRONOS_validation"was not found but was requestedVUID-maina44e050e82The change adds no validation errors; neither log has any.
A title: a PS4 game dump (CUSA01709 01.02) converted with
relinker --windows. It needs local changes that are not in this PR to get this far (fix(tools): read a PS4 executable's dynamic table from its library data segment in unwrap_self #19959 to unwrap, a relinker change equivalent to fix(relinker): import undefined global symbols with non-default visibility #17105, a stand-in for fix(relinker): load libSceGnmDriver.prx for a libSceGnmDriver_padebug dependency #18087, the exports of feat(libSceGnmDriver): share mode-independent command writers #17711 and feat(libSceGnmDriver): export sceGnmDrawInitDefaultHardwareState200 from the regular driver #19990, a relaxed fixed-address check insceKernelMapDirectMemory, and a compute queue stand-in in place of feat(libSceGnmDriver): run PS4 compute queue rings on AGC compute queues #18546). With those, and without this change, it stops at device creation with the message above. With this change the device opens, the probes report ([float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ ...)), and the title goes on toAGC graphics: PS4 color target fast clear (CMASK) is not implemented.python tools/check_conventions.py --base origin/mainpasses.python tools/pr_overlap.py --branchfailed closed (exit 2): it could not confirm overlap for open pull requests that conflict withmain. I compared the 43 of them that touchVulkanDevice.cppby their diffs; none changes the probes or the GCN selection (for feat(agc): look up table images at run time through a device image table on the GPU heap (APS5_GPU_PATH) #7642 and feat(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508, whose diffs are too large to fetch whole, by theirVulkanDevice.cpppatch from the API). The others share onlydocs/dev/debt/libSceAgcDriver.md.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code