Skip to content

gpu browser frames on linux over dmabuf - #107

Merged
thdxr merged 1 commit into
devfrom
linux-browser-gpu
Nov 18, 2026
Merged

thdxr merged 1 commit into
devfrom
linux-browser-gpu

Conversation

@thdxr

@thdxr thdxr commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

chromium renders on the hardware gpu (angle on vulkan, webgl and webgpu both work) and frames reach the app as dmabufs with no cpu copy, like iosurfaces on macos and shared textures on windows.

  • only x11 ozone gives windowless cef dmabufs (wayland ozone and headless can't allocate them), so when the app imports dmabufs and an x server actually answers (xwayland), the engine uses x11. flags: --use-gl=angle --use-angle=vulkan --enable-features=Vulkan,WebGPUService,VulkanFromANGLE,DefaultANGLEVulkan. without VulkanFromANGLE,DefaultANGLEVulkan webgl canvases reached x11 frames black; without Vulkan webgpu has no adapter
  • cef 156 hands linux frames over before the gpu finishes them (viz only waits for mappable shared images, not native-pixmap ones). measured: 59 of 60 frames still unsignalled on arrival, 0.06 to 2.8 ms to finish. the engine waits on the buffer's implicit fences (DMA_BUF_IOCTL_EXPORT_SYNC_FILE) before its egl copy
  • the engine copies into 3 linear dmabufs per tab and sends their fds once over the socket (scm_rights, tied to the line they came with). the app says when its gpu read a frame (FrameRead with the pool id, on that connection only) and that read is what repaints a starved tab, so no timer
  • per-tab frames are one state machine: no buffers / shared / read back. if the app can't show the buffers the engine reads frames back to bgra with the same browsers, so history, scroll and devtools stay. hidden tabs and bgra tabs give their buffers back
  • without x or dmabuf import: bgra paints on the session's backend, still gpu rendered. no display at all: says so and runs headless (only the repo's tooling does that)
  • the bgra reader only scans new bytes now: a 2560x1600 paint's line costs about 2 ms of reader cpu, was about 240 ms
  • rune is pinned to linux: show dmabuf frames from another process rune#862 (061c218), needs a bump to dev once it lands. engine revision 2. desktop keeps --pointer/--keys in release (keys-overlay)

measured on an amd 8060s (radv, niri + xwayland). a headless stand-in for the app draws the surface through rune whenever a frame arrives, 1600x1200, css animation page, medians:

dmabuf bgra
open to first gpu frame, cold engine (5 runs) 338 ms 366 ms
open to first gpu frame, after Browser:Prepare 116 ms 126 ms
cpu app / engine / gpu process (10 s, 3 runs) 2.4% / 4.3% / 5.0% 9.7% / 12.5% / 11.6%
rss app / engine / gpu process 90 / 342 / 186 MB 83 / 268 / 175 MB

also checked: 60 fps with pixels matching bgra on css, webgl and webgpu pages; an animation that stops then a js update 4 s later still shows (no freeze); killing the engine mid-stream then retry keeps frames flowing with no torn frames; a simulated import failure keeps the page's history and scroll.

not tested: nvidia, multi-gpu, a real desktop window.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

PR test build retired — merged into dev. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode/desktop-rune/dev/macos-arm64-dmg.

@thdxr thdxr changed the title vulkan for the linux browser gpu browser frames on linux over dmabuf Nov 13, 2026
@thdxr
thdxr marked this pull request as ready for review November 13, 2026 05:27
@thdxr
thdxr force-pushed the linux-browser-gpu branch from ec5d877 to b7b3412 Compare November 18, 2026 18:27
@thdxr
thdxr force-pushed the linux-browser-gpu branch from b7b3412 to ce32258 Compare November 18, 2026 18:32
@thdxr
thdxr merged commit 5b722c6 into dev Nov 18, 2026
5 checks passed
@thdxr
thdxr deleted the linux-browser-gpu branch November 18, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant