Skip to content

Model M under executor dx12: a fixed 2.5 GiB measuring arena at every context creation #38

Open

Description

@phantoslayer21

Discussion #10 reports that Model M allocated a 2,560 MiB buffer next to its 706 MiB arena. That buffer is the first of
two arenas the D3D12 executor creates on the game's device (clean/runtime/interop/executor_d3d12.cpp,
prepare_device): pass 1 makes a device with the default arena (WG_D3D12_ARENA_MB, default 2560 MiB,
clean/runtime/device_d3d12.cpp), runs the whole runtime creation to measure the highest arena offset the network
uses, and destroys it; pass 2 makes the arena that stays, sized to that measurement plus 1 MiB.

What could be better:

  • The measuring arena is a fixed 2.5 GiB whatever the render and output size, so every context creation briefly
    commits 2.5 GiB on the game's device on top of what the game holds, even when the context needs far less. On 8 GB
    cards (RX 9060 XT / 9060, see Test reports wanted: RX 9060 XT, RX 9060 and 8 GB cards #3) that is a large share; if the allocation keeps failing for 5 s, Model M falls back.
  • Pass 1's device has no log sink, so its teardown lines are dropped. If its teardown cannot confirm completion, the
    device keeps its GPU objects, the 2.5 GiB arena included, until the game exits, and WrongGPU's log says nothing.
    That would match the report of both buffers side by side.
  • The default and the two passes are documented only in code comments.

To do: first check on Windows and under Proton whether the 2.5 GiB buffer is still allocated after creation (video
memory before, during and after Model M's create). Then options to discuss: measure the need without a full-size arena
(a size from the context's render and output size, or a first pass that only counts allocations), give pass 1's device
the same log sink so its teardown is visible, and document the transient size. The output must stay bit-identical.

Related: Discussion #10, #3

Activity

  1. added this to the Later milestone on Nov 13, 2026
  2. j0nsh1n commented on Nov 13, 2026

    @j0nsh1n
    Contributor

    Checked under Proton, as asked: the 2.5 GiB measuring arena is allocated at Model M's creation and released again within about half a second. It did not stay alive next to the real arena in this run.

    Setup:

    Timeline, relative to OptiScaler's "Creating FSR 3.X upscaler feature" for WrongGPU (15:51:00.18 in OptiScaler.log):

    Time VRAM used
    just before 8.1 GB
    +0.02 s 9.4 GB
    +0.12 s 12.7 GB
    +0.23 s 10.1 GB
    +0.54 s and after 9.45 GB, steady

    So the peak was about +3.3 GB over the level just before, which fits the 2,560 MiB pass-1 arena plus the second arena and the game's own allocations around the same moment. The level settled about 1.3 GB higher. At 10 samples a second the true peak may have been briefly higher than what was recorded.

    What this doesn't cover: Windows; an 8 GB card, where the +3.3 GB moment is the real risk (#3); and a context re-created at a resolution change. Pass 1's teardown lines still don't reach the log, so the log alone couldn't have shown this.

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

    area: runtimeModel M runtime and kernelsenhancementNew feature or requestneeds-hardware-testNeeds a run on real hardwareperformanceSpeed of the runtime or kernels

    Projects

    • Status
      Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions