RGP on RADV: workaround for "failed to set new pstate (-16)", plus RX 9070 memory-placement measurements #9

Closed
opened 2026-11-30 15:53:03 +00:00 by github-bot · 10 comments
Owner

@⁠grykom on GitHub · 2026-11-30 15:48 UTC · original

Measured findings from a related code base (VIctory-xmem with its patched RADV, not VKtory) on an RX 9070 (GFX1201, 16 GB), Ryzen 7 7800X3D, 32 GB, Linux 7.3, Mesa/RADV 26.3.1. Posting because gpu-time.md and the roadmap mention a missing full-frame RGP capture and the placement design step 4.

1. RGP capture blocked by failed to set new pstate. (-16): workaround

In our case the cause was a second Vulkan device in the same process (DXVK and vkd3d each create one): the first device takes the stable pstate, the second gets EBUSY in radv_device_acquire_performance_counters(), and radv_sqtt_init() returns false, so that device runs without SQTT and the trigger writes nothing for it. Patch for RGP use only (src/amd/vulkan/tools/radv_sqtt.c), the stable pstate is still held by the first device:

    if (radv_device_acquire_performance_counters(device, 1000000000ull /* 1s */) != VK_SUCCESS)
-      return false;
+      fprintf(stderr, "radv: pstate busy (held by another device), SQTT enabled anyway\n");

With it, full-frame captures work (1080p, 128 MiB/SE, VICTORY_PREPARE_PIPELINES=0 because SQTT changes the driver hash). Things that did not work: RADV_PROFILE_PSTATE=none (RADV cancels the capture as a hang condition), forcing profile_peak via sysfs (also -16). Clocks in the capture sit at the profile_peak level (~2020 MHz), so times are inflated ×~1.5. A 4K capture once ran the machine into a global OOM (SQTT plus title memory in 32 GB); 1080p was fine.

2. Instruction timing on GFX12: does it work for anyone?

With RADV_THREAD_TRACE_INSTRUCTION_TIMING=true the file has 4 × ~80 MB SQTT data (no overflow) and a 190 MB code object database, but RGP 2.7.1.13 shows "Detailed data unavailable" / "No wavefronts analyzed" for every event, also a 1335-wave dispatch. What the capture does show in the prison cell: the most expensive 5 % of events take 38 % of the frame, and the top ones are tiny compute dispatches (4–17 groups of 32 threads, 5–7 waves) lasting 400–660 µs each, dozens of them overlapping (same shader); one DispatchIndirect(6,1,1) keeps running ~450 µs after occupancy has dropped to ~0. Looks latency-bound, in line with xlcost.md.

3. The 185 MB 32-bit heap is read by the CPU every frame

The title reserves 185 MB below 4 GiB (protection 0x1, kind 0x42000, flags 0x7) backed by one physical pool (flags 0x280). Our census (bound ranges per draw/dispatch, an upper bound) has one 174 MB UAV range in it bound ~84 000 times per frame, far above anything else; 56 % of its 64 KiB pages are CPU-touched. Moving that pool to VRAM before its first use: 36 → 8.5 fps in the prison cell (+89 ms/frame) while our own code read only 4 MiB through the pool windows, so it is the title's CPU reading it. memory-placement.md lists a 192 MB 0x280 pool as CPU-only (probably the same one): it looks like a candidate for the replica scheme, not a move.

4. Main pool (6236 MB, 0x380): CPU-touched vs never touched, per physical page

Aliases merged, a page counts as touched if any alias was materialized for the CPU; prison cell, 10 s window:
1988 MB never CPU-touched, 4248 MB touched. All 2064 MB of GPU-only (0x801) views also have CPU-cached aliases. For comparison, moving the 710 MB WC pool alone to VRAM gave −4.0 ms (+14.7 %) in the cell, ABBA, one switch, at 1440p.

Happy to run something specific on the 9070.

