AGC: agc_unit_shadow fails on CI's lavapipe since #2864: a publish's own copy reads as a newer CPU write #3215
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 adriadam10 on 2026-10-11T01:36:47Z.
agc_unit_shadowhas failed on every Linux CI run ofmainsince #2864 registered it (main run 38095564749 onward):Where it runs.
unitShadowTestsonly exercises the shadows where host imports stay watched. CI's lavapipe is such a case: Mesa 25.2.8,/dev/udmabufdenied, log linehost imports resolve write protection: no ... imported ranges stay watched. On RADV the run printshost imports are compared, not watched: unit shadows not testedand returns 0, not 77, so a local RADV pass doesn't mean it was tested. Before #2864 it wasn't in ctest; on lavapipe it stopped earlier, on the pin wait that #2864 fixes. #2864's head alone (f5618d912) fails the same way, so it isn't an interaction with another merge.Why it fails (lavapipe, with a temporary print at the stale-drop site in
publishUnits). The partial publish over units 3-4 returns 0.publishUnitsdrops unit 3 as stale withcpu[k] != 0, so its retiled bytes are never copied and the next check fails:With lavapipe the "GPU" is the CPU. The earlier whole publish of unit 3 is a
vkCmdCopyBufferinto the host-pointer import, executed by lavapipe's threads as CPU stores into watched pages. Those stores are collected only at the nextCollectWritesUncached, which is afterretile(*whole, unit3, ...)marked the unit withTrackerGeneration(). So the publish's own copy reads as a CPU write newer than the retile, and the unit is discarded.It isn't lavapipe-only in principle: any driver where GPU writes to an imported host range trip the write watch would do the same. The publish's own copies would need to be absorbed (collected before the next mark, or excluded) rather than counted as title writes.
Reproduce: CI's lavapipe packages (
mesa-vulkan-drivers,mesa-libgallium,libllvm2025.2.8 from the "Install lavapipe" step), thenbwrap --dev-bind / / --ro-bind <mode-000 file> /dev/udmabuf env APS5_PIN_WAIT_MS=3000 LD_LIBRARY_PATH=... VK_DRIVER_FILES=.../lvp_icd.json build/tests/agc_driver_recorder_tests --unit-shadow-only.@MarcZX100, could you take a look? You know this path best. I fixed the third red test,
agc_driver_image_packed16_load, in #3208.agc_driver_flat_aperturesis a separate issue.Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-11T01:54:30Z.
Reproduced on a second machine — with no sandbox, and with
udmabufworking.I ran the test CI runs, on lavapipe, here:
exit 1. Mesa 26.2.4 / LLVM 23.1.1 here against CI's 25.2.8, so this is not a quirk of one Mesa.
The udmabuf part is worth comparing against your log, because here it is not the trigger.
open("/dev/udmabuf", O_RDWR)succeeds on this machine — the device isroot:kvm 0660and the+on those permissions is an ACL granting this userrw-— and the run still reproduces, with the driver's own line readinghost imports resolve write protection: no … imported ranges stay watched. That is the host-import path, not the dma-buf path. So the failing state is reachable with udmabuf available: what looks load-bearing is host imports staying watched, rather than the udmabuf denial itself.One prerequisite for anyone reproducing: #2864's pin-release fix has to be present. On a tree without it the same binary never reaches
unitShadowTests; it aborts earlier withwhich is
PinnedFailurethrowing fromGuestAllocations.cpp:260-264. With #2864 cherry-picked, the shadow test is the first thing to fail, in seconds.On the mechanism, two things in the code narrow it.
publishUnitsalready tells the two causes apart —(cpu[k] != 0 ? Stats().staleDroppedCpu : Stats().staleDroppedDriver)atUnitShadow.cpp:327. The failure is that on this device the publish's own copy is counted in the CPU bucket.GuestMemory::CollectWritesUncachedis called from the publish (UnitShadow.cpp:315) and from the device after a copy (VulkanDevice.cpp:522). So this looks like which copy gets absorbed rather than a mechanism that is missing — the partial publish's ownvkCmdCopyBufferover units 3–4 is the one that is not.Two more instances of the same class, from tonight — which is why I think the "not lavapipe-only in principle" framing is the right one:
maxComputeWorkGroupCountat the spec minimum(65535,65535,65535), so a legitimate129199x1x1dispatch throws instead of being split — filed as #3212.max(2048 MiB, heap / 4),ShaderResources.cpp:823) is 7978 MiB here where a real 12 GB GPU is entitled to 3072 — the software device gets the larger budget.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T05:06:27Z.
Fixed by #3226 (merged). It extends the import probe with a GPU fill of the scratch range; lavapipe reports those pages as written, so imported ranges are compared instead of watched and the publish's own copy is no longer collected as a CPU store. The shadow checks then don't run on lavapipe, as on RADV; they still run on NVIDIA, where the fill reports 0 pages.