AMD Windows: agc_driver_depth_surface_from_storage intermittently loses rows of the D16 case #6630

Closed
opened 2026-10-15 23:54:15 +00:00 by PYTHONRETARDE · 4 comments
PYTHONRETARDE commented 2026-10-15 23:54:15 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by PYTHONRETARDE on 2026-10-15T23:54:15Z.


agc_driver_depth_surface_from_storage fails in about 1 of 6 runs on an RX 7800 XT (1002:747e, driver 32.0.31041.1004, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, main 03c4cb5e7 + #6452), always in the D16 case and always by whole rows of the 64-wide plane:

a new D16 depth surface over a pending R16 unorm storage write: 79 pixels passed, expected 15
a new D16 depth surface over a pending R16 unorm storage write: 143 pixels passed, expected 15

(15 + 64 and 15 + 128.) The D32 cases never fail.

With temporary logging in DepthSurface::TakeStorage, failing and passing runs take the same path: the storage image is found pending, it fits, Refresh() returns true, and the copy goes through the recorder. Two changes did not help (10 of 60 runs still failed with each):

  • adding VK_ACCESS_TRANSFER_WRITE_BIT to the first barrier's destination access, so the depth image's clear is ordered before the buffer-to-image copy;
  • recording the copies in their own CommandBatch with SubmitAndWait instead of the recorder.

So it looks GPU-side, either in the D16 copy into the cleared depth image on this driver or in the R16 storage write before it; I haven't narrowed it further. Not tested: other GPUs, Linux.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5875780510 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6630). Originally posted by [PYTHONRETARDE](https://github.com/PYTHONRETARDE) on 2026-10-15T23:54:15Z. --- `agc_driver_depth_surface_from_storage` fails in about 1 of 6 runs on an RX 7800 XT (`1002:747e`, driver 32.0.31041.1004, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, `main` `03c4cb5e7` + #6452), always in the D16 case and always by whole rows of the 64-wide plane: ``` a new D16 depth surface over a pending R16 unorm storage write: 79 pixels passed, expected 15 a new D16 depth surface over a pending R16 unorm storage write: 143 pixels passed, expected 15 ``` (15 + 64 and 15 + 128.) The D32 cases never fail. With temporary logging in `DepthSurface::TakeStorage`, failing and passing runs take the same path: the storage image is found pending, it fits, `Refresh()` returns true, and the copy goes through the recorder. Two changes did not help (10 of 60 runs still failed with each): - adding `VK_ACCESS_TRANSFER_WRITE_BIT` to the first barrier's destination access, so the depth image's clear is ordered before the buffer-to-image copy; - recording the copies in their own `CommandBatch` with `SubmitAndWait` instead of the recorder. So it looks GPU-side, either in the D16 copy into the cleared depth image on this driver or in the R16 storage write before it; I haven't narrowed it further. Not tested: other GPUs, Linux. AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-15 23:58:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:58:43Z.


The +64/+128 pixel excess is exactly one or two full rows, but the current test observes only the final depth result, so it does not identify which copy first differs. Could you capture the staging buffer immediately after vkCmdCopyImageToBuffer and the D16 image after vkCmdCopyBufferToImage (before the test draw), with row-by-row checksums or values? That would distinguish a bad R16 storage readback from a bad buffer-to-D16 copy/interpretation. The diagnostic should run on the failing AMD setup; the same submission-and-wait experiment does not separate those two stages.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204802748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6630#issuecomment-6204802748). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T23:58:43Z. --- The +64/+128 pixel excess is exactly one or two full rows, but the current test observes only the final depth result, so it does not identify which copy first differs. Could you capture the staging buffer immediately after `vkCmdCopyImageToBuffer` and the D16 image after `vkCmdCopyBufferToImage` (before the test draw), with row-by-row checksums or values? That would distinguish a bad R16 storage readback from a bad buffer-to-D16 copy/interpretation. The diagnostic should run on the failing AMD setup; the same submission-and-wait experiment does not separate those two stages.
LeandroLP23 commented 2026-10-16 08:41:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-16T08:41:59Z.


Doesn't reproduce on an RDNA 3.5 iGPU: Radeon 860M (1002:1114, driver 32.0.13058.8001), Windows 11 Home 26300, WinLibs GCC 15.2.0, Release, plain main 5d9dcc42d (which builds here without #6452 because only that one test fails to compile). ANYPS5_NO_SHADER_CACHE=1, a fresh ctest -R '^agc_driver_depth_surface_from_storage$' per run:

  • 30 of 30 pass unpinned;
  • 30 of 30 pass with ctest and the test pinned to one logical CPU (start /affinity 1), which is what exposed the StoreOverUntracked races on this machine (#6385).

So with 0 of 60 here against about 1 in 6 on the RX 7800 XT, it looks tied to the discrete RDNA 3 part or to its newer driver (32.0.31041 against 32.0.13058) rather than to AMD's Windows driver in general.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211618908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6630#issuecomment-6211618908). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-16T08:41:59Z. --- Doesn't reproduce on an RDNA 3.5 iGPU: Radeon 860M (`1002:1114`, driver 32.0.13058.8001), Windows 11 Home 26300, WinLibs GCC 15.2.0, Release, plain `main` `5d9dcc42d` (which builds here without #6452 because only that one test fails to compile). `ANYPS5_NO_SHADER_CACHE=1`, a fresh `ctest -R '^agc_driver_depth_surface_from_storage$'` per run: - 30 of 30 pass unpinned; - 30 of 30 pass with ctest and the test pinned to one logical CPU (`start /affinity 1`), which is what exposed the StoreOverUntracked races on this machine (#6385). So with 0 of 60 here against about 1 in 6 on the RX 7800 XT, it looks tied to the discrete RDNA 3 part or to its newer driver (32.0.31041 against 32.0.13058) rather than to AMD's Windows driver in general. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-16 23:04:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T23:04:19Z.


Thanks for the 60-run RDNA 3.5 comparison, including the pinned-CPU control. I have updated my assessment: this does not reproduce on the Radeon 860M and narrows the current report to the RX 7800 XT / newer driver path; it does not identify whether the mismatch starts in storage readback or the buffer-to-D16 copy. The next useful evidence remains row-level inspection of the staging data and destination depth image on a failing RX 7800 XT run. I will not propose a production fix until that stage is isolated.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6226327233 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6630#issuecomment-6226327233). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T23:04:19Z. --- Thanks for the 60-run RDNA 3.5 comparison, including the pinned-CPU control. I have updated my assessment: this does not reproduce on the Radeon 860M and narrows the current report to the RX 7800 XT / newer driver path; it does not identify whether the mismatch starts in storage readback or the buffer-to-D16 copy. The next useful evidence remains row-level inspection of the staging data and destination depth image on a failing RX 7800 XT run. I will not propose a production fix until that stage is isolated.
thuanquang commented 2026-10-21 06:41:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T06:41:43Z.


A discrete RDNA 2 data point: RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2.0, Release, main a07e985c8, ANYPS5_REQUIRE_VULKAN=1.

agc_driver_depth_surface_from_storage passes 60 of 60 (--repeat until-fail:60, serial, the driver cache kept between runs). The D16 row loss didn't appear once. With @LeandroLP23's 60 runs on the Radeon 860M, that keeps the report on the RX 7800 XT and its 31041 driver.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309808006 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6630#issuecomment-6309808006). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T06:41:43Z. --- A discrete RDNA 2 data point: RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2.0, Release, `main` `a07e985c8`, `ANYPS5_REQUIRE_VULKAN=1`. `agc_driver_depth_surface_from_storage` passes 60 of 60 (`--repeat until-fail:60`, serial, the driver cache kept between runs). The D16 row loss didn't appear once. With @LeandroLP23's 60 runs on the Radeon 860M, that keeps the report on the RX 7800 XT and its 31041 driver.
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#6630
No description provided.