DaVinci-Resolve-AMD-Omarchy/NOTES.md
28allday 05aaf04c27 v4.1 rewrite: pin ROCm 7.1.1, fix hybrid-GPU DRI_PRIME flip, glib-family swap
Total rewrite of the installer mirroring the proven NVIDIA-Open install path,
with two new root-cause fixes for AMD on hybrid systems.

Installer (v3.0 -> v4.1):
- Pin ROCm 7.1.1 from Arch Linux Archive as the OpenCL provider; current
  7.2.x is broken with DaVinci Resolve (clCreateContext fails / Color page
  hangs on every AMD card). Adds IgnorePkg to /etc/pacman.conf and aborts
  if pacman -U partial-downgrades.
- DRI_PRIME explicit PCI-tag pin in launcher (DRI_PRIME=pci-0000_BB_DD_F)
  instead of DRI_PRIME=1, which on Intel+AMD hybrids flips OpenGL to the
  iGPU and breaks CL/GL interop. switcherooctl branch removed (same bug).
- MESA_VK_DEVICE_SELECT pin added as defense-in-depth for Vulkan.
- Full glib-family symlink swap: all five of libglib-2.0, libgio-2.0,
  libgmodule-2.0, libgobject-2.0, libgthread-2.0 (was three; mismatch
  caused latent segfaults on signal emit / type registration).
- Manual install to /opt/resolve via ZIP -> .run -> appimage-extract ->
  rsync, with patchelf --set-rpath on every ELF (replaces AUR PKGBUILD
  approach).
- Auto-wipe stale ~/.local/share/DaVinciResolve/{configs,logs} on fresh
  installs and whenever known crash markers appear in ResolveDebug.txt.
- Generation-aware gfx target detection (gfx1030/1100/1101/1102/1200/1201)
  with auto HSA_OVERRIDE_GFX_VERSION for non-natively-supported cards.
- Hyprland windowrule v3 syntax; dropped stay_focused (trapped-cursor in
  modals); removed duplicate user-level .desktop entry; removed unused
  Studio USB-dongle udev rule.

Docs:
- Rewrite README to match v4.1 reality (manual /opt/resolve install,
  ROCm pinning rationale, hybrid-GPU PCI-tag note, refreshed GPU support
  tiers, corrected uninstall steps).
- Add NOTES.md with full root-cause analysis, currently-pinned package
  versions, recovery playbook, and quick sanity checks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 11:15:08 +01:00

312 lines
18 KiB
Markdown