**@⁠grykom** on GitHub · 2026-11-30 15:48 UTC · [original](https://github.com/vktory6/VKtory/issues/9) Measured findings from a related code base (VIctory-xmem with its patched RADV, not VKtory) on an RX 9070 (GFX1201, 16 GB), Ryzen 7 7800X3D, 32 GB, Linux 7.3, Mesa/RADV 26.3.1. Posting because `gpu-time.md` and the roadmap mention a missing full-frame RGP capture and the placement design step 4. **1. RGP capture blocked by `failed to set new pstate. (-16)`: workaround** In our case the cause was a second Vulkan device in the same process (DXVK and vkd3d each create one): the first device takes the stable pstate, the second gets EBUSY in `radv_device_acquire_performance_counters()`, and `radv_sqtt_init()` returns false, so that device runs without SQTT and the trigger writes nothing for it. Patch for RGP use only (`src/amd/vulkan/tools/radv_sqtt.c`), the stable pstate is still held by the first device: ```diff if (radv_device_acquire_performance_counters(device, 1000000000ull /* 1s */) != VK_SUCCESS) - return false; + fprintf(stderr, "radv: pstate busy (held by another device), SQTT enabled anyway\n"); ``` With it, full-frame captures work (1080p, 128 MiB/SE, `VICTORY_PREPARE_PIPELINES=0` because SQTT changes the driver hash). Things that did not work: `RADV_PROFILE_PSTATE=none` (RADV cancels the capture as a hang condition), forcing `profile_peak` via sysfs (also -16). Clocks in the capture sit at the profile_peak level (~2020 MHz), so times are inflated ×~1.5. A 4K capture once ran the machine into a global OOM (SQTT plus title memory in 32 GB); 1080p was fine. **2. Instruction timing on GFX12: does it work for anyone?** With `RADV_THREAD_TRACE_INSTRUCTION_TIMING=true` the file has 4 × ~80 MB SQTT data (no overflow) and a 190 MB code object database, but RGP 2.7.1.13 shows "Detailed data unavailable" / "No wavefronts analyzed" for every event, also a 1335-wave dispatch. What the capture does show in the prison cell: the most expensive 5 % of events take 38 % of the frame, and the top ones are tiny compute dispatches (4–17 groups of 32 threads, 5–7 waves) lasting 400–660 µs each, dozens of them overlapping (same shader); one `DispatchIndirect(6,1,1)` keeps running ~450 µs after occupancy has dropped to ~0. Looks latency-bound, in line with `xlcost.md`. **3. The 185 MB 32-bit heap is read by the CPU every frame** The title reserves 185 MB below 4 GiB (`protection 0x1, kind 0x42000, flags 0x7`) backed by one physical pool (`flags 0x280`). Our census (bound ranges per draw/dispatch, an upper bound) has one 174 MB UAV range in it bound ~84 000 times per frame, far above anything else; 56 % of its 64 KiB pages are CPU-touched. Moving that pool to VRAM before its first use: 36 → 8.5 fps in the prison cell (+89 ms/frame) while our own code read only 4 MiB through the pool windows, so it is the title's CPU reading it. `memory-placement.md` lists a 192 MB `0x280` pool as CPU-only (probably the same one): it looks like a candidate for the replica scheme, not a move. **4. Main pool (6236 MB, `0x380`): CPU-touched vs never touched, per physical page** Aliases merged, a page counts as touched if any alias was materialized for the CPU; prison cell, 10 s window: **1988 MB never CPU-touched, 4248 MB touched.** All 2064 MB of GPU-only (`0x801`) views also have CPU-cached aliases. For comparison, moving the 710 MB WC pool alone to VRAM gave −4.0 ms (+14.7 %) in the cell, ABBA, one switch, at 1440p. Happy to run something specific on the 9070.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 15:53:03 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-11-30 22:36 UTC · original

Thanks, this is useful, and the numbers fit what we have.

1. RGP and the pstate EBUSY. We hit the same failed to set new pstate. (-16) on an older build that still had the
D3D12 host device next to vkback (docs/learnings/gpu-time.md, "RGP capture on the merged build failed"). That path is
gone now (see "Recently done" in docs/TASKS.md), so vkback should be the only Vulkan device in the process and stock
RADV may capture again; nobody has re-checked yet. We won't ship a RADV patch, but if it is still needed I'd like to add
your workaround to gpu-time.md with credit, since it is the simplest way to get a full frame. One more thing for
anyone trying: MESA_VK_TRACE also turns off vkback's pipeline cache, so trigger well after the world shows.

2. Instruction timing on GFX12. No data from us; our captures ran with RADV_THREAD_TRACE_INSTRUCTION_TIMING=false.
The pattern you describe (small compute dispatches of a few waves running 400-660 us, overlapping, latency-bound)
matches what the translation-cost ranking points at: waterfall loops on by-address loads and register spills in the
large RT programs (docs/learnings/xlcost.md, and "GPU time: ray tracing and GI compute" / "Register spills and
waterfall loops in RT programs" in docs/TASKS.md). If you can post the shader hashes of the top few dispatches, we
can check them against the ranking.

3. The 185 MB 32-bit heap. Agreed. Our census sees that 0x280 pool only through the CPU space
(docs/learnings/memory-placement.md, view-space census), so by the placement rules it stays in GTT, and your
36 -> 8.5 fps result is the cost of breaking that rule. A replica only pays if the GPU really reads a lot of it; a
bound range is an upper bound, so 84 000 binds of one 174 MB range may be one wide raw view over little actual traffic.
Can your census tell whether that range starts at the pool's base? A raw UAV view starting at a heap base is our best
lead for the rare title crash ("Title crash: upload-chunk node list" in docs/TASKS.md).

4. Main pool, touched vs untouched. 1988 MB never CPU-touched is the kind of number the planned
migrate-on-first-touch scheme needs (pages start in VRAM, move to GTT on the first CPU touch;
memory-placement.md, "Refinement", and "Memory placement: VRAM vs GTT" in docs/TASKS.md). Your -4.0 ms for the WC
pool alone fits our pair (-7.7 ms for WC pool plus WC heaps together); both are in VRAM by default now.

Your measurements come from a different code base, so we'll re-measure before relying on them. If you want to run
something on the 9070, the most useful would be the same untouched/touched split or a stock-RADV RGP capture on current
VKtory main.

**@⁠vktory6** on GitHub · 2026-11-30 22:36 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7294068459) Thanks, this is useful, and the numbers fit what we have. **1. RGP and the pstate EBUSY.** We hit the same `failed to set new pstate. (-16)` on an older build that still had the D3D12 host device next to vkback (`docs/learnings/gpu-time.md`, "RGP capture on the merged build failed"). That path is gone now (see "Recently done" in `docs/TASKS.md`), so vkback should be the only Vulkan device in the process and stock RADV may capture again; nobody has re-checked yet. We won't ship a RADV patch, but if it is still needed I'd like to add your workaround to `gpu-time.md` with credit, since it is the simplest way to get a full frame. One more thing for anyone trying: `MESA_VK_TRACE` also turns off vkback's pipeline cache, so trigger well after the world shows. **2. Instruction timing on GFX12.** No data from us; our captures ran with `RADV_THREAD_TRACE_INSTRUCTION_TIMING=false`. The pattern you describe (small compute dispatches of a few waves running 400-660 us, overlapping, latency-bound) matches what the translation-cost ranking points at: waterfall loops on by-address loads and register spills in the large RT programs (`docs/learnings/xlcost.md`, and "GPU time: ray tracing and GI compute" / "Register spills and waterfall loops in RT programs" in `docs/TASKS.md`). If you can post the shader hashes of the top few dispatches, we can check them against the ranking. **3. The 185 MB 32-bit heap.** Agreed. Our census sees that `0x280` pool only through the CPU space (`docs/learnings/memory-placement.md`, view-space census), so by the placement rules it stays in GTT, and your 36 -> 8.5 fps result is the cost of breaking that rule. A replica only pays if the GPU really reads a lot of it; a bound range is an upper bound, so 84 000 binds of one 174 MB range may be one wide raw view over little actual traffic. Can your census tell whether that range starts at the pool's base? A raw UAV view starting at a heap base is our best lead for the rare title crash ("Title crash: upload-chunk node list" in `docs/TASKS.md`). **4. Main pool, touched vs untouched.** 1988 MB never CPU-touched is the kind of number the planned migrate-on-first-touch scheme needs (pages start in VRAM, move to GTT on the first CPU touch; `memory-placement.md`, "Refinement", and "Memory placement: VRAM vs GTT" in `docs/TASKS.md`). Your -4.0 ms for the WC pool alone fits our pair (-7.7 ms for WC pool plus WC heaps together); both are in VRAM by default now. Your measurements come from a different code base, so we'll re-measure before relying on them. If you want to run something on the 9070, the most useful would be the same untouched/touched split or a stock-RADV RGP capture on current VKtory main.
Author
Owner

@⁠vktory6 on GitHub · 2026-11-30 22:40 UTC · original

I created a task based on your report (RGP retry and your memory placement numbers): github.com/vktory6/VKtory@c44a6a3b97

**@⁠vktory6** on GitHub · 2026-11-30 22:40 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7294155310) I created a task based on your report (RGP retry and your memory placement numbers): https://github.com/vktory6/VKtory/commit/c44a6a3b9763e960f6753942d5dbdd0531674823
Author
Owner

