Linux: an LD_PRELOAD shim that lets amdgpu import Wine's memfd sections as userptr #235
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/235"
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 DexNom/VIctory. Originally posted by fsrajner on 2026-11-29T22:42:32Z.
Builds on #234 (its one commit is included here; it lets
.cfiles pass the asset policy).The finding: under Proton, vkd3d-proton opens a heap on title memory with
VK_EXT_external_memory_host, which RADV makes an amdgpu userptr buffer. libdrm always asks withAMDGPU_GEM_USERPTR_ANONONLY, and Wine keeps sections (the title's physical pages) in memfds, so the kernel refuses the import and vkd3d-proton silently gives the heap memory of its own: the card reads zeros where the title's bytes are.The shim (
scripts/linux/userptr-shim) clears only that flag in onlyDRM_AMDGPU_GEM_USERPTR; the import then works and every view of the section sees what the card writes. The README also says what it costs: the kernel walks every userptr page at every submission (0.9 ms per 185 MB), so it is a proof and a diagnostic rather than a fast path, and points to the faster way round that was measured on another branch.Nothing in the runtime changes. Tested: built with
cc -O2 -Wall, used on an RX 9070 XT with Mesa 26.3.1 and Proton Experimental;cargo xtask policypasses.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.