agc_driver_dcc_keys_first_write fails where host imports stay write-watched (NVIDIA, Linux): cause and patch #2767
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 fma-rc on 2026-10-10T13:32:55Z.
agc_driver_dcc_keys_first_writefails onmainon Linux with the NVIDIA proprietary driver and passes on RADV on the same machine. It was reported in #2188, which was closed as device-specific; it still fails on currentmain, and the cause is in the texture refresh path, not in the driver.Setup:
main78aedb40, Arch Linux 7.2.9, GCC 16.2.1, Release. NVIDIA RTX 5080 (615.78.08); AMD Radeon 610M (RADV, Mesa 26.1.4).Reproduce:
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_dcc_keys_first_write$'Measured (full
ctest -j12, 698 tests):mainmain+ patch belowCause. The two devices differ in one line of the test's own log:
When imported ranges stay watched,
GuestMemory::ChangedBlocksreports the image's blocks asBlockMaybeWrittenafter the import, although no byte changed. InStorageTexture::Refresh,scanBlockstakes that as a change, so the unchanged pending image is written back and uploaded again, which is what the test forbids. On RADV the range is compared instead and the blocks come back unchanged.Patch that makes the test pass here. In
scanBlocks(Graphics/src/Texture.cpp), a block reported as maybe-written is compared before it counts as changed:tools/check_conventions.py --base origin/mainpasses with it. I can't open a pull request (intake), so it is here for whoever wants it.Note on the fifth run. In one of five parallel runs with the patch,
agc_driver_exec_host_lanesandagc_driver_pixel_interlockended with SIGSEGV. The core dump ofagc_driver_exec_host_lanesshows the crash insidelibnvidia-glvkspirv.soon the thread runningLinkPipelineFromLibraries, while the main thread waited inClearPipelineLibraries. It did not recur in 4 further parallel runs or in 10 serial runs of those two tests, and I have not seen it in 5 parallel runs without the patch. I could not reproduce it on demand, so I can't say whether it is related.Not established: the cost of the extra compare on a title (no title run was measured), and whether other callers of
ChangedBlockstreat maybe-written blocks the same way.Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-10T14:16:14Z.
I tested the patch on a second NVIDIA setup: RTX 3090 with driver 595.99.02, Ubuntu 24.04, Linux 7.0, GCC 13.3, Release,
maindb343a93. The probe prints the same line here:agc_driver_dcc_keys_first_writealonectest --parallel 12(698 tests)mainan unchanged pending image was uploaded again)main+ patchWith the patch, RADV (Ryzen 9 9950X iGPU, Mesa 25.2.8) and llvmpipe also pass 698/698.
About the SIGSEGV in your fifth run: I got
agc_driver_exec_host_lanesto segfault once without the patch, in the first of the three unpatched full runs, so it doesn't come from this change. It didn't recur in 6 more parallel runs of theagc_drivertests alone. Its core was rotated out before I could read it, so I can't confirm the stack matches yours (libnvidia-glvkspirv.sounderLinkPipelineFromLibraries).Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T17:26:45Z.
Status on current
main57f96fd2: the failure is still there on the NVIDIA device, and the patch above still applies cleanly and fixes it.Arch Linux, GCC 16.2.1, Release,
ANYPS5_REQUIRE_VULKAN=1,ctest -j12. RTX 5080 (615.78.08) and Radeon 610M (RADV, Mesa 26.1.4).main,agc_driver_dcc_keys_first_writemain+ patch, full suitectest lists 4
video_out_flip_*tests as skipped in the RTX 5080 run, and those plus 3guest_video_out_*tests in the RADV run; they are counted in the 698.python3 tools/check_conventions.py --base origin/mainpasses with the patch applied.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-10T17:50:51Z.
Confirming on a third NVIDIA setup, a Blackwell laptop: RTX 5090 Laptop GPU (0x2c58), driver 610.57.04, Gentoo, Linux 7.2.8, GCC 15.3.0, Release with CI's configure flags (
-DANYPS5_ENABLE_SPIRV_TOOLS=ON),main57f96fd2. The probe prints the same line:agc_driver_dcc_keys_first_writealonectest --parallel 4(701 tests)mainan unchanged pending image was uploaded again)main+ patchOn
main,APS5_WRITE_WATCH_IMPORTS=unwatchpasses 3 of 3 andwatchfails 3 of 3.It is not specific to NVIDIA. On the same laptop's Intel iGPU (Arrow Lake 0x7d67, Mesa 26.1.8 ANV) the probe reports
yes (4 of 4 scratch pages written after a GPU read, 4 after the import), so imports are compared there and the test passes onmain. Forced toAPS5_WRITE_WATCH_IMPORTS=watch, the same assertion fails onmain(the import resolves the write protection on ANV too) and passes with the patch, 3 of 3. Fullctestwith the patch on the iGPU: 692/700, the same 8 failures as onmain, none in this path (agc_driver_lds_beyond_device_limitexcluded, #2805).On the SIGSEGV question:
agc_driver_exec_host_lanesandagc_driver_pixel_interlockpassed in both of my full NVIDIA runs (one onmain, one with the patch).I also have a regression test that reproduces the import window without depending on the driver (a store of the byte already there inside
ImportWatched, over a pending image), if that would help this land.AI-assisted: yes