Skip to content

d3d12: since 9c3cf86f, queue page mappings of section-backed pages return E_NOTIMPL on RADV (Lanes ray-tracing-rehydrate regressed) #656

Backlog

Description

@gtb-sbe

What I see

On main 1b4ed47 with default settings, tuxbox.py verify --only lanes-selftest fails two scenarios on my RX 9060 XT. Both get E_NOTIMPL from the queue's page-mapping call:

lanes-selftest FAIL queue-page-mappings: copy ordered GPU mapping failed: 0x80004001
lanes-selftest FAIL ray-tracing-rehydrate: map physical pages for the GPU failed: 0x80004001

ray-tracing-rehydrate passes on 6d4f1cd, the parent of 9c3cf86, with the same card, Proton, prefix and settings. It also passed in my gate on 9a19c76 this morning. queue-page-mappings is new in 9c3cf86, so I have no earlier result for it.

The full check on 1b4ed47 also fails one D3D12 regression control the same way, buffer-remap (d3d12-buffer-remap failed: queue page mapping failed: 0x80004001). All controls passed in this morning's gate on 9a19c76.

Both builds report the same host profile:

host profile: adapter=1002:7590 wave=32-64 section-import=substituted descriptor-bytes=32/16 mesh=yes rays=yes doubles=yes

Why

9c3cf86 moved CopyPageMappingsX and CopyPageMappingsBatchX onto the D3D12 tile path. When device/heap/gpu_tiles.rs builds the tile for a source page, it refuses a page whose XMem backing is section-mapped on a host that needs a mirror (lines 76-81):

if shadow::contains_mapped_pages(base, TILE_BYTES)
    && super::super::host_profile::needs_mirror(super::super::host_profile::section_import(device))
{
    // A CPU-to-GPU mirror would lose writes through an alias on another queue.
    return Err(E_NOTIMPL.into());
}

