Repository navigation
fix(agc): give copied guest buffer regions transfer-source usage - #7961
Conversation
A guest buffer region that is copied rather than imported gets a buffer with storage (and, when addressable, device-address) usage only. Host imports, sparse imports and chunk imports carry VK_BUFFER_USAGE_TRANSFER_SRC_BIT, so a buffer view of imported guest memory can be read back with vkCmdCopyBuffer, but not one of a copied region. agc_sparse_run_import_copied does that readback, and the Khronos validation layer reports VUID-vkCmdCopyBuffer-srcBuffer-00118 for it. Copied regions now carry transfer-source usage too. The sparse buffer hole tests seed the buffer pool with the usage a copied region asks for, so their seed buffer gets transfer-source usage as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
First AMD run of this PR, on Linux with RADV. Head AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. With the Khronos validation layer (Ubuntu's 1.3.275,
Full suite ( GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes |
|
Thanks @DavidAmsellem, that's the first AMD coverage for this one. I added your run to the description: the VUID goes from 1 to 0 under RADV, and the full suite has no new failure or skip. AI-assisted: yes (Claude Code) |
|
Independent Windows run of this PR with a baseline (data only). Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, NVIDIA GeForce RTX 4080 SUPER (the log shows Results (3 runs each):
Not run: other GPUs (no AMD card for this PR), other platforms, the other tests, the full repository CTest, and any title or console run. AI-assisted (Claude Code). |
|
Thanks @xXPBSXx. The fail on the merge base's AI-assisted: yes (Claude Code) |
|
Independent run with the Khronos validation layer on AMD. It confirms the layer-reported error this PR removes, with no other change across the AGC tests. Setup: Windows 11 Pro 26200, AMD Radeon 680M (RDNA 2 iGPU), AMD driver 32.0.21030.2001, WinLibs GCC 15.2.0 r7, Release, full build.
For reference, the GPU-copy path for the same AI-assisted: yes |
|
Thanks @DavidSamir, that's the first AMD run of this PR under the layer, and the first across the whole About the unrelated failures: AI-assisted: yes (Claude Code) |
|
Validation-layer data point for this PR (data only; follow-up to my earlier RTX note). Setup: Linux (WSL2 Ubuntu 24.04, GCC 13.3, Release), llvmpipe, Before ( After (this PR): One run each, on llvmpipe only. I did not run the other tests with the change under the layer. Not run: other GPUs for the layer run, other platforms. AI-assisted (Claude Code). |
|
Thanks @xXPBSXx. That confirms AI-assisted: yes (Claude Code) |
|
Windows/NVIDIA reproduction on current main d6eafa5 AGC code (our only additional initial change was SystemService parameter100): I have merged published054cf42202 cleanly into the next 007 WIP alongside #9565 atc4162b2156. It is source-only/UNBUILT: our pinned current-main 007 baseline is still compiling changed pipelines, so no concurrent builds/native tests. I will run the sparse copied/imported and buffer-hole controls with the same layer before any runtime change. No Windows fix-pass or FPS claim yet. AI-assisted: Codex. |
|
@milescoviello, merged, thanks. Full CI on 054cf42 was green on Linux and Windows, and agc_sparse_run_import_copied and agc_driver_sparse_buffer_holes pass on Linux. Thanks also to @DavidAmsellem, @xXPBSXx, @DavidSamir and @Scramblrrrr for the runs on RADV, NVIDIA and AMD under the validation layer. |
|
@oneandonlydean thanks for merging. @Scramblrrrr thanks for the Windows/NVIDIA reproduction under the 1.4.363 layer: the copied source buffer lacking AI-assisted: yes (Claude Code) |
What
A guest buffer region that is copied rather than imported gets a buffer with storage usage, plus device-address usage when it is addressable, and nothing else. Host imports, sparse imports and chunk imports also carry
VK_BUFFER_USAGE_TRANSFER_SRC_BIT, so a buffer view of imported guest memory can be read back withvkCmdCopyBuffer, but a view of a copied region can't.agc_sparse_run_import_copieddoes exactly that readback. The Khronos validation layer reportsVUID-vkCmdCopyBuffer-srcBuffer-00118for it, which the sweep ofmain's^agc_tests under the layer turned up.GuestBufferMemory::copyRegionnow adds transfer-source usage to the copied region's buffer.Tested
Ubuntu 24.04, GCC 13.3, NVIDIA RTX 4070 Ti (595.99.02).
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V,^agc_sparse_run_import, throughVK_LAYER_PATH. Neither log reports the layer missing.main6762694 reportsVUID-vkCmdCopyBuffer-srcBuffer-00118×3; this change reports none.mainreports00118×2 over^agc_sparse_run_import|sparse_buffer_holes; this change reports none.^agc_driver_recorder|sparse|import|guest_buffer|buffer_memory|bda|mirror|^agc_driver_graphics$pass, as onmain6762694. Before the test seeds were updated,agc_driver_sparse_buffer_holesandagc_sparse_buffer_holesfailed onthe upload did not reuse the primed buffer, which shows the pool reuse they check is keyed on usage.mainb106f6f without conflicts.mainc614599: under Ubuntu's 1.3.275 validation layer,^agc_sparse_run_import,agc_sparse_run_import_copied,agc_driver_sparse_buffer_holesandagc_driver_graphicsreportVUID-vkCmdCopyBuffer-srcBuffer-00118×1 onmainand none with this PR, and pass 4 of 4 on both. The full suite gives 1735 of 1736 with and without this PR, with the same one failure (agc_driver_guest_memory_lifetime, agc_driver_guest_memory_lifetime fails on RADV since the host-import cut larger-side keep (16473dbbe, #6499 family) #7784) and no JUnit entry added, skipped or removed.agc_driver_sparse_buffer_holespasses 3 of 3. With onlyGraphics/src/GuestBufferMemory.cppfrom the merge base, the same test fails 3 of 3 (the upload did not reuse the primed buffer at the expected extent).agc_*tests under the 1.4.363 layer onmain27fabb6 and with this PR merged into it. Onmain,agc_sparse_run_import_copiedlogsVUID-vkCmdCopyBuffer-srcBuffer-00118forcopyRegion's buffer. With this PR, that error is gone and the validation output is otherwise identical. The same 6 tests fail on both sides, none of them related to this change.agc_driver_*_testsonmain950388b:00118is reported once, only fromagc_sparse_run_import_copied. With this change that test passes with no00118. One run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code