Render on the GPU with no display, through Xwayland
This VM sees the host's 7900 XT through virtio-gpu and renderD128 is
readable without the video group, so the software rasteriser was never
necessary. What was in the way is that the emulator's `-gpu host` renderer
speaks GLX: with no DISPLAY it cannot open a context at all
("GlxEnginegetDefaultDisplay: Failed to open display 0") and silently falls
back.
So `emu up` now starts a headless sway whose only job is to provide an
Xwayland, and Xwayland's GLX runs on the render node. The guest's GLES
reports `virgl (AMD Radeon RX 7900 XT)` afterwards. One compositor per
machine, on a named socket so a second `emu up` reuses it; no seat, no DRM
master, no card node.
Scrolling a list in the stock Settings app: 25.5% janky frames and 8 slow
UI-thread frames on software, 3.3% and 0 on the GPU. An emulator also costs
1.1 GB less resident (2.9 GB against 3.9 GB), which is real headroom on a
machine that only takes two.
The reason this is worth the machinery is measurement rather than speed.
Before it, frame timings from in here said nothing about an app at all --
ai-app scrolled *better* than Settings, because both were bounded by the
rasteriser rather than by anything either was doing.
Host Vulkan is off in `GPU_HOST_FEATURES`, and that one is a bug rather than
a preference: gfxstream asks Venus for a memory type for its ColorBuffers
that Venus does not offer, and the emulator dies before adb sees it. GLES is
unaffected. Retry it whenever mesa moves; the failure is loud.
A missing sway, or one that will not start, says so and falls back to
software exactly as before -- verified by moving the config aside.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe97956632
commit
1d71730b56
3 files changed
+137
-2
No files matched your search
@@ -0,0 +1,23 @@
|
||||
# The compositor `emu` starts when this machine has no display, so that the
|
||||
# Android emulator has an X server to talk to.
|
||||
#
|
||||
# Nothing here is meant to be looked at; there is no screen. The point is
|
||||
# Xwayland: the emulator's `-gpu host` renderer speaks GLX, and with no
|
||||
# DISPLAY at all it falls back to a software rasteriser. Xwayland's GLX is
|
||||
# backed by this VM's virtio-gpu render node, so the guest's GLES ends up on
|
||||
# the host's real GPU.
|
||||
#
|
||||
# `xwayland force` starts it immediately rather than at the first X client,
|
||||
# so `emu` can read DISPLAY out of a running compositor instead of racing it.
|
||||
xwayland force
|
||||
|
||||
# Sized to a phone so the emulator's window is never scaled or clipped. It is
|
||||
# larger than any AVD here; an output smaller than the window is the one way
|
||||
# this arrangement can affect what the emulator renders.
|
||||
output HEADLESS-1 mode 1440x3120@60Hz
|
||||
|
||||
# No bar, no wallpaper, no keybindings, no pointer follow: each of those is a
|
||||
# client to start or a thing to go wrong on a machine with nobody at the
|
||||
# keyboard, and none of them has anything to draw on.
|
||||
default_border none
|
||||
focus_follows_mouse no
|
||||
Reference in new issue
Block a user