fix(linux): guest memory as dma-bufs under Steam and Flatpak, where udmabuf's size_limit_mb can't be read #1155

Open
pepe999 wants to merge 4 commits from pepe999/Longshot:fix/udmabuf-limit-unreadable into main
First-time contributor

Type: fix · Risk: low · Tested on: Linux (Bazzite), RX 6700 XT, RADV · Needs: Linux, Flatpak Steam on a real AMD setup (a Steam Deck or an APU)

Why

Under Steam's Flatpak, the game on an AMD GPU runs at a few frames a second, though the same build runs normally from the desktop. The Flatpak shows the game /dev/udmabuf but hides /sys/module, where udmabuf's size limit lives. When host/hos_main.c couldn't read that limit, it kept guest memory as host-pointer imports, the slow path on AMD. The renderer never needed that number: when the file can't be read it already uses udmabuf's default of 64 MB.

Fixes #1135.

How to reproduce

Seen on: Linux, AMD (the report: ROG Ally X, Flatpak Steam, Game Mode; here: RX 6700 XT, RADV, Mesa 26.2.6, with Flatpak's view of /sys imitated)
Settings and switches: defaults; HOS_GUEST_MEMFD unset
Steps: start the game with /sys/module hidden: bwrap --dev-bind / / --tmpfs /sys/module -- ./bin/longshot, then load a save
Expected: mem: the guest window is a memfd's ..., then vk: guest memory as dma-bufs: yes, at the same fps as a start from the desktop
Actual: mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read; 1-4 fps in Link's house

What changed

If /dev/udmabuf opens, the guest window is now a memfd, whether or not size_limit_mb can be read. The renderer reads the limit itself and falls back to 64 MB, as before. A guess that is too small only splits pools into more dma-bufs.

  • host: the start-up block in host/hos_main.c (the one HOS_GUEST_MEMFD overrides) no longer reads the limit into limit_mb. It only opens the file to log mem: udmabuf's size_limit_mb cannot be read (in a container?): its default, 64 MB, assumed when that fails. The host-pointer message now covers only /dev/udmabuf failing to open.
  • tests: new tests/test_udmabuf_limit_unreadable.py. It cuts that block out of hos_main.c and runs it with the limit file missing, holding 64, 256, 0, no number and nothing, and with /dev/udmabuf not opened.
  • docs: one paragraph in the README's Advanced Linux setup, and six run files in docs/tested/.

Measurements

Verdict: under the sandbox, main runs at 1.0-3.9 fps and this PR at 55.2-58.2 fps (medians), the same as main started without a sandbox (53.3-54.2). The slow path is gone.

Hardware: Bazzite (Fedora 45), KDE Plasma Wayland, kernel 7.2.15; AMD Radeon RX 6700 XT, RADV NAVI22, Mesa 26.2.6; Intel Core i7-14700F, 32 GB
Scene: Link's house (repo save kokiri-start), standing still; output 2560x1440, quality preset 6, the game's own upscaler, HOS_DYNRES=0, HOS_FPS_MAX=1000, frame generation off, headless, audio off
Method: scripts/dev_build.py base at main 71b1edd8, this branch as a pack, rt and rt --empty from that base. longshot_ctl.py launch --repo-save kokiri-start --headless with --wrapper '["bwrap","--dev-bind","/","/","--tmpfs","/sys/module","--"]'; A pressed until state is play, 20 s warm-up, then status.fps once a second for 40 s. One warm-up run of main first, then main and the PR interleaved 3 times; the median of each run.
How to reproduce: the commands above, from any Linux PC with /dev/udmabuf access and an AMD GPU

Run Before, sandbox: main @ 71b1edd8 After, sandbox: this PR @ 11c805d4 Before, no sandbox: main @ 71b1edd8
1 3.9 (1.0-21.6) 58.2 (55.1-61.1) 54.2 (49.3-60.2)
2 1.0 (0.0-3.0) 56.2 (51.3-62.1) 53.3 (44.4-61.1)
3 1.0 (1.0-9.8) 55.2 (52.2-59.2)
Median of runs 1.0 56.2 53.8

Pipelines created were about the same on every run (9,421-9,582), so neither side was compiling while it was measured.

main, sandbox:
mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read
vk: guest memory as dma-bufs: no (the window is anonymous memory)
vk: 4320 presents, 3.4 fps; a frame: 690 draws (0 skipped), 108 dispatches, 149 passes, 164 barriers, 6 submits, ...

this PR, sandbox:
mem: the guest window is a memfd's (7), shared with the GPU as dma-bufs
mem: udmabuf's size_limit_mb cannot be read (in a container?): its default, 64 MB, assumed
vk: guest memory as dma-bufs: yes
vk: dma-bufs of at most 64 MB (udmabuf's limit 64 MB); larger pools are several, in a sparse buffer
vk: 10920 presents, 58.5 fps; a frame: 685 draws (0 skipped), 98 dispatches, 149 passes, 144 barriers, 6 submits, ...

Flags and settings

None. HOS_GUEST_MEMFD=0 and =1 still force each path, as before.

Testing

Tested:

  • Game-free: tests/test_udmabuf_limit_unreadable.py fails on main (got usable=0), passes here, and fails again with the fix's usable = 1 turned back to 0. tests/test_udmabuf_warning.py, which cuts the code just above, still passes.
  • tests/run_all.py: 573 passed, 14 failed, 91 skipped. The same 14 fail on main 71b1edd8 on this PC (missing Vulkan/SPIR-V headers and clang on the host, and Popen mocks): test_linux_update, test_make_game_cache, test_crt_options, test_failed_compile_keeps_objects, test_dlss_feature_size, test_guest_imported, test_bug_report_defaults, test_link_skip, test_missing_nup, test_pending_guest_import, test_mods_size_table, test_run_all_changed, test_walk_key, test_vk_occlusion_queries.
  • In the game: the Measurements above. Linux, RX 6700 XT, RADV, Mesa 26.2.6; Link's house; sandbox and no sandbox; built with the player's tools (tools.lock) through dev_build.py.

Not tested:

  • Real Flatpak Steam and Game Mode: this PC has native Steam, so the Flatpak's /sys was imitated with bwrap.
  • Windows: the changed block is inside the Linux branch of hos_main.c and is not built there.
  • NVIDIA on Linux: the renderer already skips dma-bufs on NVIDIA's driver (vk_memory.cpp), whatever the window is.

Must be tested:

  • Linux, AMD APU or Steam Deck, Flatpak Steam (Game Mode if possible): start the game from Steam, load a save and read longshot_log.txt, expecting mem: the guest window is a memfd's and its default, 64 MB, assumed, with fps near a desktop start's (the reporter saw 6-10 fps before and ~30 with HOS_GUEST_MEMFD=1) (Test Farm: @Beanstalk linux amd steamdeck, start under Flatpak Steam and compare fps with main)

Risks

What could break: a container that shows /dev/udmabuf but whose real limit is below 64 MB would get dma-bufs udmabuf refuses. That is the renderer's existing fallback, untouched here, and it already applies to a readable limit of 0.

Turning it off: HOS_GUEST_MEMFD=0 (anonymous memory, as before), or revert the commit.

Compatibility: nothing changes: no saves, options, caches, vk ABI or builder tools touched.

Issues

Fixes #1135

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A game-free test added for the fix, failing on main and passing here.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux built and run; the changed block is Linux-only.)
  • Docs updated.
**Type:** fix · **Risk:** low · **Tested on:** Linux (Bazzite), RX 6700 XT, RADV · **Needs:** Linux, Flatpak Steam on a real AMD setup (a Steam Deck or an APU) ## Why Under Steam's Flatpak, the game on an AMD GPU runs at a few frames a second, though the same build runs normally from the desktop. The Flatpak shows the game `/dev/udmabuf` but hides `/sys/module`, where udmabuf's size limit lives. When `host/hos_main.c` couldn't read that limit, it kept guest memory as host-pointer imports, the slow path on AMD. The renderer never needed that number: when the file can't be read it already uses udmabuf's default of 64 MB. Fixes #1135. ## How to reproduce **Seen on:** Linux, AMD (the report: ROG Ally X, Flatpak Steam, Game Mode; here: RX 6700 XT, RADV, Mesa 26.2.6, with Flatpak's view of `/sys` imitated) **Settings and switches:** defaults; `HOS_GUEST_MEMFD` unset **Steps:** start the game with `/sys/module` hidden: `bwrap --dev-bind / / --tmpfs /sys/module -- ./bin/longshot`, then load a save **Expected:** `mem: the guest window is a memfd's ...`, then `vk: guest memory as dma-bufs: yes`, at the same fps as a start from the desktop **Actual:** `mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read`; 1-4 fps in Link's house ## What changed If `/dev/udmabuf` opens, the guest window is now a memfd, whether or not `size_limit_mb` can be read. The renderer reads the limit itself and falls back to 64 MB, as before. A guess that is too small only splits pools into more dma-bufs. - host: the start-up block in `host/hos_main.c` (the one `HOS_GUEST_MEMFD` overrides) no longer reads the limit into `limit_mb`. It only opens the file to log `mem: udmabuf's size_limit_mb cannot be read (in a container?): its default, 64 MB, assumed` when that fails. The host-pointer message now covers only `/dev/udmabuf` failing to open. - tests: new `tests/test_udmabuf_limit_unreadable.py`. It cuts that block out of `hos_main.c` and runs it with the limit file missing, holding 64, 256, 0, no number and nothing, and with `/dev/udmabuf` not opened. - docs: one paragraph in the README's *Advanced Linux setup*, and six run files in `docs/tested/`. ## Measurements **Verdict:** under the sandbox, main runs at 1.0-3.9 fps and this PR at 55.2-58.2 fps (medians), the same as main started without a sandbox (53.3-54.2). The slow path is gone. Hardware: Bazzite (Fedora 45), KDE Plasma Wayland, kernel 7.2.15; AMD Radeon RX 6700 XT, RADV NAVI22, Mesa 26.2.6; Intel Core i7-14700F, 32 GB Scene: Link's house (repo save `kokiri-start`), standing still; output 2560x1440, quality preset 6, the game's own upscaler, `HOS_DYNRES=0`, `HOS_FPS_MAX=1000`, frame generation off, headless, audio off Method: `scripts/dev_build.py` base at main `71b1edd8`, this branch as a pack, `rt` and `rt --empty` from that base. `longshot_ctl.py launch --repo-save kokiri-start --headless` with `--wrapper '["bwrap","--dev-bind","/","/","--tmpfs","/sys/module","--"]'`; A pressed until `state` is `play`, 20 s warm-up, then `status.fps` once a second for 40 s. One warm-up run of main first, then main and the PR interleaved 3 times; the median of each run. How to reproduce: the commands above, from any Linux PC with `/dev/udmabuf` access and an AMD GPU | Run | Before, sandbox: main @ 71b1edd8 | After, sandbox: this PR @ 11c805d4 | Before, no sandbox: main @ 71b1edd8 | |---|---|---|---| | 1 | 3.9 (1.0-21.6) | 58.2 (55.1-61.1) | 54.2 (49.3-60.2) | | 2 | 1.0 (0.0-3.0) | 56.2 (51.3-62.1) | 53.3 (44.4-61.1) | | 3 | 1.0 (1.0-9.8) | 55.2 (52.2-59.2) | | | Median of runs | **1.0** | **56.2** | **53.8** | Pipelines created were about the same on every run (9,421-9,582), so neither side was compiling while it was measured. ``` main, sandbox: mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read vk: guest memory as dma-bufs: no (the window is anonymous memory) vk: 4320 presents, 3.4 fps; a frame: 690 draws (0 skipped), 108 dispatches, 149 passes, 164 barriers, 6 submits, ... this PR, sandbox: mem: the guest window is a memfd's (7), shared with the GPU as dma-bufs mem: udmabuf's size_limit_mb cannot be read (in a container?): its default, 64 MB, assumed vk: guest memory as dma-bufs: yes vk: dma-bufs of at most 64 MB (udmabuf's limit 64 MB); larger pools are several, in a sparse buffer vk: 10920 presents, 58.5 fps; a frame: 685 draws (0 skipped), 98 dispatches, 149 passes, 144 barriers, 6 submits, ... ``` ### Flags and settings None. `HOS_GUEST_MEMFD=0` and `=1` still force each path, as before. ## Testing **Tested:** - Game-free: `tests/test_udmabuf_limit_unreadable.py` fails on main (`got usable=0`), passes here, and fails again with the fix's `usable = 1` turned back to 0. `tests/test_udmabuf_warning.py`, which cuts the code just above, still passes. - `tests/run_all.py`: 573 passed, 14 failed, 91 skipped. The same 14 fail on main `71b1edd8` on this PC (missing Vulkan/SPIR-V headers and clang on the host, and Popen mocks): `test_linux_update`, `test_make_game_cache`, `test_crt_options`, `test_failed_compile_keeps_objects`, `test_dlss_feature_size`, `test_guest_imported`, `test_bug_report_defaults`, `test_link_skip`, `test_missing_nup`, `test_pending_guest_import`, `test_mods_size_table`, `test_run_all_changed`, `test_walk_key`, `test_vk_occlusion_queries`. - In the game: the Measurements above. Linux, RX 6700 XT, RADV, Mesa 26.2.6; Link's house; sandbox and no sandbox; built with the player's tools (tools.lock) through `dev_build.py`. **Not tested:** - Real Flatpak Steam and Game Mode: this PC has native Steam, so the Flatpak's `/sys` was imitated with bwrap. - Windows: the changed block is inside the Linux branch of `hos_main.c` and is not built there. - NVIDIA on Linux: the renderer already skips dma-bufs on NVIDIA's driver (`vk_memory.cpp`), whatever the window is. **Must be tested:** - Linux, AMD APU or Steam Deck, Flatpak Steam (Game Mode if possible): start the game from Steam, load a save and read `longshot_log.txt`, expecting `mem: the guest window is a memfd's` and `its default, 64 MB, assumed`, with fps near a desktop start's (the reporter saw 6-10 fps before and ~30 with `HOS_GUEST_MEMFD=1`) (Test Farm: @Beanstalk linux amd steamdeck, start under Flatpak Steam and compare fps with main) ## Risks **What could break:** a container that shows `/dev/udmabuf` but whose real limit is below 64 MB would get dma-bufs udmabuf refuses. That is the renderer's existing fallback, untouched here, and it already applies to a readable limit of 0. **Turning it off:** `HOS_GUEST_MEMFD=0` (anonymous memory, as before), or revert the commit. **Compatibility:** nothing changes: no saves, options, caches, vk ABI or builder tools touched. ## Issues Fixes #1135 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux built and run; the changed block is Linux-only.) - [x] Docs updated.
Fails on main: with /dev/udmabuf open and /sys/module hidden (a Flatpak's or
Steam's container), host/hos_main.c keeps guest memory as host-pointer imports.

See #1135

Assisted-by: Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
/dev/udmabuf opening is enough: the renderer reads the limit itself and takes
udmabuf's default, 64 MB, when it can't (vk_memory.cpp import_dma_buf), so the
start-up check no longer needs it. The log says when the default is assumed.

Fixes #1135

Assisted-by: Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Assisted-by: Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(readme): udmabuf's default limit is assumed in a container that hides /sys/module
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
7bc5e522e3
Assisted-by: Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Tested in game: RX 6700 XT, RADV NAVI22, Mesa 26.2.6, Bazzite (Fedora 45), kernel 7.2.15: the game started in a Flatpak-like sandbox (bwrap with /sys/module hidden), Link's house from the kokiri-start repo save. main keeps host-pointer imports at 1.0 fps (median of 3 runs); this branch takes the memfd window with 64 MB dma-bufs at 56.2 fps, the same as main started without a sandbox (53.8).

Tested in game: RX 6700 XT, RADV NAVI22, Mesa 26.2.6, Bazzite (Fedora 45), kernel 7.2.15: the game started in a Flatpak-like sandbox (bwrap with /sys/module hidden), Link's house from the kokiri-start repo save. main keeps host-pointer imports at 1.0 fps (median of 3 runs); this branch takes the memfd window with 64 MB dma-bufs at 56.2 fps, the same as main started without a sandbox (53.8).
pepe999 changed title from WIP: fix(linux): guest memory as dma-bufs under Steam and Flatpak, where udmabuf's size_limit_mb can't be read to fix(linux): guest memory as dma-bufs under Steam and Flatpak, where udmabuf's size_limit_mb can't be read 2026-11-16 15:51:20 +00:00
Author
First-time contributor

@Beanstalk linux amd steamdeck: please start the game from Flatpak Steam (Game Mode if the machine has it), load the kokiri-start save and compare main with this PR. Expected: main logs udmabuf's size_limit_mb cannot be read and runs slowly; this PR logs mem: the guest window is a memfd's and its default, 64 MB, assumed, at about the fps of a desktop start. I could only imitate the Flatpak's /sys with bwrap, because my Steam is native.

@Beanstalk linux amd steamdeck: please start the game from Flatpak Steam (Game Mode if the machine has it), load the kokiri-start save and compare main with this PR. Expected: main logs `udmabuf's size_limit_mb cannot be read` and runs slowly; this PR logs `mem: the guest window is a memfd's` and `its default, 64 MB, assumed`, at about the fps of a desktop start. I could only imitate the Flatpak's /sys with bwrap, because my Steam is native.
Member

@pepe999 only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it.

@pepe999 only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it.
Contributor

@Beanstalk steamdeck and handheld: start from Steam in Game Mode (Flatpak), load a save, and compare main with this PR on Death Mountain Trail and Hyrule Field.

Expected on this PR: the log says the guest window is a memfd, and that udmabuf's default of 64 MB is assumed, with fps near a desktop start. On main: udmabuf's size_limit_mb cannot be read, and a few frames a second.

Please report that memfd log line, fps and frame times. The desktop measurement (RX 6700 XT, with /sys hidden) was 1.0 fps on main and 56.2 fps here. The Ally X report was 6-10 fps, becoming about 30 with the memfd path forced on.

@Beanstalk steamdeck and handheld: start from Steam in Game Mode (Flatpak), load a save, and compare main with this PR on Death Mountain Trail and Hyrule Field. Expected on this PR: the log says the guest window is a memfd, and that udmabuf's default of 64 MB is assumed, with fps near a desktop start. On main: udmabuf's size_limit_mb cannot be read, and a few frames a second. Please report that memfd log line, fps and frame times. The desktop measurement (RX 6700 XT, with /sys hidden) was 1.0 fps on main and 56.2 fps here. The Ally X report was 6-10 fps, becoming about 30 with the memfd path forced on.
Member

@TrashPanda only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it.

@TrashPanda only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it.
Member

Code-only review of 7bc5e522e3; informational findings, with final approval left to another reviewer.

P2 — Keep a failed dma-buf capability check from removing the working import path. At host/hos_main.c:186, usable = 1 now also accepts a readable size_limit_mb containing 0. Previously that case selected anonymous memory. Zero is a real integer module setting: Linux's udmabuf implementation rejects nonempty creates when their page count exceeds that zero limit. The renderer instead treats zero as its 64 MiB fallback (gpu/vk/vk_memory.cpp:345–351), so every dma-buf request fails. This is not equivalent to the previous fallback: the window is already MAP_SHARED, and reserve_guest explicitly documents that RADV rejects host-pointer imports of that mapping. If that documented driver behavior applies, import_pool fails too, pool_of returns null (line 3126), and binding callers return empty bindings (lines 3964/4200); guest page-table entries are not published. A hidden, nondefault limit below the assumed piece size exposes the same risk for larger pools. This is a source-derived regression case, not a reproduced driver failure, and does not dispute the reported improvement with the normal limit.

Preserve anonymous memory for a known unusable limit, and validate a usable dma-buf size before committing to the shared-window path when the limit is unknown (or supply a demonstrated compatible fallback). The fixture currently asserts that zero is usable and stops before the ioctl/import path; extend coverage to rejected creates and the resulting backing choice. The description's claim that readable zero already had this fallback is incorrect for the previous startup gate.

The posted RX 6700 XT bwrap results cover the intended hidden-sysfs case. The already-requested real Flatpak Steam/Game Mode AMD/Deck run remains outstanding; no duplicate request is needed. I checked the full diff, startup mapping/cleanup, renderer import and failure consumers, fixture, recorded runs and current comments. No competing active review/revision claim found; no substantive duplicate identified among the shared-file candidates. No tests, builds or game runs performed, and no source changes made.

Code-only review of 7bc5e522e3f74993089d5fb1cc50e8fc5840fb54; informational findings, with final approval left to another reviewer. **P2 — Keep a failed dma-buf capability check from removing the working import path.** At `host/hos_main.c:186`, `usable = 1` now also accepts a *readable* `size_limit_mb` containing `0`. Previously that case selected anonymous memory. Zero is a real integer module setting: [Linux's udmabuf implementation](https://raw.githubusercontent.com/torvalds/linux/master/drivers/dma-buf/udmabuf.c) rejects nonempty creates when their page count exceeds that zero limit. The renderer instead treats zero as its 64 MiB fallback (`gpu/vk/vk_memory.cpp:345–351`), so every dma-buf request fails. This is not equivalent to the previous fallback: the window is already `MAP_SHARED`, and `reserve_guest` explicitly documents that RADV rejects host-pointer imports of that mapping. If that documented driver behavior applies, `import_pool` fails too, `pool_of` returns null (line 3126), and binding callers return empty bindings (lines 3964/4200); guest page-table entries are not published. A hidden, nondefault limit below the assumed piece size exposes the same risk for larger pools. This is a source-derived regression case, not a reproduced driver failure, and does not dispute the reported improvement with the normal limit. Preserve anonymous memory for a known unusable limit, and validate a usable dma-buf size before committing to the shared-window path when the limit is unknown (or supply a demonstrated compatible fallback). The fixture currently asserts that zero is usable and stops before the ioctl/import path; extend coverage to rejected creates and the resulting backing choice. The description's claim that readable zero already had this fallback is incorrect for the previous startup gate. The posted RX 6700 XT bwrap results cover the intended hidden-sysfs case. The already-requested real Flatpak Steam/Game Mode AMD/Deck run remains outstanding; no duplicate request is needed. I checked the full diff, startup mapping/cleanup, renderer import and failure consumers, fixture, recorded runs and current comments. No competing active review/revision claim found; no substantive duplicate identified among the shared-file candidates. No tests, builds or game runs performed, and no source changes made.
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/udmabuf-limit-unreadable:pepe999-fix/udmabuf-limit-unreadable'
git switch 'pepe999-fix/udmabuf-limit-unreadable'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1155
No description provided.