@⁠grykom on GitHub · 2026-12-01 06:36 UTC · original

Thanks for the detailed answer and for the task.

1. pstate / RGP. Sure, feel free to put the workaround in gpu-time.md. Good to know the second device is gone on your side; then stock RADV should be enough, and the patch only matters for builds that still create two devices (DXVK + vkd3d in our case). Thanks for the MESA_VK_TRACE note.

2. Shader hashes. Will do: the capture is on the Linux machine, I'll post the top few in a follow-up. They come from our translation (VIctory-xmem, ca97da2), so they may not match your ranking one to one.

3. The 174 MB range. It does not start at the base. In title addresses the reservation is 0x400000 + 0xb900000 (185 MiB) and the range is 0xf00000 + 0xae00000: it starts 11 MiB (0xb00000) above the reservation base and ends exactly at its end. The pool is the same size as the reservation, so it is most likely mapped linearly, but I have not checked the pool offset itself. Of the range's 2,784 pages (64 KiB), 56.5 % were materialized for the CPU and 43.5 % never were. Agreed that ~84k binds/frame of one wide view says little about real traffic: our census counts bound ranges, not bytes read.

4. An update from our side: the "untouched pages to VRAM" idea is now in VIctory-xmem main (lobomfz/VIctory-xmem#40), as a lower-priority candidate source in its page residency (pages the card was shown and the CPU never touched), moved for real, not copied. In the same scene the copy version gave more (+9.5 % over no paging at 1.6 GB, while the real move with this source added only +1–3 % over plain residency); our unverified guess is CPU reads through the pool windows, which a copy keeps in RAM.

**@⁠grykom** on GitHub · 2026-12-01 06:36 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7303063072) Thanks for the detailed answer and for the task. **1. pstate / RGP.** Sure, feel free to put the workaround in `gpu-time.md`. Good to know the second device is gone on your side; then stock RADV should be enough, and the patch only matters for builds that still create two devices (DXVK + vkd3d in our case). Thanks for the `MESA_VK_TRACE` note. **2. Shader hashes.** Will do: the capture is on the Linux machine, I'll post the top few in a follow-up. They come from our translation (VIctory-xmem, `ca97da2`), so they may not match your ranking one to one. **3. The 174 MB range.** It does not start at the base. In title addresses the reservation is `0x400000 + 0xb900000` (185 MiB) and the range is `0xf00000 + 0xae00000`: it starts 11 MiB (`0xb00000`) above the reservation base and ends exactly at its end. The pool is the same size as the reservation, so it is most likely mapped linearly, but I have not checked the pool offset itself. Of the range's 2,784 pages (64 KiB), 56.5 % were materialized for the CPU and 43.5 % never were. Agreed that ~84k binds/frame of one wide view says little about real traffic: our census counts bound ranges, not bytes read. **4.** An update from our side: the "untouched pages to VRAM" idea is now in VIctory-xmem `main` (lobomfz/VIctory-xmem#40), as a lower-priority candidate source in its page residency (pages the card was shown and the CPU never touched), moved for real, not copied. In the same scene the copy version gave more (+9.5 % over no paging at 1.6 GB, while the real move with this source added only +1–3 % over plain residency); our unverified guess is CPU reads through the pool windows, which a copy keeps in RAM.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 07:35 UTC · original

Thanks! It's in docs/learnings/gpu-time.md now (github.com/vktory6/VKtory@5169307): the stock settings that work with one device (confirmed on RDNA2 in #35), plus your patch for processes that still hold two devices.

**@⁠vktory6** on GitHub · 2026-12-01 07:35 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7304234177) Thanks! It's in `docs/learnings/gpu-time.md` now (https://github.com/vktory6/VKtory/commit/5169307): the stock settings that work with one device (confirmed on RDNA2 in #35), plus your patch for processes that still hold two devices.
Author
Owner

