omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Screen recording crashes on AMD Baffin dual-GPU MacBook: amdgpu VCE hang + failed GPU reset (upstream, needs triage/mitigation)

Open CG-8663 opened this issue 3 months ago • 4 comments

Summary

gpu-screen-recorder (the shipped screen-recording tool) SIGABRTs while recording on a dual-GPU MacBook Pro. The crash is not a bug in gpu-screen-recorder itself — it is an upstream amdgpu VCE (video encode engine) hang followed by a failed GPU reset, which makes Mesa's gallium driver abort() inside vaEndPicture. Filing here for visibility/triage and because Omarchy's screen-recording defaults could mitigate it.

Hardware

  • MacBook Pro, dual GPU: Intel HD 630 (00:02.0) + AMD Baffin [1002:67ef] (Radeon Pro 450/455/460, 01:00.0), rev c0
  • Arch/Omarchy 4.0.2-1, Mesa 26.2.1 (libgallium-26.2.1-arch1.1.so), gpu-screen-recorder 6.0.1
  • supergfxctl 5.2.7 (GPU switching)

What happened

Recording the internal display (-w eDP-1, 60 fps) with VA-API hardware encoding. The kernel logs the sequence:

ring vce0 timeout, signaled seq=23, emitted seq=24
Process gpu-screen-reco pid 862719 thread gpu-screen:cs0 pid 862724
GPU reset begin!. Source: 1
suspend of IP block <vce_v3_0> failed -22
GPU pre asic reset failed with err, -22
PCI CONFIG reset
GPU reset succeeded, trying to resume
VRAM is lost due to GPU reset!
SMU load firmware failed / fw load failed / smu firmware loading failed
GPU reset end with ret = -22
GPU Recovery Failed: -22

After the failed recovery, Mesa aborts in vaEndPicture (thread gpu-screen:cs0), producing the SIGABRT.

Backtrace (crashing thread, unsymbolized)

#0  abort (libc.so.6)
#1  libgallium-26.2.1-arch1.1.so
#2  libgallium-26.2.1-arch1.1.so
#3  libgallium-26.2.1-arch1.1.so
#4  libgallium-26.2.1-arch1.1.so
#5  libc.so.6
#6  libc.so.6

Main thread (encoding path): vaEndPicture (libva.so.2) ← libavcodec.so.63 ← avcodec_send_frame ← gpu-screen-recorder main.

Data loss

Yes — the output screenrecording-2026-09-01_05-20-30.mp4 is 88 bytes (empty MP4 header, no frames). Unrecoverable.

Suggestion

On dual-GPU machines, screen recording defaults to the AMD GPU's VA-API encoder, which hangs on Baffin. Consider defaulting to the Intel iGPU encoder or CPU encoding (the -fallback-cpu-encoding yes flag exists but VA-API is still tried first). This is likely worth forwarding upstream to drm/amd (freedesktop GitLab) — the VCE ring timeout + failed reset is the underlying defect.

Diagnostics

  • AMDGPU device coredump: /sys/class/drm/card1/device/devcoredump/data
  • systemd-coredump: core.gpu-screen-reco.1000....862719....zst (3.2M)

Filed by DeepSeek-V4-Pro-0813 via opencode.

CG-8663 avatar Sep 01 '26 05:09 CG-8663

Seeing the same vce0 ring timeout / GPU reset signature, but on different hardware and a different trigger — adding as a data point since this isn't dual-GPU-MacBook-specific.

Hardware

  • Desktop, not a MacBook: Intel Alder Lake-S GT1 (UHD 730) iGPU + AMD Radeon RX 590 (Polaris30, PCI ID matches the 470/480/570/580/590 family, amdgpu driver)
  • Arch/Omarchy, kernel 7.1.9-arch1-2, linux-firmware 20260810-2 (current at time of testing)
  • gpu-screen-recorder 6.0.1

Trigger

Unlike OP's -w eDP-1 (full display), mine reproduces specifically via the region picker — omarchy screenrecord without --fullscreen, i.e. selecting an arbitrary area with slurp before recording starts. Reproduced 4/4 times in one session; have not yet tried to confirm whether fullscreen capture is actually safe on this chip or just less likely to hit it.

Kernel log

amdgpu 0000:01:00.0: ring vce0 timeout, signaled seq=17, emitted seq=18
amdgpu 0000:01:00.0:  Process gpu-screen-reco pid 4778 thread gpu-screen:cs0 pid 4780
amdgpu 0000:01:00.0: GPU reset begin!. Source:  1
amdgpu 0000:01:00.0: [drm] *ERROR* Failed to initialize parser -125!
amdgpu 0000:01:00.0: suspend of IP block <vce_v3_0> failed -22
amdgpu 0000:01:00.0: GPU pre asic reset failed with err, -22 for drm dev, 0000:01:00.0
amdgpu 0000:01:00.0: BACO reset
amdgpu 0000:01:00.0: GPU reset succeeded, trying to resume
amdgpu 0000:01:00.0: VRAM is lost due to GPU reset!

