Repository navigation
docs/d3d12_vulkan: measured why RADV cannot alias a slot-133 section view's pages - #13
Open
GustawMatuszewski wants to merge 1 commit into
Conversation
…view's pages The slot-133 (CreatePlacedResourceX) fallback texture reports the title's address from GetGPUVirtualAddress but its pixels do not alias the title's pages. Recorded where the aliasing dies on RADV, from a source read plus strace of the layer's import: radv_bo_from_ptr -> radv_amdgpu_winsys_bo_from_ptr -> ac_drm_create_bo_from_user_mem (common/ac_linux_drm.c:952 in Mesa 26.0.8) -> libdrm amdgpu_create_bo_from_user_mem (amdgpu/amdgpu_bo.c:587), which builds the userptr BO with AMDGPU_GEM_USERPTR_ANONONLY; amdgpu_ttm_tt_get_user_pages() then answers -EPERM for any userptr VMA that carries a vm_file (amdgpu_ttm.c, v7.0 lines 743-746). A pagefile-backed section view is file-backed by construction, so no range of it imports; Mesa maps every error but -EINVAL to VK_ERROR_UNKNOWN and the layer reports E_OUTOFMEMORY and falls back to the ordinary committed buffer. Also records what the fallback still owes: registering it at the title's VA so CPU-recorded calls that name it (root descriptors, IA views, immediate writes, copies, dispatch arguments, SRVs built from that VA) resolve, and copying the committed pages in at creation and per submission. Tested: python -I on all 12 tests/test_docs_*.py, OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: n/a — this repository has no "Coordinating who works on what" issue, so the item is described here in full.
Depends on: none.
What and why
docs/d3d12_vulkan.mdsays of the slot-133 (CreatePlacedResourceX) fallback texture that it reports the title's address fromGetGPUVirtualAddresswhile "the image itself still does not alias the title's pages". It does not say why the aliasing cannot be had, which is the question anyone picking that work up will ask first.This adds a measured paragraph to that section, from a source read plus
straceof the layer's import:VkImportMemoryHostPointerInfoEXT,HOST_ALLOCATION), and the layer's own checks (Resource::create_host_buffer) accept the range;radv_bo_from_ptr→radv_amdgpu_winsys_bo_from_ptr→ac_drm_create_bo_from_user_mem(src/amd/common/ac_linux_drm.c:952in Mesa 26.0.8) → libdrmamdgpu_create_bo_from_user_mem(amdgpu/amdgpu_bo.c:587), which creates the userptr BO withAMDGPU_GEM_USERPTR_ANONONLY, andamdgpu_ttm_tt_get_user_pages()answers-EPERMfor any userptr VMA that carries avm_file(amdgpu_ttm.c, v7.0 lines 743-746);DRM_IOCTL_AMDGPU_GEM_USERPTRcalls returned-EPERM, both from thevkAllocateMemoryfor the section view);-EINVALtoVK_ERROR_UNKNOWN, so the layer sees a failed allocation, reportsE_OUTOFMEMORYand takes the ordinary committed buffer;VkResult; the refusal is unchanged and Mesa's ownfeatures.txtstill listsVK_EXT_external_memory_hostas DONE for RADV.It closes with what the fallback still owes, since the addresses cannot be made to match (host
0x7f..vs BDA0xffff800100040000): register the fallback at the title's VA so every CPU-recorded call that names it resolves, and copy the committed pages in at creation and per submission (182 MiB for the retail buffer; dirty-page tracking would be the follow-up).Tested
tests/test_docs_*.py— OK (includingtest_docs_repo_pathsandtest_docs_linksfor the new path and MR reference).GPUs tested: AMD RX 9060 XT (RDNA4/GFX1200), RADV Mesa 26.0.8, Ubuntu 26.04 — the source read and the strace; the same refusal was seen on a Radeon 890M (RDNA3.5, RADV) for the follow-up work. Documentation only, nothing rebuilt for this pull request.
AI-assisted: yes (Claude Code). No game files, no shader dumps, no captures.
Checklist
main(6591ba9), one commit, merges cleanly.