@⁠grykom on GitHub · 2026-12-01 13:28 UTC · original

Follow-up with the shader hashes (from the RGP capture of 30.11: VIctory-xmem ca97da2, 1080p, prison cell, RX 9070).

How they were mapped: RGP only knows RADV pipeline hashes. I matched each code object in the capture to our log line
for the same pipeline by creation time (both on CLOCK_MONOTONIC, constant offset, ±0.1 ms; 2287 of 2667 pipelines
unambiguous), then took the title's entry name from the console container, the same way your names.py does. So the
8-hex suffixes below should be directly comparable with your ranking. (Side note for anyone reading RADV captures:
the "API shader hash" RGP shows is the address of the radv_shader object, not a hash.)

Top pipelines by summed event duration in that frame (events overlap, so this is not wall time; frame 72 ms under SQTT):

RGP duration events avg VGPR title shader(s)
1636 us 208 31 us 12 MS_VS_DepthSkin + PS_LinearDepthOpaque c7e5b2fa
1598 us 175 9 us 48 (compute, not a title shader: no title pipeline created at that moment; most likely one of our own)
1416 us 110 38 us 48 MS_VS_TransformD + PS_DeferredTextured c5fd36bb
1367 us 47 29 us 48 CS_BatchCullPreSkinnedMeshlets_ParaboloidShadows b589f3cd
1187 us 32 66 us 60 MS_VS_TransformD + PS_DeferredTextured c5fd36bb (other variant)
1039 us 264 358 us 96 CS_PedStandardSkinning_8 15f19d85
994 us 44 299 us 96 CS_PedStandardSkinning_5 15f19d85
946 us 46 37 us 12 MSNC_VS_LinearDepthSkin + PS_LinearDepth f1f2249c
855 us 95 120 us 72 CSComputeSkinningDefaultVelocity 1c34db0a
803 us 6 206 us 96 CSComputeSkinningSecMotionVelocity 1c34db0a
773 us 4 363 us 96 CSComputeSkinningPedBlendShapesSecMotionVelocity 1c34db0a

The "small dispatches of a few waves running 400-660 us" from my first report match the ped skinning programs: dozens
of Dispatch(4..17,1,1) with 32-thread groups, VGPR 96, overlapping (checked by shape for the top events; the
skinning pipelines above are the ones with that VGPR count, event count and average duration). Sizes: CS_PedStandardSkinning_8 is a 15.8 KB
console container and 164 KB of RADV code; _5 is 6.4 KB -> 65 KB; PedBlendShapesSecMotionVelocity 25.3 KB -> 103 KB.
(Container size includes metadata, so this is not an instruction ratio; your xlcost counts would be the real one.)
Instruction timing did not decode on GFX12 with RGP 2.7.1, so I can't say yet whether it's waterfall loops on
by-address loads or something else.