Difference from OP

In my case the kernel-level reset actually succeeds (GPU reset succeeded, not GPU Recovery Failed), so gpu-screen-recorder doesn't SIGABRT/lose the file the way OP's does — but the Hyprland session appears to hang/freeze after VRAM is lost due to GPU reset!, which from the user's chair looks like a full system freeze rather than a clean crash. Not sure yet whether that's Hyprland failing to reinit its DRM state after VRAM loss, or something else downstream of the reset.

+1 on the suggestion to not default to the VCE/VA-API hardware path on Polaris-family GPUs, or at least to actually exercise -fallback-cpu-encoding on a mid-stream ring timeout, not just on encoder-init failure (as also noted in #7217, a different but related fallback-detection gap).

andrewgrebennikov avatar Sep 03 '26 19:09 andrewgrebennikov

Same signature on a third Polaris-family card — desktop Radeon RX 580 (Ellesmere, 1002:67DF), Omarchy 4.0.2-1, kernel 7.1.9-arch1-2, gpu-screen-recorder 6.0.1-1, mesa 1:26.2.1-1.

Reproduces through every omarchy entry point here: --fullscreen (KMS), the slurp region picker, and -w portal — confirming the failing block is the hardware encoder, not the capture backend. Recording output is black-then-banded or an empty 0–88 B file.

Coredump (gsr PID 4614, SIGABRT): Mesa libgallium-26.2.1 abort() in thread gpu-screen:cs0; main thread in vaEndPicture → avcodec_send_frame. nautilus SIGABRT one second later was a side effect of VRAM is lost due to GPU reset!.

Complete workaround, verified on this machine (no VCE involvement, no GPU reset):

gpu-screen-recorder -w portal -s 0x0 -k h264 -encoder cpu -f 60 -fm cfr -fallback-cpu-encoding yes -o out.mp4

A ~/.local/bin/gpu-screen-recorder wrapper that rewrites every -k … invocation to -k h264 -encoder cpu makes all omarchy flows (keybind/menu, region, webcam) work here. Stop/finalize still functions because argv[0] stays gpu-screen-recorder (exec -a), so the pgrep -f '^gpu-screen-recorder' checks keep matching. This contradicts -k auto's implicit assumption that the VAAPI encoder is crash-safe on Polaris.

Also confirms the two gaps are user-visible on this hardware, not just theoretical:

  • -fallback-cpu-encoding yes does not help when the encoder hangs mid-stream (only on init failure) — the GPU resets instead.
  • There is no supported way to force -encoder cpu from omarchy's recorder menu/keybind flow.

Filed by big-pickle via opencode.

RuslanSalianko avatar Sep 05 '26 10:09 RuslanSalianko

can confirm

gpu-screen-recorder -w portal -s 0x0 -k h264 -encoder cpu -f 60 -fm cfr -fallback-cpu-encoding yes -o out.mp4

work perfectly fine on Polaris card(RX 580)

NeevTheDeev avatar Sep 05 '26 17:09 NeevTheDeev

Reviewed by Claude Opus 5.5. The second opinion (Codex) did not run: the reviewer answered, but its daily review budget was already spent, so this is one model's reading.

What's happening in Omarchy. bin/omarchy-capture-screenrecording starts every recording, whether fullscreen, region, portal or with the webcam, with gpu-screen-recorder ... -k auto ... -fallback-cpu-encoding yes, so on these cards it always picks the hardware VA-API encoder. That fallback only applies when the encoder fails to start. A VCE ring timeout partway through a recording hangs the GPU before the fallback can step in, which matches all three reports here. Nothing on quattro has changed how the encoder is chosen since 4.0.2, so it is not already fixed.

It is being fixed in #10125. That pull request forces -encoder cpu when it detects the Baffin device (1002:67ef) and leaves every other GPU on automatic selection. It was reviewed on a worker on 2 October, and the open questions are listed there. The one that matters for this issue: it matches only 1002:67ef. The RX 580 (1002:67df) and RX 590 reported above show the same ring vce0 timeout and GPU reset and would keep hardware encoding, yet merging it would close this issue. Whether to cover the confirmed device IDs, all of Polaris, or switch these cards to HEVC as @dec05eba suggested on #10125 is the maintainer's call.

Not reproduced. Omarchy's test workers are virtual machines with no AMD GPU, so the VCE hang cannot be triggered there. The proof has to come from the affected hardware: @CG-8663 was asked on #10125 to test that commit on the MacBook. Until then, the workaround the RX 580 reporters confirmed (-encoder cpu) is the reliable one.

This now waits on the maintainer to decide how far #10125 should reach.

omarchybot avatar Oct 09 '26 12:10 omarchybot