d3d12: buffer-remap regression control fails on RADV, with host memory imports refused #191
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 brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-25T19:13:03Z.
python tuxbox.py checkonmainat1f40ee4fails one of the 17 D3D12 regression controls here. The other 16 pass, includingbuffer-importandbuffer-import-reject. #189 notes the same control failing on an RX 9060 XT, so this looks specific to RADV and not to one card.Setup. RX 6700 XT (
1002:73df), Mesa 26.3.1 RADV, Intel i5-12600K, Linux 7.3.5, Proton Experimental 11.0-20261112.Result.
What the control's log shows. Twice, immediately before a buffer is placed, vkd3d-proton refuses to import the host memory:
The second refusal follows
page remap replaced imported range 0x37c0000..0x37d0000 ... retired stale GPU import.buffer-import, which passes, logs no refused import.In ProjectScarlett. A 300 s offline run on the same machine logs the same three lines 131 times.
Not established. I haven't found why the import is refused. One possibility is that the kernel driver only accepts anonymous memory for this kind of import and the remapped pages are a shared section, but that is a guess. I also haven't shown that the refused imports cause anything visible in the title. I'm looking into it and will post what I find.
Imported from brcly/TuxBox. Originally posted by Exorion1er on 2026-11-25T19:52:13Z.
Your guess is right: amdgpu refuses the import because the pages are a shared mapping. libdrm always asks for anonymous-only memory. With that flag cleared,
buffer-remappasses and ProjectScarlett gets past the black screen on my RX 9070 XT.Setup. RX 9070 XT (
1002:7550), Mesa 26.2.7 RADV, libdrm 2.4.134, Linux 7.3.5 (Fedora 44), Proton Experimental 11.0-20261112, TuxBox7b22d71.XMem backs physical pages with pagefile sections (
CreateFileMappingW+MapViewOfFile3inruntime/xmem/src/shared_pages.rs), and Wine maps those as shared Linux mappings. RADV imports a host pointer through libdrm'samdgpu_create_bo_from_user_mem, which always setsAMDGPU_GEM_USERPTR_ANONONLY. The kernel then rejects any page backed by a file. A small native Vulkan program (no Wine) importing 64 KiB throughVK_EXT_external_memory_hostgives:With
ANONONLYcleared from theDRM_AMDGPU_GEM_USERPTRioctl, all four return 0.buffer-remapfails here too. With a local change that reports which copy differs, all three copies read zero, including the two taken before the remap:So it isn't specific to remapping: on RADV the GPU never sees the contents of a section-backed page, and the buffer reads as zeros.
In ProjectScarlett this is the black screen. Once the shader preload finishes, the title draws about 22 draws per frame and every draw's readback is zero. The UI vertex shader reads its positions and colors from a constant buffer. If that buffer reads as zeros, every vertex collapses and nothing rasterizes. I haven't traced that buffer to these pages directly, but the UI appears once the imports succeed. The same run logs 131 refused imports.
The workaround I tested is an
LD_PRELOADlibrary that interposesdrmCommandWriteReadand clears the flag on the userptr ioctl only:(
RTLD_NEXTdoesn't work here because the Vulkan loader opens libdrm locally.) With it preloaded:buffer-remap,buffer-importandbuffer-layoutpass, with no refused imports in the log.lit=0.998 mean=(32,32,44), the same value as the Account Picker sample inprojectscarlett-startup.json(RTX 4070 Ti SUPER). In my own run it got past the intro video and through the menus.This is a workaround, not a fix. As far as I can tell, the anonymous-only restriction is deliberate, because a file-backed page can be truncated while a buffer still holds it. Wine doesn't truncate these sections while they are mapped, but I haven't checked every path. A real fix probably belongs either in how TuxBox gives the GPU access to physical pages on AMD, or in libdrm/Mesa if they would accept an opt-out of
ANONONLY. I haven't tried either.This probably also explains #39 (RX 9060 XT, black after the same milestone).
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-25T21:00:58Z.
I can reproduce this on an RX 9060 XT (I am OP of #189 actually), and it matches what @Exorion1er found. I have a working branch and will open a PR soon.
Setup. RX 9060 XT (
1002:7590), Mesa 26.2.6 RADV, Linux 6.18.60 (NixOS), Proton Experimental 11.0-20261112, TuxBox1b32189.Cause. Calling
DRM_IOCTL_AMDGPU_GEM_USERPTRdirectly, the kernel accepts private anonymous memory and returns EPERM for shared anonymous, memfd and temp file mappings. WithoutANONONLYit accepts all of them. Wine creates these sections withmemfd_create.The provider cannot notice the refusal. vkd3d-proton falls back to unrelated host-visible memory, reports success and still returns the guest pointer from
Map. That is why the control logsimported, even withTUXBOX_REQUIRE_BUFFER_IMPORT=1.What the PR will do.
drmCommandWriteRead, like @Exorion1er's. It repeats a userptr request withoutANONONLYonly after the kernel refused it, so anonymous imports keep the driver's behavior. It does not link libdrm or need its headers.tuxbox.py check.TUXBOX_AMDGPU_IMPORT=0turns it off in the launcher.buffer-*controls fail when vkd3d-proton logs a refused import.Result. Without the preload
buffer-remapfails with two refused imports. With it the control passes (768/768 words, none refused), and the fullcheckpasses: 67/67 guest checks, 17/17 regression controls and the translator checks.Not established. I have not finished a ProjectScarlett run with this yet. It is still a workaround: an opt-out of
ANONONLYin libdrm or Mesa would be the cleaner fix, and I haven't checked @Exorion1er's point about truncated files.@JeffreyBytes, you said you were looking into this too. If you already have something different in progress, let me know before I open the PR.
Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-25T21:24:54Z.
Heads-up @gtb-sbe / @JeffreyBytes: I just opened #200 with a
runtime/d3d12-side fix (noLD_PRELOADor libdrm changes) that detects the silent RADV section refusal once per device and mirrors committedMEM_MAPPEDranges through anonymousVirtualAllocshadow heaps with chunked pre-submit sync.d3d12-buffer-remap(768/768,identical=1 replacement=1),buffer-import,buffer-import-reject,buffer-layout, andtuxbox.py check(67/67 GPU gates) all pass on RX 6900 XT (1002:73bf).Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-25T21:55:21Z.
Following up on my own "I'm looking into it".
The preload from @Exorion1er's comment reproduces here on the RX 6700 XT (
f489d3c, Linux 7.3.6, Mesa 26.3.1): refused imports go from 131 to 0, the first present samples go fromlit=0.000tolit=0.998 mean=(32,32,44), andbuffer-remappasses. So that is three RADV cards with the same cause.I'm not working on a fix of my own; #200 and #199 cover it. I tested #200 on this card and posted the results there: the controls pass and the game reached the Account Picker and the intro video, with a large slowdown and a crash in two of three runs.
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T00:32:18Z.
Since a preload is not wanted, I measured what ProjectScarlett actually does with the pages amdgpu refuses, to see whether XMem and the provider can fix this alone, without per-submit copies.
Summary
If that holds, XMem can back every page with private memory, which amdgpu imports fine, and the provider can point every GPU alias of a page at that one backing. Details below; I'd like to know whether that direction is acceptable before I build it.
Setup: RX 9060 XT (
1002:7590), Mesa 26.2.6 RADV, Linux 6.18.60, Proton Experimental 11.0-20261112,main1b32189, ProjectScarlett 1.0.2.1 offline. Two runs: 54 minutes from a partly warm cache, then 7 minutes with a warm cache. Both reached the 22-draw state (still black) and gave the same import breakdown. Currentmain(cb8c38b) leaves XMem and the import paths unchanged. It does change the size of some small texture allocations and defaults to GE-Proton11-14, so individual import sizes may differ there; I have not rerun on it.1. What is refused
An opt-in trace classifies every import whose range contains a section view, i.e. every import amdgpu will refuse, and asks XMem which pages are behind it. Both runs: 131 such imports, the same 131 that vkd3d-proton refused.
XMemMapPhysicalPagesview, each page mapped only thereXMemMapPhysicalPagesview with GPU attributes (0x2404), each page also mapped at 1 to 7 other such addressesCopyPageMappingsdestinationThe
CopyPageMappingsdestinations are reserved with0x801(PAGE_NOACCESSplus a GPU bit), so the console gives the CPU no access there. Marking all 3,020 destination pagesPAGE_GUARDconfirmed it: no CPU access in 54 minutes. So the aperture is a small part of this, not the cause.2. Which views the CPU uses
A section view under Wine gets Linux page-table entries only once something touches the page through that view.
/proc/<pid>/pagemaptherefore shows per view whether the CPU used it, without changing protections. Three samples in the 22-draw state, all identical:PAGE_READWRITEview; their registered-pool and aperture views are never touched3. What this rules out and what it allows
ANONONLYrefuses. ProjectScarlett does not need it.Proposed design (not implemented)
MEM_REPLACE_PLACEHOLDER), so XMem's address layout stays the same.CopyPageMappingsaperture.This is not an AMD-only path: private memory can be imported on every driver, so with the pipeline separation you mentioned in #16, both vendors would keep the same memory model. NVIDIA should behave as before, but I have not tested it there.
Limits:
PAGE_READWRITEview as the CPU view comes from one title.@brcly, since you're holding #200 until there is an agreed approach: is this direction acceptable, or is there a reason XMem must keep sections? If it is, I'd measure backing contiguity next and then start with the 10 single-view imports, which need no aliasing at all.
Notes
Failed to import host memoryonly once (#16). Counting imports that contain section views on the provider side works on both Protons; I'd use that for the regression controls.mainstill setsANONONLYunconditionally.ANONONLYcause and to @JeffreyBytes for the measurements on the RX 6700 XT.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-26T01:46:18Z.
Looking for help: let RADV read game memory directly
mainnow has a fallback from #200: when the host profile shows the GPU can't read imported game memory, TuxBox copies it. It passesbuffer-remap, but GPU writes stay in the copy and copying costs speed. We'd like to replace it with direct imports, without a preload library.What we know
runtime/xmem/src/shared_pages.rs,CreateFileMappingW+MapViewOfFile3), which Wine maps as shared memory.Ideas to test (none proven)
How to tell it works
section-import=aliasedon RADV with no override.python tuxbox.py checkpasses on AMD, includingbuffer-remap, and still passes on NVIDIA.TUXBOX_HOST_PROFILE=section-import=aliasedforces direct imports, which reproduces the failure on RADV.Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-26T02:56:21Z.
One data point for "page remapping still behaves", from a long run with direct imports on RADV.
RX 6700 XT, Mesa 26.3.1, Linux 7.3.6, GE-Proton11-14,
cb8c38b, ProjectScarlett offline. To get direct imports I used theANONONLYpreload from earlier in this thread, as a diagnostic only. The run went through the Account Picker, intro video and first-run settings, then loaded for 82 minutes with no failed presents.At 96 minutes the title remapped pages under existing imports for the first time. The provider logged 24 lines of
page remap replaced imported range … retired stale GPU import(batches=272), and the next submit failed:The game then exited with code 3.
buffer-remappasses with the same preload, so the control does not cover this.I have not traced it further. My guess is that RADV submits every live buffer with each command stream, so a host-pointer import whose pages were remapped makes the kernel reject the whole submit with
EFAULT, even if the provider has already retired that import. If so, any design that imports the title's pages directly on amdgpu needs the old import fully destroyed before the remap, which NVIDIA would not reveal.Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-26T07:10:17Z.
Tested @brcly's Ideas #1 and #2 plus @JeffreyBytes's
-14(EFAULT) note using a standalone C++ D3D12 probe on RX 6900 XT (1002:73bf),GE-Proton11-14(vkd3d-proton 3.2.0), Mesa RADV26.3.1,TiledResourcesTier = 4,ID3D12Device13.Idea #1 — What imports directly (
OpenExistingHeapFromAddress1+ GPU copy readback)VirtualAlloc(MEM_RESERVE | MEM_COMMIT)aliasedVirtualAlloc2(MEM_RESERVE_PLACEHOLDER)split +MEM_REPLACE_PLACEHOLDER(MEM_PRIVATE)aliasedVirtualAlloc(... | MEM_WRITE_WATCH)aliasedCreateFileMappingW+MapViewOfFile(FILE_MAP_ALL_ACCESS)substituted(00000000)CreateFileMappingW+MapViewOfFile(FILE_MAP_COPY)substituted(00000000)CreateFileMappingW+MapViewOfFile3(MEM_REPLACE_PLACEHOLDER)substituted(00000000)Idea #2 — One
MEM_PRIVATEbacking + GPU-side aliases (CreatePlacedResourceandCreateReservedResource+UpdateTileMappings)CreatePlacedResourcebuffers at offset 0 on oneMEM_PRIVATEheap share writes cleanly (gpu:match,cpu:match).128 KiB)CreateReservedResourcerow-major buffers (D3D12_RESOURCE_FLAG_NONE) and mapped tiles across three separate64 KiBMEM_PRIVATEheaps (A,B,C) and a 2-tile contiguousMEM_PRIVATEheap (D) viaqueue->UpdateTileMappings:A,B) and sub-heap tile offset 1 (D) all match.res1tile 0 (heapA) is immediately visible both on CPU and viares2tile 1 (second alias ofheapA).res1tile 0 fromheapA→heapCviaUpdateTileMappingsreadsCcleanly withGetDeviceRemovedReason() == S_OK(noVirtualFree/unmap needed).(Note: this probe tested
CopyBufferRegionon reserved buffers; CBV/SRV/UAV shader access andALLOW_UNORDERED_ACCESSon reserved buffers still need a quick check.)@JeffreyBytes's
-14(EFAULT) reproductionMEM_PRIVATEpage withOpenExistingHeapFromAddress1, keeping thatID3D12Heapalive, calling eitherVirtualFree(MEM_RELEASE)orVirtualFree(MEM_DECOMMIT), and then submitting a completely unrelatedCopyBufferRegionon two ordinary committed buffers reproduces the crash in one submit:radv/amdgpu: The CS has been rejected, see dmesg for more information (-14)→VK_ERROR_DEVICE_LOST(0x80004005).MEM_PRIVATEbacking mapped until its importedID3D12Heapdrops (and remap GPU aliases in-place viaUpdateTileMappingsor new resources rather than pulling userptr pages out from under a live heap).@gtb-sbe, combined with your measurement in #191,
CreateReservedResource+UpdateTileMappingsalso removes the backing-contiguity requirement for those multi-alias imports (and handles remaps cleanly). Happy to test/benchmark if you're already moving forward with the single-CPU-backingxmemside, or collaborate on splitting thexmem+d3d12pieces once @brcly gives the green light.Imported from brcly/TuxBox. Originally posted by Exorion1er on 2026-11-26T09:15:33Z.
I opened #218 for the d3d12 side of the "one private backing, GPU-side aliases" direction. Before importing, the provider asks XMem which memory holds a guest range and imports that memory instead. It also keeps the memory held until the native heap is gone, which covers the
-14(EFAULT) crash. The contract for XMem is two exports, documented inbacking.rs. Without them nothing changes, so it fits with @gtb-sbe's XMem work rather than overlapping it. Backings that aren't contiguous are left out for now; @DrArroway's reserved-resource probe is the obvious next step there.One data point on the copy fallback from #200: on an RX 9070 (
1002:7550, Mesa 26.2.7, Proton Experimental,31dd5a3), ProjectScarlett runs at about 1 fps in the intro without a preload (11 frames in 10 s, every present sample black), against normal speed with theANONONLYpreload. The host profile reportssection-import=substitutedand the copy path is active.Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-26T11:13:23Z.
Follow-up on the CBV/SRV/UAV footnote above (same setup: RX 6900 XT
1002:73bf,GE-Proton11-14, Mesa RADV26.3.1):CreateReservedResourcewithD3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESSandD3D12_RESOURCE_FLAG_NONEacross 5 separate 64 KiBMEM_PRIVATEOpenExistingHeapFromAddress1heaps succeeded (S_OK) and returned validGetGPUVirtualAddress()values.+256): Compute shader read across non-contiguous tiles 0 & 1 ofsrvResand wrote across non-contiguous tiles 0 & 1 ofuavRes; both CPU pointers and a second reserved buffer aliasing the same destination tiles (swapped) observed the exact results.GetGPUVirtualAddress()): Same result — both CPU and the swapped alias buffer observed the exact shader output.Nice work on #218 (@Exorion1er) and #220 (@JeffreyBytes) — happy to help wire up the non-contiguous
CreateReservedResource+UpdateTileMappingspath on top of #218 if @gtb-sbe's backing-contiguity measurements show it's needed.Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-26T11:59:33Z.
I looked into idea 4 (getting this fixed in Mesa), and I think it can be ruled out. Summary with sources, so nobody has to repeat the search:
radv_amdgpu_winsys_bo_from_ptr()callsac_drm_create_bo_from_user_mem(), which forwards to libdrm'samdgpu_create_bo_from_user_mem(). libdrm hardcodesAMDGPU_GEM_USERPTR_ANONONLY | REGISTER | VALIDATEthere (amdgpu/amdgpu_bo.c, since 2015) and no caller can change it. The kernel then returns-EPERMfor any VMA with a backing file (amdgpu_ttm_tt_get_user_pages()inamdgpu_ttm.c).memfdhost-pointer imports was closed this year as a kernel matter, and a recent kernel fix (d577b68) tightened the anonymous-only check further.udmabufon amemfd, imported as a dma-buf. From a Wine guest that would need a Linux fd for the section, so it is a Wine-side change, not something XMem can do alone.What this means here:
ANONONLYpreload works through a gap the kernel maintainer intends to close. It is fine as a diagnostic, but it can stop working with any kernel update, and it should not become a default.radv_amdgpu_get_bo_list()), and the kernel revalidates each userptr buffer on every submit (amdgpu_cs_parser_bos()). One import whose pages are gone therefore fails all later submits with-EFAULT. That matches thebuffer-unmap-alivecontrol, and it confirms that the hold in #218 is needed rather than a workaround.I read the kernel, libdrm and Mesa sources and the linked threads, but did not test other vendors. From source, i915 and xe have no such file check; I have no information on NVIDIA.
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T15:34:41Z.
@DrArroway, here are the backing-contiguity numbers you asked about. Short answer: the non-contiguous path is needed, for 16 of 131 imports (about 37 % of the imported bytes) in ProjectScarlett.
The model is one private backing per physical page: the page's CPU-used view if it has one, otherwise memory that XMem places. Every other view of the page is a GPU alias. No page was CPU-used through more than one view, so the model fits this title.
Result: These are the 131 imports that contain section views (741 MiB), up to the 22-draws-per-frame state:
CreateReservedResource+UpdateTileMappings, or a copySo no import has scattered CPU memory. The problem is pages that are only GPU aliases.
Why the 16 conflict: The 128 alias-only imports map 6,208 distinct pages, each at 2-7 GPU addresses. With one backing per page, an import is contiguous only if every import of the same pages lists them in the same order. Most do: the pages form 69 consistent chains, the longest 680 pages, without cycles. But 11 pages have two different successors and 12 have two different predecessors across imports.
place_virtual_layout), 3.6-64 MiB each.CPU views don't move: In 20 s rounds over 4-6 min per run, no CPU-used view moved to another address. During loading the title unmaps 4,000-7,000 CPU views within one round, but none of them belongs to a page any import uses. After about one minute the same 3,772 CPU views stay in place. So imports were never retired because a CPU view moved.
How this was measured:
mainf3149ab(#218 merged; XMem doesn't have the backing exports yet, so imports still use the guest address) plus a local trace branch.1002:7590), Mesa 26.2.6 RADV, Linux 6.18, GE-Proton11-14, warm caches, offline, no preload./proc/<pid>/pagemapevery 20 s to see which view of each page the CPU has touched.TUXBOX_HOST_PROFILE=section-import=aliased, because the #200 shadow reads every imported view on the CPU, which would count as CPU use.Limits: One title (ProjectScarlett 1.0.2.1), only up to the Account Picker without input; the intro and gameplay may map memory differently. Pagemap presence counts any touch since the view was mapped.
For comparison: the copy path on this card. Same offline cold start before and after #200:
maincb8c38b9b31fd8section-import=substituted)I can rerun this against an XMem implementation of the backing exports, or post the per-import list if that helps.
Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-26T17:21:07Z.
Thanks @gtb-sbe for measuring the backing contiguity across ProjectScarlett's 131 imports — having those exact counts (16 imports / 277.6 MiB with conflicting page orders, 65 pieces max) settles that the
CreateReservedResource+UpdateTileMappingspath is needed on top of #218.I opened #253 with the
d3d12non-contiguous backing side on top of #218. It keepsTuxBoxAcquirePhysicalBacking+TuxBoxReleasePhysicalBackingunchanged and falls back to an optional third export whenTuxBoxAcquirePhysicalBackingfails withERROR_NOT_SUPPORTED:When exported,
d3d12opens each 64 KiB-aligned run withOpenExistingHeapFromAddress1, maps them onto aCreateReservedResourcebuffer with synchronousUpdateTileMappings, and holds every piece heap + the XMem hold until all native resources on it are released. Like #218, it stays dormant untilxmem.dlladds the backing exports.Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-26T17:52:19Z.
Picking up the
runtime/xmem/half of#191(TuxBoxAcquirePhysicalBacking,TuxBoxAcquirePhysicalBackingRuns, andTuxBoxReleasePhysicalBacking, backed by private anonymous memory + lifetime holds) to pair with#218and#253.Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-26T18:00:49Z.
@DrArroway, glad you're taking the XMem half. I had scoped it this morning before you picked it up, and three things came out of reading the code that I haven't seen mentioned here. They only matter if aliases other than a page's CPU view stop being mapped for the CPU (the "one private backing, GPU-side aliases" model), so ignore whatever doesn't fit your design.
snapshot_mipinruntime/d3d12/src/device/placement.rscopies texture data withReadProcessMemoryfrom the guest address. If that address is an alias with no CPU mapping, the read fails quietly and the snapshot is skipped, so it would need to go through the backing as well.section_probedecidessection-import=aliased|substituted, and on RADV it will keep answeringsubstitutedwhatever XMem does, because sections still can't be imported. The mirror path (needs_mirror) keys off that, so the profile needs a way to learn that XMem pages now import through their backing.runtime/xmem/guest.c(the0x2404/0x10404alias cases around the scatter tests) writes through one view and reads through another, and thebuffer-remapcontrol reads through theCopyPageMappingsdestination. @gtb-sbe's census says ProjectScarlett never does this, but the tests do.Also, for a moved or freed backing with a hold alive: the contract in #218 says the old range stays mapped and its contents no longer matter.
buffer-unmap-aliveshows what happens on amdgpu if it doesn't stay mapped, so a variant of that control on XMem pages (remap and free under a live import, later submits stillok) would catch a regression there. I can write that control against your branch if it helps.And the offer from #218 stands: once the exports exist I'll run ProjectScarlett on the RX 6700 XT without the preload. The device loss comes two to six minutes in here, so it's a quick yes or no.
Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-26T18:18:19Z.
@JeffreyBytes PR is up for the
runtime/xmem/half in #258 (feat/xmem-physical-backing). Here is how each point lands against the implementation:snapshot_mip(ReadProcessMemory): GPU aliases still receive committedMEM_PRIVATEPAGE_READWRITEpages populated when mapped, soReadProcessMemoryat an alias VA continues to succeed without failing.section_probe/needs_mirror:import.rsalready gates mirroring onneeds_mirror(...) && contains_mapped_pages(memory, size). Since XMem backings areMEM_PRIVATE(notMEM_MAPPED), RADV skips the #200 shadow copy automatically—buffer-remaplogsTuxBox d3d12_xs: game memory is imported through its XMem backingandpath=importedwith no shadow copy—while any lazily promotedSharedSectionpages still mirror safely.xmem-pages,xmem-scatter(runtime/xmem/guest.c), andbuffer-remapall pass (tuxbox.py checkon RX 6900 XT1002:73bfis green across all 10 groups). A second CPU view of a token lazily promotes it toSharedSectionfor CPU coherence, andCopyPageMappingspopulates the alias pages.TuxBoxAcquirePhysicalBacking/TuxBoxAcquirePhysicalBackingRunskeep heldMEM_PRIVATEviews andPrivateArenabackings mapped across unmap, remap, and free untilTuxBoxReleasePhysicalBacking(hold)drops the last reference (covered by 4 unit tests inruntime/xmem/src/tests/physical_backing.rs).Would definitely appreciate your XMem
buffer-unmap-aliveregression control and an RX 6700 XT ProjectScarlett run against #258 without the preload!Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-26T21:18:44Z.
A data point from an RDNA 4 card: on current
main,buffer-remappasses here, although the host-memory import is still refused once.Setup. RX 9070 XT (
1002:7550), Mesa RADV 26.3.1, Ryzen 7 9800X3D, Linux 7.3 (CachyOS), GE-Proton11-14, TuxBoxmainat68e79b7, Microsoft DXC v1.8.2505.1.Result.
python tuxbox.py check --proton <GE-Proton11-14> --prefix <fresh prefix> --windows-dxc <dxc x64>: all checks passed. That includes Lanes and fixtures (all guest checks), all 19 D3D12 regression controls (buffer-remap,buffer-import,buffer-import-reject,buffer-unmap-*), and 112/112 translator GPU checks.What
buffer-remap.logshows. The refusal from the report is still there, once:The control nevertheless passes: the readback matches after the fallback to
pool_open. The same refusal also appears once each inroot-cbv-window,buffer-unmap-aliveandbuffer-unmap-released, which pass too.Not established. Whether the difference from the report comes from the newer
main, from GE-Proton11-14 against Proton Experimental 11.0-20261112, or from the card. I have not run the older commit or Proton Experimental here.Related, from another project on the same machine (VIctory forks under Wine + vkd3d-proton, so not TuxBox code). Importing title memory in place worked for private allocations, with GPU and CPU seeing each other's writes. Section-backed / page-pool heaps opened but were not shared: the GPU did not see the CPU's bytes. That is consistent with the guess in the report.
AI assisted (Claude Code)
Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-26T22:07:33Z.
PR #258 (
5a795cb) is now rebased ontoorigin/main(e76ff6a, alongside merged #253) and marked Ready for review.snapshot_mip/ReadProcessMemoryissue @JeffreyBytes flagged earlier (our A/B run againstmainshowed a green screen on video playback untilruntime/d3d12resolved XMem physical backings forsnapshot_mip,write_mapped,validate_shared_range, and CBV/resource mirrors), along with theSystem Initeager-promotion hang.GE-Proton11-14) results: RADVbuffer-remappasses (4.374s,words=768/768,null_fallback_enabled: false,game memory is imported through its XMem backing). In ProjectScarlett, zero-copy import raised intro/menu presentation from9frames / 10s onmain(5c5677bshadow-copy path) to464–503frames / 10s, passed the menu and intro video cleanly, and reachedGame Running(Frame: 5215,TileHeap: 2112Mb / 6236Mb) before an unrelatedradv: GPUVM fault detected at address 0x8004914e0000(after VRAM allocation fallback to system memory, with zeroamdgpukernel hang/reset and zero host-pointerEFAULT).Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-28T15:13:28Z.
Closing as fixed on
main.tools/check_d3d12_regressions.py --case buffer-remappasses on a Radeon 610M (1002:13c0), RADV Mesa 26.3.1, GE-Proton11-14, with a recent build ofmain, and the log shows game memory imported through its XMem backing (#258). #258 also reported it passing on an RX 6900 XT.It hasn't been rerun on the RX 6700 XT from this report. Please reopen if it still fails there.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-28T20:52:37Z.
Reran it on the RX 6700 XT this came from, on
mainatb8355fa:buffer-remappasses, and so dobuffer-layout,buffer-import,buffer-import-reject,buffer-unmap-aliveandbuffer-unmap-released. Log shows the XMem backing import. Fixed here too, thanks.