The single most expensive event (658 us) is a DispatchIndirect(6,1,1) at VGPR 168 inside the title's CopyBatch
region; vkd3d labels it [CS 77cba1163353178b], which I could not map back to a container.

**@⁠grykom** on GitHub · 2026-12-01 13:28 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7312670672) Follow-up with the shader hashes (from the RGP capture of 30.11: VIctory-xmem `ca97da2`, 1080p, prison cell, RX 9070). How they were mapped: RGP only knows RADV pipeline hashes. I matched each code object in the capture to our log line for the same pipeline by creation time (both on CLOCK_MONOTONIC, constant offset, ±0.1 ms; 2287 of 2667 pipelines unambiguous), then took the title's entry name from the console container, the same way your `names.py` does. So the 8-hex suffixes below should be directly comparable with your ranking. (Side note for anyone reading RADV captures: the "API shader hash" RGP shows is the address of the `radv_shader` object, not a hash.) Top pipelines by summed event duration in that frame (events overlap, so this is not wall time; frame 72 ms under SQTT): | RGP duration | events | avg | VGPR | title shader(s) | |---|---|---|---|---| | 1636 us | 208 | 31 us | 12 | MS_VS_DepthSkin + PS_LinearDepthOpaque `c7e5b2fa` | | 1598 us | 175 | 9 us | 48 | (compute, not a title shader: no title pipeline created at that moment; most likely one of our own) | | 1416 us | 110 | 38 us | 48 | MS_VS_TransformD + PS_DeferredTextured `c5fd36bb` | | 1367 us | 47 | 29 us | 48 | CS_BatchCullPreSkinnedMeshlets_ParaboloidShadows `b589f3cd` | | 1187 us | 32 | 66 us | 60 | MS_VS_TransformD + PS_DeferredTextured `c5fd36bb` (other variant) | | **1039 us** | **264** | **358 us** | 96 | **CS_PedStandardSkinning_8 `15f19d85`** | | **994 us** | 44 | **299 us** | 96 | **CS_PedStandardSkinning_5 `15f19d85`** | | 946 us | 46 | 37 us | 12 | MSNC_VS_LinearDepthSkin + PS_LinearDepth `f1f2249c` | | 855 us | 95 | 120 us | 72 | CSComputeSkinningDefaultVelocity `1c34db0a` | | 803 us | 6 | 206 us | 96 | CSComputeSkinningSecMotionVelocity `1c34db0a` | | 773 us | 4 | 363 us | 96 | CSComputeSkinningPedBlendShapesSecMotionVelocity `1c34db0a` | The "small dispatches of a few waves running 400-660 us" from my first report match the ped skinning programs: dozens of `Dispatch(4..17,1,1)` with 32-thread groups, VGPR 96, overlapping (checked by shape for the top events; the skinning pipelines above are the ones with that VGPR count, event count and average duration). Sizes: CS_PedStandardSkinning_8 is a 15.8 KB console container and 164 KB of RADV code; _5 is 6.4 KB -> 65 KB; PedBlendShapesSecMotionVelocity 25.3 KB -> 103 KB. (Container size includes metadata, so this is not an instruction ratio; your `xlcost` counts would be the real one.) Instruction timing did not decode on GFX12 with RGP 2.7.1, so I can't say yet whether it's waterfall loops on by-address loads or something else. The single most expensive event (658 us) is a `DispatchIndirect(6,1,1)` at VGPR 168 inside the title's CopyBatch region; vkd3d labels it `[CS 77cba1163353178b]`, which I could not map back to a container.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 13:51 UTC · original

Thanks, that's a careful mapping (and good to know about RGP's "API shader hash").

The interesting part for us is the skinning programs: small dispatches running 300-360 us each at 96 VGPRs. None of them is in the top 10 of our translation-cost ranking, which is dominated by the ray-tracing and BVH programs, so either our translation handles them better or our ranking misses them. I've added the lead, with the two suffixes and the 168-VGPR DispatchIndirect in the CopyBatch region, to the shader-cost task so it gets checked against our ranking and a profiled prison frame: github.com/vktory6/VKtory@1cd59d5

**@⁠vktory6** on GitHub · 2026-12-01 13:51 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7313295720) Thanks, that's a careful mapping (and good to know about RGP's "API shader hash"). The interesting part for us is the skinning programs: small dispatches running 300-360 us each at 96 VGPRs. None of them is in the top 10 of our translation-cost ranking, which is dominated by the ray-tracing and BVH programs, so either our translation handles them better or our ranking misses them. I've added the lead, with the two suffixes and the 168-VGPR `DispatchIndirect` in the CopyBatch region, to the shader-cost task so it gets checked against our ranking and a profiled prison frame: https://github.com/vktory6/VKtory/commit/1cd59d5
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 10:09 UTC · original

