fix(desktop): SKIKO_RENDER_API env escape hatch for Linux hybrid-GPU SEGV (#546)#556
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds an environment-based render backend configuration mechanism for Skiko on Linux systems. A new helper function reads the ChangesLinux Skiko Render Backend Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Addresses #546 — Linux AppImage / pkg.tar.zst SEGVs as normal user on Bazzite DX with hybrid GPU (Radeon 780M iGPU + RTX 4060 dGPU). Works under `sudo` only.
Diagnosis
The crash is in native code (Skiko / Skia), before any Java exception handler runs — that's why the reporter sees a bare `segmentation fault (core dumped)` with no log output and `CrashReporter` (which IS installed first) doesn't capture anything. The pattern is consistent with the Nvidia proprietary driver path on hybrid-GPU setups: when the unprivileged process tries to bring up an OpenGL/Vulkan context against the dGPU, the proprietary stack SEGVs the JVM. Sudo dodges it because root has different DRM render-node access.
We can't catch this in Java. We CAN give the reporter (and any future hybrid-GPU sufferers) a working escape hatch they can set without rebuilding the app.
Fix
Honour `SKIKO_RENDER_API` from the process environment on Linux only. If set, copy into the `skiko.renderApi` system property before any Compose / Skiko code runs. If unset, leave Skiko to its default — pinning a specific backend unconditionally would regress the much larger population that does have a working accelerated path.
Mac / Windows skipped — different graphics stacks, different bug class.
This means a stuck reporter can launch via:
```bash
SKIKO_RENDER_API=SOFTWARE ./GitHub-Store-x86_64.AppImage # CPU rendering
or
SKIKO_RENDER_API=OPENGL ./GitHub-Store-x86_64.AppImage # force OpenGL
```
`SOFTWARE` is the safe bet for Bazzite DX hybrid setups — slow but always works. `OPENGL` is the fallback if Vulkan was the actual culprit.
Other workarounds for the user (documented in issue reply)
Test plan
Out of scope
Summary by CodeRabbit