fix(agc): name the RELEASE_MEM system counter instead of GDS data #7911
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7911"
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?
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T13:21:16Z.
What
A
RELEASE_MEMwithDATA_SEL = 4was refused as "GDS RELEASE_MEM data is not implemented". In amdgpu's GFX10 packet header, 4 is "send 64bit sys counter value"; GDS data is 5, as in Mesa'sEOP_DATA_SEL_GDS. The validator now gives each its own refusal:DATA_SEL = 4keeps throwing, because the frequency and epoch of the console's system counter are not known. Writing the 100 MHz countDATA_SEL = 3uses would be a guess. The debt file now records the gap, and notes that an older KFD header names 4 a CP performance counter instead.A PS4 title running through #6977's PS4 path writes
DATA_SEL = 4at the end of each frame, which is where the misleading message showed up (#7198).Tested
Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release.
agc_driver_pm4has a newtestReleaseMemDataSelects: data selects 0 to 3 validate, 4 throws the system-counter message, 5 the GDS message, and 6 and 7 the reserved one. It passes 3 of 3 withANYPS5_GPU=Inteland withANYPS5_GPU=AMD.agc_driver_pm4_replayandagc_driver_pm4_replay_toolpass.tools/check_conventions.pypasses.Validation: Khronos validation layer 1.4.363 (Vulkan SDK),
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,ctest -R <tests> -V, onmaincded26c68and on this PR merged into it, on both GPUs (AMD driver cache emptied first). Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS. Tests:agc_driver_pm4,agc_driver_pm4_replayandagc_driver_pm4_replay_tool. No validation message on either side; these tests open no Vulkan device.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
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T13:38:25Z.
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.
main)docs/dev/debt/libSceAgcDriver.mdL19-20Some 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.
docs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Pm4.cppcore/libs/prx/libSceAgcDriver/Execution/src/Pm4.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/Pm4.cppcore/libs/prx/libSceAgcDriver/tests/Pm4.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-20T02:19:20Z.
On the PS4 path the rate of
DATA_SEL 4is known, in case it helps decide what #6977 writes there.PerfCounter, matching the older KFD name your debt entry mentions, and writes the GPU core clock count: the TSC scaled tosceGnmGetGpuCoreClockFrequency(), which it returns as 800 MHz, 911 MHz in Neo mode (src/video_core/amdgpu/pm4_cmds.h,src/core/libraries/gnmdriver/gnmdriver.cpp).sceKernelIsNeoMode() ? 911000000 : 800000000, so only the rate matters to it, not the epoch.The PS5 counter is a separate question, so keeping the refusal there makes sense to me. Once this PR settles the naming, I can send the PS4-only part to Get-fix's branch.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T11:16:17Z.
Merged
main3e91c8edfto clear the conflict; the head is now123768abc. The conflict was two new entries at the same place indocs/dev/debt/libSceAgcDriver.md: this PR'sRELEASE_MEMsystem counter entry and #7869's point and line polygon modes entry. Both are kept.Pm4.cppandtests/Pm4.cppmerged without conflicts.All 16
agc_driver_pm4*tests pass on Windows (RX 9070 XT), andtools/check_conventions.py --base origin/mainpasses.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-21T11:26:06Z.
Measured on the console now, as a follow-up to my note above. PS4 Pro, FW 10.71, with the measuring app in base mode (
sceKernelIsNeoMode()= 0): a homebrew Gnm submission of theEVENT_WRITE_EOPpackets Gang Beasts writes (c0044700 00038504), DATA_SEL 4 and DATA_SEL 3 back to back, timed against the TSC over 124 s. The crash I mentioned earlier was in my own submission code; this one ran 13 submissions without a fault.sceKernelGetTscFrequency(), 1 594 013 629 Hz here), 0.25% under the 800 MHz thatsceGnmGetGpuCoreClockFrequency()reports and that Gang Beasts divides by. It read zero about 2 s before the measuring app started, not at power-on.So an 800 MHz count for GCN guests matches the hardware to 0.25%, and starting it near zero is as close as any epoch gets. This is the PS4 counter only; it says nothing about the PS5 one this PR keeps refusing.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-21T16:26:30Z.
@ntamas94 thank you for measuring this on the console. https://github.com/Get-fix/AnyPS5/pull/19 applies it on #6977's branch.
A PS4 (GCN) guest's
DATA_SEL 4now writes an 800 MHz count of the host's steady clock. The count starts at zero when libSceAgcDriver loads. A PS5 guest'sDATA_SEL 4still throws, as this PR does on main.Your measurement is linked and credited in the
RELEASE_MEMentry ofdocs/dev/debt/libSceAgcDriver.md. That entry also records two things the PR leaves for later: the Neo rate, which is not measured, and PS4DATA_SEL 3as TSC / 16 in 40 bits.