A stock-RADV RGP capture on current main is now available (this is the step you asked for in #9).

  • Build: main d59b4f8, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Mesa 26.3.1, house save rt3, Series X, GE-Proton11-16, warm store, ray tracing on.
  • Settings per docs/learnings/gpu-time.md: MESA_VK_TRACE=rgp, MESA_VK_TRACE_TRIGGER=<run>/trigger.rgp (touched at 180 s, well into the world), RADV_THREAD_TRACE_INSTRUCTION_TIMING=true. No RADV patch, no second Vulkan device.
  • Result: RGP capture saved to '/tmp/victory.exe_2026.12.02_11.08.37_frame4043.rgp', 692 MiB, moved to /home/shlong/Documents/VKtory-capture/rgp-main/victory.exe_2026.12.02_11.08.37_frame4043.rgp (local evidence only; not attaching game-derived data). No failed to set new pstate (-16), no device loss; the run continued to its timeout. As documented, MESA_VK_TRACE disables vkback's pipeline cache, so the seconds before the trigger are not representative.
  • RADV resized the trace buffer several times up to 512 MiB before saving; that is normal here and the file is complete enough for RGP to open locally.

Logs: /home/shlong/Documents/VKtory-capture/rgp-main/20261202-110536/. I have no RGP viewer on this machine, so I have not inspected the capture's shader timeline; if someone wants a specific frame/pipeline extracted, point me at it and I can re-arm with a different trigger point.

**@⁠TheRifai** on GitHub · 2026-12-02 10:09 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7342055278) A stock-RADV RGP capture on current main is now available (this is the step you asked for in #9). - Build: main `d59b4f8`, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Mesa 26.3.1, house save `rt3`, Series X, GE-Proton11-16, warm store, ray tracing on. - Settings per `docs/learnings/gpu-time.md`: `MESA_VK_TRACE=rgp`, `MESA_VK_TRACE_TRIGGER=<run>/trigger.rgp` (touched at 180 s, well into the world), `RADV_THREAD_TRACE_INSTRUCTION_TIMING=true`. No RADV patch, no second Vulkan device. - Result: `RGP capture saved to '/tmp/victory.exe_2026.12.02_11.08.37_frame4043.rgp'`, 692 MiB, moved to `/home/shlong/Documents/VKtory-capture/rgp-main/victory.exe_2026.12.02_11.08.37_frame4043.rgp` (local evidence only; not attaching game-derived data). No `failed to set new pstate (-16)`, no device loss; the run continued to its timeout. As documented, `MESA_VK_TRACE` disables vkback's pipeline cache, so the seconds before the trigger are not representative. - RADV resized the trace buffer several times up to 512 MiB before saving; that is normal here and the file is complete enough for RGP to open locally. Logs: `/home/shlong/Documents/VKtory-capture/rgp-main/20261202-110536/`. I have no RGP viewer on this machine, so I have not inspected the capture's shader timeline; if someone wants a specific frame/pipeline extracted, point me at it and I can re-arm with a different trigger point.
Author
Owner

@⁠grykom on GitHub · 2026-12-02 11:09 UTC · original

@⁠TheRifai
Thanks, that's a useful capture. It also confirms the pstate -16 error is gone on stock RADV now that the second device is gone.

You don't need a Windows machine to read it: RGP (Radeon GPU Profiler, part of the Radeon Developer Tool Suite) has a Linux build and opens RADV captures. That's what we used on our RX 9070. If you want to have a look, these are the parts that would be most useful to compare with our capture from earlier in this thread:

  1. Overview → Most expensive events (and Pipelines, sorted by duration): the top 5-10 with event type, average duration and VGPR count. In ours (cell, RT off) the top was mesh/depth draws plus the ped skinning computes (CS_PedStandardSkinning_8 / _5, VGPR 96, ~300-360 us per small Dispatch(4..17,1,1)). Your capture has RT on and a different scene, so it would be good to know whether skinning is still near the top or BVH/RT work takes over.
  2. Instruction timing on one of those skinning dispatches (Events → select the event → Instruction timing). On GFX12 with RGP 2.7.1 it did not decode for us. If your RGP version shows it, that alone answers the open question here: is it waterfall loops on by-address loads, or just long memory latency?
  3. The DispatchIndirect(6,1,1) in the CopyBatch region (VGPR ~168): for us it was the single most expensive event (658 us). Is it in yours too?

One caveat when you get to hashes: the "API shader hash" RGP shows for RADV is the address of the radv_shader object, not a hash, so it changes from run to run. We mapped RGP code objects to pipelines by creation time against our log (both use CLOCK_MONOTONIC; constant offset, ±0.1 ms). On VKtory a pipeline-creation log line with a timestamp would work the same way.

Even only point 1 (a screenshot or a small table) would help @⁠vktory6 compare it with the xlcost ranking. No need to attach the capture itself.

**@⁠grykom** on GitHub · 2026-12-02 11:09 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7343513209) @⁠TheRifai Thanks, that's a useful capture. It also confirms the pstate -16 error is gone on stock RADV now that the second device is gone. You don't need a Windows machine to read it: RGP (Radeon GPU Profiler, part of the Radeon Developer Tool Suite) has a Linux build and opens RADV captures. That's what we used on our RX 9070. If you want to have a look, these are the parts that would be most useful to compare with our capture from earlier in this thread: 1. Overview → Most expensive events (and Pipelines, sorted by duration): the top 5-10 with event type, average duration and VGPR count. In ours (cell, RT off) the top was mesh/depth draws plus the ped skinning computes (CS_PedStandardSkinning_8 / _5, VGPR 96, ~300-360 us per small Dispatch(4..17,1,1)). Your capture has RT on and a different scene, so it would be good to know whether skinning is still near the top or BVH/RT work takes over. 2. Instruction timing on one of those skinning dispatches (Events → select the event → Instruction timing). On GFX12 with RGP 2.7.1 it did not decode for us. If your RGP version shows it, that alone answers the open question here: is it waterfall loops on by-address loads, or just long memory latency? 3. The DispatchIndirect(6,1,1) in the CopyBatch region (VGPR ~168): for us it was the single most expensive event (658 us). Is it in yours too? One caveat when you get to hashes: the "API shader hash" RGP shows for RADV is the address of the radv_shader object, not a hash, so it changes from run to run. We mapped RGP code objects to pipelines by creation time against our log (both use CLOCK_MONOTONIC; constant offset, ±0.1 ms). On VKtory a pipeline-creation log line with a timestamp would work the same way. Even only point 1 (a screenshot or a small table) would help @⁠vktory6 compare it with the xlcost ranking. No need to attach the capture itself.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-02 13:04 UTC · original

