s_memtime goes backwards on AMD's Windows driver too: #1383's narrow-clock check only matches RADV #1615

Closed
opened 2026-10-08 14:56:57 +00:00 by LeandroLP23 · 2 comments
LeandroLP23 commented 2026-10-08 14:56:57 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T14:56:57Z.


#1383 reads s_memtime from the device clock when the subgroup clock is 20 bits, but NarrowSubgroupClock only returns true for VK_DRIVER_ID_MESA_RADV with a (RADV <family>) device name. AMD's own Windows driver on an RDNA 3.5 GPU wraps the same way, but it isn't RADV and its device name carries no family, so it keeps the subgroup clock.

Radeon 860M (Krackan, device 0x1114), Windows driver 32.0.13058.8001, Windows 11, MinGW-w64 GCC 15.2.0, Release, main 9f4bd71c. The log shows Shader clock driver=1 narrowSubgroupClock=0.

Build agc_driver_shader_clock
main fails 49 of 160 runs, e.g. memtime: lane 0 went back from 1030876 to 1354
main, NarrowSubgroupClock also true for VK_DRIVER_ID_AMD_PROPRIETARY passes 100 of 100

1030876 is just under 2^20. The step back plus the wrap is 19,054 cycles, about the length of the test's 2000-step loop, so this is the 20-bit wrap from #985, not a random read.

The device name carries no family, so the check needs something other than the name for this driver:

  1. Treat every VK_DRIVER_ID_AMD_PROPRIETARY device as narrow. This is one line, but it also moves GFX10.1 and GFX12 GPUs to the 100 MHz device clock. I can't check whether their subgroup clock is 64 bits on this driver.
  2. Match GFX10.3 to GFX11.7 by PCI device ID for the non-RADV AMD drivers.

Which one would you take? I can send the PR and test it on this GPU.

Found with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5764014403 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1615). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T14:56:57Z. --- #1383 reads `s_memtime` from the device clock when the subgroup clock is 20 bits, but `NarrowSubgroupClock` only returns true for `VK_DRIVER_ID_MESA_RADV` with a `(RADV <family>)` device name. AMD's own Windows driver on an RDNA 3.5 GPU wraps the same way, but it isn't RADV and its device name carries no family, so it keeps the subgroup clock. Radeon 860M (Krackan, device 0x1114), Windows driver 32.0.13058.8001, Windows 11, MinGW-w64 GCC 15.2.0, Release, `main` 9f4bd71c. The log shows `Shader clock driver=1 narrowSubgroupClock=0`. | Build | `agc_driver_shader_clock` | |---|---| | `main` | fails 49 of 160 runs, e.g. `memtime: lane 0 went back from 1030876 to 1354` | | `main`, `NarrowSubgroupClock` also true for `VK_DRIVER_ID_AMD_PROPRIETARY` | passes 100 of 100 | 1030876 is just under 2^20. The step back plus the wrap is 19,054 cycles, about the length of the test's 2000-step loop, so this is the 20-bit wrap from #985, not a random read. The device name carries no family, so the check needs something other than the name for this driver: 1. Treat every `VK_DRIVER_ID_AMD_PROPRIETARY` device as narrow. This is one line, but it also moves GFX10.1 and GFX12 GPUs to the 100 MHz device clock. I can't check whether their subgroup clock is 64 bits on this driver. 2. Match GFX10.3 to GFX11.7 by PCI device ID for the non-RADV AMD drivers. Which one would you take? I can send the PR and test it on this GPU. Found with AI assistance (Claude Code).
fisherjoey commented 2026-10-08 16:37:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T16:37:07Z.


A data point for option 2's lower bound, from #985.

On RADV, a GFX10.3 part (Ryzen 5 7600X iGPU, RAPHAEL_MENDOCINO, gfx1036, Mesa 26.2.1) wraps the same way. On main before #1383, agc_driver_shader_clock failed on runs 7 and 14 of --repeat until-fail with memtime: lane 0 went back from 1043594 to 53661. 1043594 is just under 2^20. With #1383, 300 of 300 pass, and the log reads Shader clock driver=3 narrowSubgroupClock=1.

So GFX10.3 belongs in the narrow range for the hardware, whichever driver is used. I have no GFX10.1 or GFX12 device, so I can't check option 1's edges.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6064546361 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1615#issuecomment-6064546361). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T16:37:07Z. --- A data point for option 2's lower bound, from #985. On RADV, a GFX10.3 part (Ryzen 5 7600X iGPU, RAPHAEL_MENDOCINO, gfx1036, Mesa 26.2.1) wraps the same way. On `main` before #1383, `agc_driver_shader_clock` failed on runs 7 and 14 of `--repeat until-fail` with `memtime: lane 0 went back from 1043594 to 53661`. 1043594 is just under 2^20. With #1383, 300 of 300 pass, and the log reads `Shader clock driver=3 narrowSubgroupClock=1`. So GFX10.3 belongs in the narrow range for the hardware, whichever driver is used. I have no GFX10.1 or GFX12 device, so I can't check option 1's edges.
joelfernandes23 commented 2026-10-09 13:02:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by joelfernandes23 on 2026-10-09T13:02:16Z.


I can also reproduce this clock-wrap signature on an RX 7900 XT (RDNA 3) with AMD's Windows driver.

Environment: Windows 11 Pro 10.0.26200, Ryzen 7 7700X, 32 GB RAM, Radeon RX 7900 XT device 0x744c, driver 32.0.31041.1004, Vulkan 1.4.349. WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH r7, Release, BUILD_TESTING=ON, SPIRV-Tools validation OFF. ANYPS5_GPU=7900 XT and ANYPS5_REQUIRE_VULKAN=1.

On unchanged main d70b89989473ba1f6ae13e44e079e67f1f8a44b0:

Shader clock driver=1 narrowSubgroupClock=0
AGC graphics: memtime: lane 0 went back from 1031570 to 4600

The initial smoke test and main full suite passed agc_driver_shader_clock; a later focused run failed, so it is intermittent. While separately validating #1473, the clock test also failed in its full run and after nine successful repetitions. Restoring and rebuilding unchanged main reproduced it independently of #1473.

Command for the focused check:

ctest --test-dir build -R '^agc_driver_shader_clock$' --repeat until-fail:30 --parallel 1 --output-on-failure --timeout 120

I subsequently extended PR #1632's device-ID detection to measured ID 0x744c, using its existing device-clock fallback. The GPU clock test passed 100/100 consecutive runs and the verbose log reports narrowSubgroupClock=1. Full CTest with that extension: 505 passed, 1 failed, 1 skipped; the remaining failure is the separate comparison issue #825. A regression fails without the new ID and passes with it. The reference-clock timing approximation is documented; no title timing or other 0x744c boards were tested. I can share the small extension patch with #1632's author.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081421447 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1615#issuecomment-6081421447). Originally posted by [joelfernandes23](https://github.com/joelfernandes23) on 2026-10-09T13:02:16Z. --- I can also reproduce this clock-wrap signature on an RX 7900 XT (RDNA 3) with AMD's Windows driver. Environment: Windows 11 Pro 10.0.26200, Ryzen 7 7700X, 32 GB RAM, Radeon RX 7900 XT device 0x744c, driver 32.0.31041.1004, Vulkan 1.4.349. WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH r7, Release, BUILD_TESTING=ON, SPIRV-Tools validation OFF. ANYPS5_GPU=7900 XT and ANYPS5_REQUIRE_VULKAN=1. On unchanged main `d70b89989473ba1f6ae13e44e079e67f1f8a44b0`: ``` Shader clock driver=1 narrowSubgroupClock=0 AGC graphics: memtime: lane 0 went back from 1031570 to 4600 ``` The initial smoke test and main full suite passed `agc_driver_shader_clock`; a later focused run failed, so it is intermittent. While separately validating #1473, the clock test also failed in its full run and after nine successful repetitions. Restoring and rebuilding unchanged main reproduced it independently of #1473. Command for the focused check: ``` ctest --test-dir build -R '^agc_driver_shader_clock$' --repeat until-fail:30 --parallel 1 --output-on-failure --timeout 120 ``` I subsequently extended PR #1632's device-ID detection to measured ID 0x744c, using its existing device-clock fallback. The GPU clock test passed 100/100 consecutive runs and the verbose log reports `narrowSubgroupClock=1`. Full CTest with that extension: 505 passed, 1 failed, 1 skipped; the remaining failure is the separate comparison issue #825. A regression fails without the new ID and passes with it. The reference-clock timing approximation is documented; no title timing or other 0x744c boards were tested. I can share the small extension patch with #1632's author.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#1615
No description provided.