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
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#1135
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?
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):
/dev/udmabufopens, but/sys/module/udmabuf/parameters/size_limit_mbcan't be read inside Steam's container, sousablestays 0 (host/hos_main.c, theHOS_GUEST_MEMFDblock). WithHOS_GUEST_MEMFD=1the log showsmem: 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/udmabufopens 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).
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
71b1edd8built 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 latervk: dma-bufs of at most 64 MB (udmabuf's limit 64 MB).With
/sys/modulehidden, as a Flatpak does (bwrap --dev-bind / / --tmpfs /sys/module):/dev/udmabufstill 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:
/dev/udmabufopens butsize_limit_mbcan'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.