@⁠grykom I installed the Linux RGP 2.7.1 build (RadeonDeveloperToolSuite-2026-10-02-1872) and opened the stock-RADV capture from this thread. No Windows needed — your note was right. This is frame 4042 of the RT-on house capture on main d59b4f8, a 25 ms window; the two tables below are from RGP's Overview → Pipelines and Most expensive events (selection ~74% of the frame, 100% graphics events).

Point 1 — top pipelines by total duration (API shader hash is the RADV radv_shader address, not a stable hash, as you warned):

Bucket Hash Duration / % Events Avg event Occupancy VGPRs SGPRs Stages
1 0x71F33A75FC78D556 2,797.777 µs / 5.92% 1012 25.081 µs 16 12 108 CS
673 0x3B24E8E741A4B701 1,704.794 µs / 3.61% 1 1,704.794 µs 16 96 108 CS
1081 0x4700CA31795A4F66 1,586.702 µs / 3.36% 1 1,586.702 µs 6 256 108 CS
670 0xCACEA2947ACE260 1,115.285 µs / 2.36% 3 371.762 µs 16 96 108 CS
1067 0xFAEE090F70F08AD03 978.945 µs / 2.07% 1 978.945 µs 16 96 108 CS
10 0x21F04A51C2969C1 919.496 µs / 1.95% 6602 0.815 µs 16 24 108 CS
1123 0x84F51C704D8D52F1 858.821 µs / 1.82% 1 858.821 µs 8-16 48-192 108 VS/TES/GS/FS
1128 0x052719D4E4B497AC 840.321 µs / 1.78% 1 840.321 µs 8-16 48-192 108 VS/TES/GS/FS
1127 0x93FF9F721E7DB376 767.785 µs / 1.62% 1 767.785 µs 8-16 48-192 108 VS/TES/GS/FS

So compute is at the top here, not mesh/depth draws: a 256-VGPR CS dispatch at 1.59 ms and several 96-VGPR CS dispatches at 0.98-1.70 ms. Your skinning computes were VGPR 96 at ~300-360 µs, so the 96-VGPR group is the one to name by timestamp before calling it skinning or BVH — I have not done that mapping yet. The graphics group is a long tail of ~762-768 µs vkCmdDrawIndirect(720, 1) events, some with much shorter work durations (e.g. 858.821 µs duration / 290.526 µs work).

Point 3: no DispatchIndirect(6, 1, 1) in the top 15 most expensive events. The top indirect is vkCmdDispatchIndirect(7486, 1, 1) at 1,704.794 µs, followed by vkCmdDispatch(320, 180, 1) at 1,586.702 µs and vkCmdDispatchIndirect(108944, 1, 1) at 978.945 µs. So the CopyBatch case was not the most expensive event in this RT-on frame, unlike your RT-off cell capture.

Point 2: RGP 2.7.1's Instruction timing tab did not decode the selected CS on this GFX12 capture either, so I have no waterfall-vs-memory-latency answer from it.

Screenshots (no capture attached, as requested): /home/shlong/Documents/VKtory-capture/rgp-analysis/{most-expensive-events,most-events-table,pipelines,pipelines-table}.png.