# DaVinci Resolve on Omarchy + RX 9060 XT — Working Configuration
**Date solved:** 2026-05-02 (initial); 2026-05-03 (DRI_PRIME hybrid-GPU fix)
**System:** Omarchy (Arch Linux), Hyprland 0.54.3, kernel 7.0.3, RX 9060 XT (Navi 44, gfx1200) + Intel UHD 770 hybrid
## TL;DR — what is currently working
DaVinci Resolve 21.0 beta launches and stays open with full UI on Color page. The working stack is:
- ROCm **7.1.1** (NOT current 7.2.x) pinned from Arch Linux Archive
- Resolve installed manually to `/opt/resolve` (no AUR PKGBUILD)
- `HSA_OVERRIDE_GFX_VERSION=12.0.0` and `ROCR_VISIBLE_DEVICES=0` in the launcher
- `DRI_PRIME=pci-0000_BB_DD_F` in the launcher — **explicit PCI tag, NOT `=1`** (see "Root cause" below)
- `MESA_VK_DEVICE_SELECT=pci-0000_BB_DD_F` + `MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE=1` (Vulkan pin, defense-in-depth)
- Hyprland windowrule v3 syntax (not deprecated `windowrulev2`)
- snd-aloop kernel module + PipeWire bridge for audio
- DeckLink → ALSA backend in Resolve config
## Root cause
There are TWO independent root causes that both have to be fixed for first launch to succeed:
### 1. ROCm 7.2.x breaks Resolve on every AMD GPU
OpenCL `clCreateContext` either fails outright or hangs on Color page. ROCm 7.1.1 is the last working release.
- Upstream issue: https://github.com/ROCm/ROCm/issues/5982 (filed Feb 2026, still open)
- CachyOS thread with the recipe: https://discuss.cachyos.org/t/davinci-resolve-amd-rocm-fails-without-downgrade/28036
- NixOS RDNA4-specific report: https://github.com/NixOS/nixpkgs/issues/481483
### 2. `DRI_PRIME=1` flips OpenGL to the iGPU on hybrid systems where Mesa already defaults to AMD
On Intel iGPU + AMD dGPU systems where the monitor is plugged into the AMD card, Mesa's default OpenGL device is already the AMD card. `DRI_PRIME=1` means "give me the OTHER card relative to the default" — so it flips OpenGL to Intel. Resolve then has OpenGL on Intel and OpenCL on AMD, and CL/GL interop (`clCreateContext` with `CL_GL_CONTEXT_KHR`) fails. The log shows `OpenCL Context Manager failed to create context` and Resolve hangs on Color page.
**Verify on any new box:**
```bash
glxinfo -B 2>/dev/null | grep -E 'OpenGL renderer|OpenGL vendor' # bare default
DRI_PRIME=1 glxinfo -B 2>/dev/null | grep -E 'OpenGL renderer|OpenGL vendor' # what =1 picks
DRI_PRIME=pci-0000_BB_DD_F glxinfo -B 2>/dev/null | grep -E 'OpenGL renderer|OpenGL vendor' # explicit
```
If bare returns AMD and `=1` returns Intel, you have this bug. The explicit PCI tag is always correct.
The installer detects the AMD discrete card's PCI ID from `lspci` and bakes the tag into the launcher unconditionally whenever an AMD dGPU is present (no longer gated on hybrid status or switcheroo). switcherooctl is **not** used — it internally sets `DRI_PRIME=1` and inherits the same flip bug.
## The install script
`/home/q/Downloads/install-davinci-resolve.sh` — version 4.1 with 2026-05-03 patches:
- **DRI_PRIME explicit PCI-tag pin** (replaces buggy `=1`) + **MESA_VK_DEVICE_SELECT** Vulkan pin — locks OpenGL/Vulkan to the AMD discrete GPU by bus address, unconditional whenever an AMD dGPU is present (no longer gated on hybrid status, switcheroo branch removed)
- **Full glib-family symlink swap** — all five of `libglib-2.0`, `libgio-2.0`, `libgmodule-2.0`, `libgobject-2.0`, `libgthread-2.0` (was three; mismatch caused latent segfaults)
- **Broader crash-marker grep** in `reset_stale_configs()` — recognises `Unsupported GPU Processing Mode`, `OpenCL Context Manager failed to create context`, `Failed to create OpenCL context`
- **Fresh-install auto-wipe** of `~/.local/share/DaVinciResolve/{configs,logs}` whenever Resolve is being installed for the first time
- **ROCm-downgrade error check** — `pacman -U` now aborts the install if the 7.1.1 packages fail to apply, instead of silently continuing on a broken stack
- **Removed USB-dongle udev rule** and the prompt for it (Studio license dongle not in scope)
- **Removed duplicate user-level `.desktop` entry** — system-level entry is patched to use the wrapper, user entry caused walker to show two "DaVinci Resolve" entries
- **Dropped `stay_focused on` from the Resolve Hyprland rules** — it locked focus inside modal dialogs, felt like a trapped cursor
Runs the full install end-to-end:
1. System scan (kernel, GPU detection with gfx target + PCI bus address, audio, display, etc.)
2. Pacman package install (minimal — Resolve bundles its own Qt5/libpng/etc.)
3. **`install_rocm_pinned()`** — downloads ROCm 7.1.1 from Arch Linux Archive, installs via `pacman -U` (now `|| error` on failure so partial-downgrade can't go unnoticed), adds `IgnorePkg` to `/etc/pacman.conf [options]`
4. Manual Resolve extraction (ZIP → .run → squashfs → /opt/resolve) with RPATH patching of every ELF. Bundled glib family — **all five** of `libglib-2.0`, `libgio-2.0`, `libgmodule-2.0`, `libgobject-2.0`, `libgthread-2.0` — replaced with system symlinks. Earlier installs only swapped three; mixing system glib with bundled libgobject (4-year version skew) risks segfaults on signal emit / type registration. Bundled `libc++`/`libc++abi` are deliberately KEPT (Resolve was compiled against specific ABI versions; replacing them crashes immediately).
5. Audio fixes: DeckLink→ALSA, snd-aloop, PipeWire bridge, wireplumber default-sink exclusion
6. Hyprland windowrule (v3 syntax)
7. Desktop entries with `RESOLVE_INSTALL_LOCATION` placeholder substituted, system .desktop Exec lines pointed at the wrapper
8. Launcher in `~/.local/bin/davinci-resolve` with HSA_OVERRIDE + ROCR_VISIBLE_DEVICES + **`DRI_PRIME=pci-<bus>` (explicit tag, derived from the AMD discrete card's PCI ID)** + MESA_VK_DEVICE_SELECT baked in. Single launcher template — switcheroo branch removed.
9. **`reset_stale_configs()`** — clears `~/.local/share/DaVinciResolve/{configs,logs}` if any of these crash markers appear in `ResolveDebug.txt`: `Unsupported GPU Processing Mode`, `OpenCL Context Manager failed to create context`, `Failed to create OpenCL context`. Also fires unconditionally on fresh Resolve installs (`SCAN_RESOLVE_INSTALLED != true`) so any in-install failed-launch poison is wiped before the user ever opens the app.
10. Final `clinfo -l` sanity check + ROCm pin verification
Re-run any time:
```bash
~/Downloads/install-davinci-resolve.sh
```
## Key files / locations
| File | Purpose |
|------|---------|
| `~/Downloads/install-davinci-resolve.sh` | The full installer (v4.1) |
| `~/Downloads/fix-rocm-for-resolve.sh` | Standalone downgrade-only script (no install needed) |
| `~/.local/bin/davinci-resolve` | Working launcher: HSA_OVERRIDE + ROCR_VISIBLE_DEVICES + DRI_PRIME PCI tag + MESA_VK pin |
| `~/.local/bin/davinci-resolve-rusticl` | Rusticl OpenCL fallback (not currently working on RDNA4) |
| `~/.local/bin/davinci-resolve-igpu` | Force iGPU (Intel) for testing |
| `/usr/share/applications/DaVinciResolve.desktop` | The single Resolve menu entry; Exec rewritten to wrapper. No user-level davinci-resolve.desktop is created (would duplicate this in walker). |
| `/usr/bin/davinci-resolve` | Convenience symlink to wrapper |
| `/etc/pacman.conf` | Has `IgnorePkg = rocm-core rocm-device-libs rocm-llvm rocm-opencl-runtime comgr spirv-llvm-translator` in `[options]` |
| `~/.config/pipewire/pipewire.conf.d/50-resolve-aloop-bridge.conf` | PipeWire loopback bridge for audio |
| `~/.config/wireplumber/wireplumber.conf.d/51-resolve-aloop-no-default.conf` | Keep aloop off default-sink rotation |
| `/etc/modules-load.d/snd-aloop.conf` | Auto-load snd-aloop at boot |
| `/etc/pki/tls -> /etc/ssl` | Symlink so Resolve's extras downloader finds Arch certs |
## Currently pinned packages (do NOT update)
```
rocm-core 7.1.1-1
rocm-device-libs 2:7.1.1-1
rocm-llvm 2:7.1.1-1
rocm-opencl-runtime 7.1.1-1
comgr 2:7.1.1-1
spirv-llvm-translator 21.1.3-1
```
## Critical "do not"
- **Do not** install `opencl-amd` from AUR — conflicts with `rocm-opencl-runtime`, also has the broken 7.2 ABI.
- **Do not** run `pacman -Syu` and accept rocm-* updates until ROCm 7.3+ ships with the Resolve fix.
- **Do not** set `DRI_PRIME=1` on hybrid AMD systems — it's the OPPOSITE of what you want when Mesa already defaults to AMD (see Root cause #2). Always use the explicit PCI tag form `DRI_PRIME=pci-0000_BB_DD_F`.
- **Do not** wrap the launcher in `switcherooctl launch` — it inherits the same `DRI_PRIME=1` bug.
- **Do not** use `windowrulev2 = ...` in Hyprland config — deprecated in 0.53+. Use `windowrule = ACTION, match:KEY VALUE` form.
- **Do not** add `stay_focused on` to the Resolve `drpopup` tag — it locks focus inside modal dialogs (Project Settings, Preferences, Render) and feels like a trapped cursor. Cosmetic-only rules (border_size, no_shadow, rounding, opacity) are safe.
- **Do not** edit `~/.local/share/omarchy/` — it's git-managed by Omarchy and gets blown away on `omarchy update`.
## When ROCm 7.3+ ships
To lift the pin and try the official stack again:
```bash
sudo sed -i '/^IgnorePkg.*rocm-/d' /etc/pacman.conf
sudo pacman -Syu
~/.local/bin/davinci-resolve # test
```
If 7.3 also breaks Resolve, restore the pin via:
```bash
~/Downloads/fix-rocm-for-resolve.sh
```
## Recovery procedures
### Resolve hangs / crashes
The installer now wipes stale configs automatically on fresh installs and any time it sees a known crash marker, so this should rarely be needed manually. If you do need it:
```bash
# 1. Wipe stale config (preserves project DBs)
mv ~/.local/share/DaVinciResolve/configs ~/.local/share/DaVinciResolve/configs.bak.$(date +%s)
mv ~/.local/share/DaVinciResolve/logs ~/.local/share/DaVinciResolve/logs.bak.$(date +%s)
# 2. Verify the OpenCL stack is intact
clinfo -l # should show AMD gfx1200
pacman -Q rocm-core rocm-opencl-runtime # should show 7.1.1
grep IgnorePkg /etc/pacman.conf # should pin the rocm packages
# 3. Verify the launcher pins to AMD (NOT DRI_PRIME=1)
grep -E '^export (DRI_PRIME|HSA_OVERRIDE|ROCR_VISIBLE)' ~/.local/bin/davinci-resolve
# DRI_PRIME must be a pci-... tag, never =1
# 4. Re-launch
~/.local/bin/davinci-resolve
```
Crash markers the installer recognises (any of these in `~/.local/share/DaVinciResolve/logs/ResolveDebug.txt` triggers the auto-wipe on next install run):
- `Unsupported GPU Processing Mode` — original ROCm 7.2 symptom (no OpenCL device visible)
- `OpenCL Context Manager failed to create context` — DRI_PRIME=1 flip / CL-GL interop failure
- `Failed to create OpenCL context` — DVIP precursor of the above
### Hyprland config errors after edit
```bash
hyprctl reload
hyprctl configerrors # should be empty
```
If errors mention `windowrulev2`, replace with `windowrule = ACTION, match:KEY VALUE`. Examples in `~/.local/share/omarchy/default/hypr/`.
### Desktop entry broken (app menu does nothing)
Check for the literal placeholder:
```bash
grep RESOLVE_INSTALL_LOCATION /usr/share/applications/DaVinciResolve.desktop
```
If found, fix:
```bash
sudo sed -i \
-e "s|^Exec=.*|Exec=$HOME/.local/bin/davinci-resolve %U|" \
-e "s|RESOLVE_INSTALL_LOCATION|/opt/resolve|g" \
/usr/share/applications/DaVinciResolve.desktop
sudo update-desktop-database
```
### Audio renders won't start
snd-aloop must be loaded:
```bash
lsmod | grep snd_aloop # should show "snd_aloop"
sudo modprobe snd-aloop # if missing
```
PipeWire bridge must be active:
```bash
ls ~/.config/pipewire/pipewire.conf.d/50-resolve-aloop-bridge.conf
ls ~/.config/wireplumber/wireplumber.conf.d/51-resolve-aloop-no-default.conf
systemctl --user restart wireplumber pipewire pipewire-pulse
```
## Card compatibility — confidence tiers
The script auto-detects gfx targets and applies the right HSA override for every card listed below. Confidence levels reflect how well-tested each tier is, not whether the script logic handles them.
### ✅ Confirmed working (tested directly)
| Card | gfx target | Auto HSA value |
|------|-----------|----------------|
| **RX 9060 / 9060 XT** (Navi 44) | gfx1200 | `12.0.0` |
This is the only card where I've personally seen Resolve launch all the way to the Color page with this exact stack.
### 🟢 Should work — natively supported by ROCm 7.1.1
| Card | gfx target | Auto HSA value |
|------|-----------|----------------|
| **RX 9070 / 9070 XT** (Navi 48) | gfx1201 | `12.0.1` |
| **RX 7900 / 7900 XT / 7900 XTX** (Navi 31) | gfx1100 | `11.0.0` |
| **RX 7700 XT / 7800 XT** (Navi 32) | gfx1101 | `11.0.1` |
| **RX 6800 / 6800 XT / 6900 XT / 6950 XT** (Navi 21) | gfx1030 | `10.3.0` |
The 7900 XTX has the most community success reports. CachyOS thread has a confirmed working 7800 XT with the same ROCm 7.1.1 pinned stack.
### 🟡 Should work via HSA spoof — not natively supported, spoofs to nearest target
| Card | Real gfx target | Spoofs as | Auto HSA value |
|------|-----------------|-----------|----------------|
| **RX 7600 / 7600 XT** (Navi 33) | gfx1102 | gfx1100 | `11.0.0` |
| **RX 6700 / 6750 XT** (Navi 22) | gfx1031 | gfx1030 | `10.3.0` |
| **RX 6600 / 6650 XT** (Navi 23) | gfx1032 | gfx1030 | `10.3.0` |
| **RX 6500 XT / 6400** (Navi 24) | gfx1034 | gfx1030 | `10.3.0` |
**Caveat**: RX 6700 XT has been a problem child historically (see [Arch BBS#284316](https://bbs.archlinux.org/viewtopic.php?id=284316) — one user gave up and switched to NVIDIA). Spoofing trades correctness for not-quite-optimal codegen; some effects may fall back to CPU.
### 🟢 iGPUs
| Chip | gfx target | Notes |
|------|-----------|-------|
| Ryzen 7 8000 / 9000 (Phoenix/Hawk Point/Strix) | RDNA3.5 (gfx1150-ish) | CachyOS thread had a 760M (gfx1103) hit the same ROCm 7.2 bug; same downgrade fixes it. |
| Strix Halo | gfx1151 | Confirmed working via Distrobox per Framework Community Forum. |
### 🔴 Will NOT work — ROCm 7.x dropped support before this script's pinned baseline
- **RX 5000 series** (RDNA1, gfx101x)
- **Vega** (gfx9)
- **Polaris** (RX 580 etc.) — only Mesa rusticl path, this script isn't tuned for that
- **Pre-Polaris GCN**
### What "should work" actually means
For tiers 🟢 and 🟡: the **install path is fully baked in** — same package list, RPATH, audio fixes, and launcher env vars (HSA value auto-matched). What might differ between cards:
- **First-launch latency** — Color page can take 60s+ while shaders compile
- **Performance ceiling** — spoofed cards (gfx1102, gfx103x) trade correctness for slightly suboptimal codegen
- **Specific features** — Neural Engine, Fairlight noise reduction may fall back to CPU on some cards
### Sharing the script with someone on a different AMD card
What they need:
1. Run `~/Downloads/install-davinci-resolve.sh` — auto-detects everything
2. If launch fails, `verify_opencl()` at the end of the script tells them what's wrong
3. This notes file has all the diagnostic commands
The one thing they'd need that you don't: the **DaVinci Resolve ZIP in `~/Downloads`** (Blackmagic gates it behind a registration form, no direct link).
## Quick reference: HSA override values
For copy/paste if hand-editing the launcher:
| Card family | gfx target | HSA_OVERRIDE_GFX_VERSION |
|-------------|-----------|--------------------------|
| RX 9070 / 9070 XT (Navi 48) | gfx1201 | 12.0.1 |
| RX 9060 / 9060 XT (Navi 44) | gfx1200 | 12.0.0 |
| RX 7700 / 7800 (Navi 32) | gfx1101 | 11.0.1 |
| RX 7900 (Navi 31) | gfx1100 | 11.0.0 |
| RX 7600 (Navi 33) | gfx1102 | 11.0.0 (spoof) |
| RX 6800 / 6900 (Navi 21) | gfx1030 | 10.3.0 |
| RX 6600 / 6700 (Navi 22-24) | gfx1031/1032/1034 | 10.3.0 (spoof) |
## Sources / further reading
- [ROCm/ROCm#5982 — 7.2 OpenCL Breaks Davinci Resolve](https://github.com/ROCm/ROCm/issues/5982)
- [CachyOS — Davinci Resolve + AMD ROCM fails without downgrade](https://discuss.cachyos.org/t/davinci-resolve-amd-rocm-fails-without-downgrade/28036)
- [CachyOS — Davinci Resolve + AMD GPU FAQ](https://discuss.cachyos.org/t/davinci-resolve-amd-gpu/28038)
- [NixOS#481483 — Resolve 20.3.1 OpenCL unusable on RDNA 4](https://github.com/NixOS/nixpkgs/issues/481483)
- [DaVinci Resolve — ArchWiki](https://wiki.archlinux.org/title/DaVinci_Resolve)
- [Sheridan Computers — libc++ rollback fix (Oct 2025)](https://sheridancomputers.com/blog/view/videos/fix-davinci-resolve-crashing-on-arch-linux-after-system-update-october-2025)
- [Arch Linux Archive (ALA) — historic packages](https://archive.archlinux.org/packages/)
## Things still left as future work
- **Resolve 20.3.x stable** — currently on 21.0 beta. Stable might handle the GPU stack differently.
- **Distrobox + Debian 13** path — community-confirmed working on Strix Halo (gfx1151). Would isolate Resolve from the host's library churn entirely. Useful as a fallback.
- **libc++ ABI break** — Resolve's bundled libc++ vs Arch's system libc++ has bitten the community before (Oct 2025). When Arch jumps libc++ major versions, Resolve may segfault on launch. Sheridan Computers documented the rollback approach.
## Quick sanity checks (paste into terminal anytime)
```bash
# Is Resolve install intact?
test -x /opt/resolve/bin/resolve && echo "Resolve binary OK" || echo "MISSING"
# Is the OpenCL stack the working version?
pacman -Q rocm-core rocm-opencl-runtime comgr spirv-llvm-translator | grep -E "7\.1\.1|21\.1\.3" | wc -l
# expect output: 4
# Is the IgnorePkg pin in place?
grep -q "^IgnorePkg.*rocm-core" /etc/pacman.conf && echo "PINNED" || echo "NOT PINNED"
# Does clinfo see the GPU?
clinfo -l | grep -i gfx1200
# Does the launcher have the env vars?
grep -E "HSA_OVERRIDE|ROCR_VISIBLE|DRI_PRIME|MESA_VK" ~/.local/bin/davinci-resolve
# DRI_PRIME line MUST be the explicit PCI tag form (pci-0000_BB_DD_F),
# NEVER `=1`. If you see `=1`, fix it before launching:
# amd_bus=$(lspci -nn | grep -iE 'AMD.*Radeon|Navi' | head -1 | cut -d' ' -f1)
# sed -i "s|^export DRI_PRIME=.*|export DRI_PRIME=pci-0000_${amd_bus//[:.]/_}|" ~/.local/bin/davinci-resolve
```