Repository navigation
Description
Context
The reported case is an OBS-only crash while a recording runs; Veshell and the session keep running.
Kernel log, three occurrences:
11:13:11 amdgpu: ring gfx timeout, signaled seq=6900886, emitted seq=6900889
11:13:11 amdgpu: Process obs pid 187805 thread obs:cs0 pid 187823
11:14:30 amdgpu: ring gfx timeout, signaled seq=6925243, emitted seq=6925245
11:14:30 amdgpu: Process obs pid 188545 thread obs:cs0 pid 188565
11:17:57 amdgpu: ring gfx timeout, signaled seq=6964313, emitted seq=6964315
11:17:57 amdgpu: Process obs pid 190819 thread obs:cs0 pid 190834
Each time the hung gfx job is OBS's own (obs:cs0), the kernel resets the gfx ring, and Mesa aborts OBS (SIGABRT). OBS was recording /dev/video0 (2560x1440 NV12 @60) with ffmpeg_vaapi_tex, not a Veshell screen cast, so the shell's capture/ and portal code is not involved.
There was also a separate 11:12:21 event where the pending submission named veshell:cs0 and the session did end. This issue is not claiming Veshell causes the OBS gfx timeout. It tracks the GPU work Veshell can control, so the shell is not adding avoidable load to a recording session and not driving clients to render when nothing displays them.
Findings
1. Frame callbacks are sent to every surface every vblank
deliver_vsync_tick sends send_frames_surface_tree to every toplevel, every popup and every X11 surface, regardless of whether the shell displays them:
src/embedder/backend/drm_backend.rs(deliver_vsync_tick, around thexdg_shell_state.toplevel_surfaces()loop)src/embedder/backend/winit.rs(same loop)
An ephemeral window is only displayed while the overview is open and its tab is selected (OverviewContentBody -> EphemeralWindowWidget), yet its client keeps receiving frame callbacks at the monitor refresh rate while it is hidden. The same is true for tiles in non-selected workspaces and for minimized/occluded windows. A client that repaints continuously (camera preview, video, animations) therefore keeps rendering at 60 fps with nothing on screen consuming it.
Caveat for this case: a recorder like OBS may depend on frame callbacks to keep its graphics thread (and therefore its encoder) moving. If the shell stops callbacks for an OBS window because it is not displayed, the recording could stall. So this is not a blind throttle:
- a hidden surface may only be throttled to a slow heartbeat, or
- clients need a way to declare "I must keep rendering", or
- the change is scoped to surfaces that are not the source of a live capture and are not a known recording process (cgroup/provenance), and must be validated with a hidden OBS recording before landing.
The exception set that must stay live regardless: window sources of a live portal screen cast (schedule_window_frame_delivery explicitly keeps an occluded-but-updating client refreshing), gaming-mode surfaces, popups of visible parents, and the keyboard/pointer-focused surface.
2. glFinish() on every Flutter present
present_view_callback in src/embedder/flutter_engine/compositor.rs calls flutter_engine.renderer_data.gl.Finish() before accepting every presented frame. That is a full GPU sync per frame. It is worth auditing whether the backing-store handoff really needs a hard glFinish, or whether a render fence / SyncPoint would keep the same correctness without serializing the raster thread behind all GPU work (including another client's).
3. Overview frost
OverviewBlurTarget wraps the desktop in an ImageFiltered blur + saturation + procedural noise (FrostedSurface) while the overview is open. The current comment says it is cached by a RepaintBoundary as long as the desktop behind does not repaint.
A probe measurement at 1280x800 with a continuously repainting weston-simple-egl window behind the overview gave roughly 8–20 % GPU busy closed vs 11–26 % open, so it looked cached there. That needs repeating at 2560x1440 (the affected output) and with a live ephemeral surface in the overview content; if the frost is re-rastered whenever the overview content repaints, it should be cached into an offscreen image instead of being re-applied live.
Proposed work
- Measure first: with the probe, a continuously repainting window (
weston-simple-egl) as a tile and as an ephemeral window, hidden vs displayed, at 1280x800 and 2560x1440. Recordgpu_busy_percentand frame timings. - Decide whether hidden-surface frame callbacks may be throttled at all without stalling a recording app. If not, drop that item and keep the measurement/audit results.
- If it is safe, give Rust a set of surfaces the shell is currently displaying, fed from Flutter (e.g. a
set_visible_surfacesrequest on change, sharing the probe's painted rules), and send frame callbacks only to that set plus the exception list above. - Add a probe scenario: a continuously repainting window is hidden (overview closed / another workspace) and stops or slows painting; it resumes immediately when shown. Verify a hidden OBS recording keeps recording.
- Measure the overview frost at 2560x1440: closed vs open, live window visible vs hidden. Cache the frost if it is re-rastered.
- Audit the per-present
glFinish()and replace it with a fence if possible.
Acceptance criteria
- The shell's GPU busy with a hidden animating window drops measurably, without stalling a hidden OBS recording or a live window-share source.
- Visible-window frame pacing is unchanged.
- The overview frost is confirmed cached at 2560x1440, or replaced by a cached offscreen image.
cargo check,cargo test,flutter testand the probe checks are green.
References
- Incident evidence:
journalctl2026-11-09 11:13:11 / 11:14:30 / 11:17:57 (ring gfx timeoutnamingobs:cs0); OBS logs2026-11-09 11-12-44.txt,11-13-23.txt,11-14-23.txt,11-17-15.txt. src/embedder/backend/drm_backend.rs—deliver_vsync_ticksrc/embedder/backend/winit.rs— per-vsync frame callbackssrc/embedder/flutter_engine/compositor.rs—present_view_callbacksrc/shell/lib/overview/widget/overview_blur_target.dart,src/shell/lib/shared/widget/frosted_surface.dartsrc/shell/lib/overview/widget/overview_content_body.dart(ephemeral surface is only mounted while displayed)
Activity
[-]perf(gpu): stop driving frame callbacks for undisplayed surfaces and verify the overview cost[/-][+]perf(gpu): audit and reduce Veshell's avoidable GPU work during recording[/+]