**@⁠TheRifai** on GitHub · 2026-12-02 13:04 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7346310715) @⁠grykom I installed the Linux RGP 2.7.1 build (`RadeonDeveloperToolSuite-2026-10-02-1872`) and opened the stock-RADV capture from this thread. No Windows needed — your note was right. This is frame 4042 of the RT-on house capture on main `d59b4f8`, a 25 ms window; the two tables below are from RGP's `Overview → Pipelines` and `Most expensive events` (selection ~74% of the frame, 100% graphics events). **Point 1 — top pipelines by total duration** (API shader hash is the RADV `radv_shader` address, not a stable hash, as you warned): | Bucket | Hash | Duration / % | Events | Avg event | Occupancy | VGPRs | SGPRs | Stages | |---:|---|---:|---:|---:|---:|---:|---:|---| | 1 | `0x71F33A75FC78D556` | 2,797.777 µs / 5.92% | 1012 | 25.081 µs | 16 | 12 | 108 | CS | | 673 | `0x3B24E8E741A4B701` | 1,704.794 µs / 3.61% | 1 | 1,704.794 µs | 16 | 96 | 108 | CS | | 1081 | `0x4700CA31795A4F66` | 1,586.702 µs / 3.36% | 1 | 1,586.702 µs | 6 | **256** | 108 | CS | | 670 | `0xCACEA2947ACE260` | 1,115.285 µs / 2.36% | 3 | 371.762 µs | 16 | 96 | 108 | CS | | 1067 | `0xFAEE090F70F08AD03` | 978.945 µs / 2.07% | 1 | 978.945 µs | 16 | 96 | 108 | CS | | 10 | `0x21F04A51C2969C1` | 919.496 µs / 1.95% | 6602 | 0.815 µs | 16 | 24 | 108 | CS | | 1123 | `0x84F51C704D8D52F1` | 858.821 µs / 1.82% | 1 | 858.821 µs | 8-16 | 48-192 | 108 | VS/TES/GS/FS | | 1128 | `0x052719D4E4B497AC` | 840.321 µs / 1.78% | 1 | 840.321 µs | 8-16 | 48-192 | 108 | VS/TES/GS/FS | | 1127 | `0x93FF9F721E7DB376` | 767.785 µs / 1.62% | 1 | 767.785 µs | 8-16 | 48-192 | 108 | VS/TES/GS/FS | So compute is at the top here, not mesh/depth draws: a 256-VGPR CS dispatch at 1.59 ms and several 96-VGPR CS dispatches at 0.98-1.70 ms. Your skinning computes were VGPR 96 at ~300-360 µs, so the 96-VGPR group is the one to name by timestamp before calling it skinning or BVH — I have not done that mapping yet. The graphics group is a long tail of ~762-768 µs `vkCmdDrawIndirect(720, 1)` events, some with much shorter work durations (e.g. 858.821 µs duration / 290.526 µs work). **Point 3:** no `DispatchIndirect(6, 1, 1)` in the top 15 most expensive events. The top indirect is `vkCmdDispatchIndirect(7486, 1, 1)` at 1,704.794 µs, followed by `vkCmdDispatch(320, 180, 1)` at 1,586.702 µs and `vkCmdDispatchIndirect(108944, 1, 1)` at 978.945 µs. So the CopyBatch case was not the most expensive event in this RT-on frame, unlike your RT-off cell capture. **Point 2:** RGP 2.7.1's Instruction timing tab did not decode the selected CS on this GFX12 capture either, so I have no waterfall-vs-memory-latency answer from it. Screenshots (no capture attached, as requested): `/home/shlong/Documents/VKtory-capture/rgp-analysis/{most-expensive-events,most-events-table,pipelines,pipelines-table}.png`.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 16:14 UTC · original

Closing this one: everything in it is either done or tracked.

  • The pstate error: gone on stock RADV now that we create one Vulkan device. TheRifai's capture and grykom's check above confirm it, and RGP opens the capture on Linux without Windows.
  • The placement and dispatch findings: already in docs/TASKS.md as leads (memory placement, the small compute dispatches, the translation lead).

Thanks to everyone who posted numbers here. A full-frame RGP pass list of the city view is now in "House scene: 30 fps" (from #222).

**@⁠vktory6** on GitHub · 2026-12-02 16:14 UTC · [original](https://github.com/vktory6/VKtory/issues/9#issuecomment-7351648225) Closing this one: everything in it is either done or tracked. - **The pstate error:** gone on stock RADV now that we create one Vulkan device. TheRifai's capture and grykom's check above confirm it, and RGP opens the capture on Linux without Windows. - **The placement and dispatch findings:** already in docs/TASKS.md as leads (memory placement, the small compute dispatches, the translation lead). Thanks to everyone who posted numbers here. A full-frame RGP pass list of the city view is now in "House scene: 30 fps" (from #222).
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#9
No description provided.