Game: under Steam on Linux, guest memory falls back to host-pointer imports because udmabuf's size_limit_mb can't be read (8 fps on an AMD APU) #1135

Open
opened 2026-11-16 14:25:17 +00:00 by willcrisis · 1 comment

Started from Steam (Game Mode, Flatpak Steam), the game falls back to the slow host-pointer memory path on an AMD APU. On a ROG Ally X it ran at 6–10 fps at Death Mountain Trail, and at about 30 fps with HOS_GUEST_MEMFD=1. Started from the desktop, the same build picks the memfd path by itself.

What the log says (under Steam):

[hos host] mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read

/dev/udmabuf opens, but /sys/module/udmabuf/parameters/size_limit_mb can't be read inside Steam's container, so usable stays 0 (host/hos_main.c, the HOS_GUEST_MEMFD block). With HOS_GUEST_MEMFD=1 the log shows mem: the guest window is a memfd's (15), shared with the GPU as dma-bufs, and play works normally (no import errors, several hours of play on rc.4 and rc.5).

A possible fix: when /dev/udmabuf opens but the limit can't be read, assume udmabuf's default of 64 MB rather than 0. The code already splits a pool larger than the limit into several dma-bufs, so a too-small guess costs only more dma-bufs, not the import.

Hardware: ROG Ally X (Ryzen Z1 Extreme, RADV PHOENIX, Mesa 26.2.6), Anatase (Fedora-based), kernel 7.3.4, Steam Game Mode (gamescope, Flatpak Steam). rc.3, rc.4 and rc.5 behave the same way.

Related: #309 (unified memory on AMD APUs; its Deck comment shows the memfd path working there).

Started from Steam (Game Mode, Flatpak Steam), the game falls back to the slow host-pointer memory path on an AMD APU. On a ROG Ally X it ran at 6–10 fps at Death Mountain Trail, and at about 30 fps with `HOS_GUEST_MEMFD=1`. Started from the desktop, the same build picks the memfd path by itself. **What the log says (under Steam):** ``` [hos host] mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read ``` `/dev/udmabuf` opens, but `/sys/module/udmabuf/parameters/size_limit_mb` can't be read inside Steam's container, so `usable` stays 0 (`host/hos_main.c`, the `HOS_GUEST_MEMFD` block). With `HOS_GUEST_MEMFD=1` the log shows `mem: the guest window is a memfd's (15), shared with the GPU as dma-bufs`, and play works normally (no import errors, several hours of play on rc.4 and rc.5). **A possible fix:** when `/dev/udmabuf` opens but the limit can't be read, assume udmabuf's default of 64 MB rather than 0. The code already splits a pool larger than the limit into several dma-bufs, so a too-small guess costs only more dma-bufs, not the import. **Hardware:** ROG Ally X (Ryzen Z1 Extreme, RADV PHOENIX, Mesa 26.2.6), Anatase (Fedora-based), kernel 7.3.4, Steam Game Mode (gamescope, Flatpak Steam). rc.3, rc.4 and rc.5 behave the same way. Related: https://git.magicbean.dev/MagicBeanDev/Longshot/issues/309 (unified memory on AMD APUs; its Deck comment shows the memfd path working there).

Reproduced on a desktop, and I'm taking this one (AI-assisted: Claude Code).

Setup: RX 6700 XT (RADV NAVI22, Mesa 26.2.6), Bazzite (Fedora 45), kernel 7.2.15, main 71b1edd8 built as the Linux AppImage, then the game from a 1.1.1 dump.

Without a container: mem: the guest window is a memfd's (6), shared with the GPU as dma-bufs, and later vk: dma-bufs of at most 64 MB (udmabuf's limit 64 MB).

With /sys/module hidden, as a Flatpak does (bwrap --dev-bind / / --tmpfs /sys/module): /dev/udmabuf still opens, and the log says the same thing as in the report: mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read.

Plan:

  1. A game-free test that fails on main.
  2. The fix: when /dev/udmabuf opens but size_limit_mb can't be read, use udmabuf's default of 64 MB. A pool larger than that is already split into several dma-bufs, so a guess that is too small only means more dma-bufs.
  3. An in-game A/B in the same sandbox (memory path and fps, Kokiri Forest).
Reproduced on a desktop, and I'm taking this one (AI-assisted: Claude Code). **Setup:** RX 6700 XT (RADV NAVI22, Mesa 26.2.6), Bazzite (Fedora 45), kernel 7.2.15, main `71b1edd8` built as the Linux AppImage, then the game from a 1.1.1 dump. **Without a container:** `mem: the guest window is a memfd's (6), shared with the GPU as dma-bufs`, and later `vk: dma-bufs of at most 64 MB (udmabuf's limit 64 MB)`. **With `/sys/module` hidden, as a Flatpak does** (`bwrap --dev-bind / / --tmpfs /sys/module`): `/dev/udmabuf` still opens, and the log says the same thing as in the report: `mem: guest memory stays host-pointer imports for the GPU (slow submissions on AMD): udmabuf's size_limit_mb cannot be read`. **Plan:** 1. A game-free test that fails on main. 2. The fix: when `/dev/udmabuf` opens but `size_limit_mb` can't be read, use udmabuf's default of 64 MB. A pool larger than that is already split into several dma-bufs, so a guess that is too small only means more dma-bufs. 3. An in-game A/B in the same sandbox (memory path and fps, Kokiri Forest).
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#1135
No description provided.