needs_mirror holds for substituted and refused, which is the RADV case (#191, #200, docs/USAGE.md). Since #464 XMem backs every physical page with its section by default. So on these hosts every queue page mapping of title pages takes this branch. revonateB0T's #653 points at the same lines for queue-page-mappings on a Radeon 780M. ray-tracing-rehydrate isn't in their failure list, and I can't tell why from the code: I don't see a host-dependent default for private views.

I checked that this is the branch:

  • With TUXBOX_HOST_PROFILE=section-import=aliased, both scenarios get past the mapping call. Then they read zeros, as expected when the GPU reads other memory: mapping order sample 0: expected 0xabcd0001, got 0 and ray 2: expected instance 7 geometry 1 primitive 0 at 6.000, found -1 -1 -1 at 0.000.
  • With TUXBOX_XMEM_PRIVATE_VIEWS=1 (private backing), ray-tracing-rehydrate passes. queue-page-mappings gets further and then fails with place aliased draw target failed: 0x80004001. Before that, the provider logs command list cannot record cannot order buffer and texture accesses: HRESULT(0x80004001) (handoffs::plan refuses mirrored buffers, from 1ce5073) and resource slot 44 failed 0x80004001: dim=3 16x16x1 mips=1 format=28 samples=1 layout=0x105 flags=0x1 align=0x0 initial=0x4. For that run I staged the Windows DXC beside lanes.exe, because the scenario needs dxcompiler.dll.

What it may mean for ProjectScarlett (not run yet)

According to 1b4ed47's message, the title fills its streamed GPU address space (0x900200000, 24 GiB, profile 0x3) from a copy queue with CopyPageMappingsBatchX. While those batches failed with E_INVALIDARG, the title ignored the failures: the intro video was green, the loading screen had no characters, and a CBV crashed vkd3d. On a RADV host with default XMem views, I'd expect the same batches to fail now with E_NOTIMPL from this branch whenever their source pages are section-backed. That's inferred from the code and the two scenarios; I haven't run the game on 1b4ed47. NickStallman's chain on #533 (RTX 5090) ends on the same cannot order buffer and texture accesses refusal. On this card Lanes only gets that far with private views, because the mapping call is refused first.

Question

Is this refusal meant to stay on hosts that mirror, with private views as the way to run on RADV for now? Or is a path for section-backed sources planned there? In either case, the Lanes self-test now fails on RADV with default settings, so AMD contributors will see these two failures in every gate.

Setup: RX 9060 XT (1002:7590, RDNA4), Mesa 26.3.1 RADV, kernel 6.18, GE-Proton11-15, NixOS.

AI use

I worked on this with an AI coding agent (Claude Code, following AGENTS.md). It ran the Lanes self-test on 1b4ed47, ran the two failing scenarios alone with provider logging, with the host-profile override and with private views, built 6d4f1cd as the control, and traced the E_NOTIMPL to the lines above. All results come from my machine.

Activity

  1. DrArroway commented on Dec 2, 2026

    @DrArroway
    Contributor

    Confirmed on AMD Radeon RX 6900 XT (1002:73bf) (Mesa RADV, GE-Proton11-15, section-import=substituted) with default section-backed XMem:

    • lanes-selftest-queue-page-mappings, lanes-selftest-ray-tracing-rehydrate, and the buffer-remap D3D12 regression control (d3d12-buffer-remap failed: queue page mapping failed: 0x80004001) all fail with E_NOTIMPL (0x80004001) on 1b4ed472 (observed while running tuxbox.py check on PR #653 / a6f3e098 based on 1b4ed472).

    Live ProjectScarlett check on 1b4ed472

    Since the issue description noted ProjectScarlett hadn't been run on 1b4ed472 yet: on AMD Radeon RX 6900 XT (1002:73bf), a run on main 1b4ed472 compiled shaders cleanly, reached 14,076 presented frames (~70–81 FPS, no black screen), and exited after 197.2s with exit code 2 (RaiseFailFastException, c0000602) on:

    Project TuxBox: import SRV at 0xd402c1000, 44048 bytes stride=4 fmt=39 first=0 count=11012 failed HRESULT(0x80004001) (mirror HRESULT(0x80004001); D3D12 byte offsets; region (
        0x900200000,
        0xd402c1000,
        0x1bff3f000,
        0x2000,
        0x0,
    ), placement stride 1)
    

    With 1b4ed472 giving the 0x900200000 graphics aperture a GPU reservation ID:

    1. buffer_at (runtime/d3d12/src/device/views/addressed.rs) returned E_NOTIMPL on the MEM_RESERVE page inside that aperture.
    2. The srv_mirror fallback (runtime/d3d12/src/device/views/mirrors.rs) called guard_fixed_resource -> fixed_placement (runtime/d3d12/src/commands/page_mapping/buffers.rs), which also returned E_NOTIMPL because state.reservations already had page entries in that range.

    Note on origin/main advancing to c1139ab2

    c1139ab2 just landed gpu_buffer_for_view for GPU-reservation SRVs and relaxed fixed_placement / handoffs::plan, however runtime/d3d12/src/device/heap/gpu_tiles.rs:136-141 still retains the shadow::contains_mapped_pages(...) && needs_mirror(...) E_NOTIMPL refusal for CopyPageMappingsBatchX on section-backed XMem pages.

    Testing c1139ab2 next on AMD Radeon RX 6900 XT (1002:73bf) (both default XMem and TUXBOX_XMEM_PRIVATE_VIEWS=1).


    AI use: run logs, failure tracing, and this summary were prepared with Antigravity; all runs were executed on my local machine.

  2. 1093i3511 commented on Dec 2, 2026

    @1093i3511
    Contributor

    Same on an RX 6600 (1002:73ff, RADV / Mesa 26.3.1, GE-Proton11-15, section-import=substituted), on 1b4ed472 and c1139ab2: queue-page-mappings and ray-tracing-rehydrate fail with 0x80004001. With TUXBOX_HOST_PROFILE=section-import=aliased forced, both get past the mapping call and then fail on data (the GPU reads zeros). Details are in #533 issuecomment-7354129812, which I posted before I saw this issue.

  3. brcly commented on Dec 2, 2026

    @brcly
    Owner

    Fixed on main in 106120c. Thanks for the clear report, and to the others who confirmed it on their cards.

    Cause. As you found: since 9c3cf86 a queue page mapping imports each page as a D3D12 tile heap, and a host whose profile shows section-import=substituted or refused can't be given a section page that way. Since #464 XMem backs every page with its section, so on those hosts every queue page mapping was refused.

    Fix. At the first device, after the section probe, the provider asks XMem (new export TuxBoxPreferPrivateBacking) to back pages mapped from then on with private memory, which these hosts import directly. Hosts that report aliased are unchanged. TUXBOX_XMEM_PRIVATE_VIEWS still decides when you set it, so =0 keeps sections. The buffer-remap control now loads XMem before creating the device, as a title does; before, XMem wasn't loaded yet when the device was created.

    Private backing then exposed faults in skipping unchanged texture gathers, on any vendor. They were what queue-page-mappings hit after the mapping call got through ("texture readback used the wrong GPU page"). Gathers now watch the host pages the GPU actually reads, not the texture's CPU address. They also gather again after an ordered handoff, after the image is written, and while a remap is pending. The scenario's draw step also needed 4 KiB-swizzled render targets in our XG model, now checked against the GDK's XG: 456 whole layouts identical.

    Tested (Radeon 610M 1002:13c0, RADV; RTX 4070 Ti SUPER 10de:2705; GE-Proton11-14):

    • queue-page-mappings, queue-texture-boundary, ray-tracing-rehydrate and the buffer-remap control pass on the 610M. queue-page-mappings also passes on NVIDIA with sections and with private backing.
    • Full check: AMD 17 passed, 0 failed; NVIDIA 16 passed, 1 failed (formatting, fixed after; not rerun).

    Not tested yet: the game on an AMD card. Pages a title maps before it creates its first D3D12 device keep their sections, so if ProjectScarlett maps some of its streaming pool that early, those pages would still be refused. A run on an RX 6600 / 6900 XT / 9060 XT would tell. If you still see 0x80004001 from a page mapping, please post the log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions