Files
distrobox-images/davinci/README.md
2026-09-09 23:07:45 +02:00

155 lines
5.8 KiB
Markdown

# DaVinci Resolve in distrobox
Two images built from the same `Dockerfile`, pushed to a private registry,
used via distrobox:
- `davinci-amd` — DaVinci Resolve + ROCm + Intel `intel-compute-runtime`,
for AMD/Intel GPUs
- `davinci-nvidia` — DaVinci Resolve only; the NVIDIA driver/toolchain is
provided by the host
Registry: `docker.slambin.fr`. Files: `Dockerfile`, `davinci-dependencies`
(package list), `davinci-run` (in-image launcher).
This setup is a direct adaptation of
[zelikos/davincibox](https://github.com/zelikos/davincibox) — same base
image, same dependency list, same install flags — with one change: Resolve
is baked into the image at build time instead of being installed into the
box afterwards, to match this repo's "build once, push" convention. See
`CLAUDE.md` for what was changed and why.
Both `amd` and `nvidia` targets have been build-tested end to end (Docker
Desktop/WSL2, real `DaVinci_Resolve_21.1_Linux.run`) — dependency install,
the silent Resolve install, and the patchelf fix all completed cleanly, and
`ldd` on the installed binary shows no missing libraries. Not yet tested:
an actual `distrobox create` + GUI launch on real Linux/GPU hardware (see
`CLAUDE.md` for the full breakdown).
> DaVinci Resolve binaries get baked into these images from your own
> Blackmagic Design download. Keep the registry **private** — never push
> these images publicly. Not affiliated with Blackmagic Design.
---
## Prerequisites
- The DaVinci Resolve (or DaVinci Resolve Studio) Linux `.run` installer
from [Blackmagic's site](https://www.blackmagicdesign.com/products/davinciresolve),
unzipped, placed next to the `Dockerfile` (the download is a `.zip`
containing the `.run` — `unzip DaVinci_Resolve_*_Linux.zip` first).
- Your host user should be in the `render` and `video` groups for GPU
device access: `sudo usermod -aG render,video "$USER"` (log out/in after).
- NVIDIA only: [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)
installed on the host (see "NVIDIA gotcha" below).
## Build & push
```bash
REGISTRY=docker.slambin.fr
VERSION=21.1
INSTALLER=DaVinci_Resolve_21.1_Linux.run
# Build for amd
podman build -f Dockerfile \
--build-arg "RESOLVE_INSTALLER=${INSTALLER}" \
--target "amd" \
-t "${REGISTRY}/davinci-amd:${VERSION}" \
-t "${REGISTRY}/davinci-amd:latest" .
# Build for nvidia
podman build -f Dockerfile \
--build-arg "RESOLVE_INSTALLER=${INSTALLER}" \
--target "nvidia" \
-t "${REGISTRY}/davinci-nvidia:${VERSION}" \
-t "${REGISTRY}/davinci-nvidia:latest" .
```
## Install / run
```bash
# AMD / Intel
distrobox create \
--name davinci \
--image docker.slambin.fr/davinci-amd:latest \
--additional-flags "--hostname davinci-resolve"
# NVIDIA (see gotcha below re: --nvidia vs CDI)
distrobox create \
--name davinci \
--image docker.slambin.fr/davinci-nvidia:latest \
--nvidia \
--additional-flags "--hostname davinci-resolve"
```
Then:
```bash
distrobox enter davinci
davinci-run
```
### NVIDIA gotcha (unverified)
Houdini's NVIDIA variant just needs `distrobox --nvidia` (host driver files
bind-mounted, enough for GL/Vulkan viewport rendering). DaVinci Resolve
needs full CUDA/OpenCL/NVENC, and upstream davincibox's README documents
using the **NVIDIA Container Toolkit + CDI** route instead:
```bash
distrobox create \
--name davinci \
--image docker.slambin.fr/davinci-nvidia:latest \
--additional-flags "--device nvidia.com/gpu=all"
```
which requires `nvidia-container-toolkit` set up on the host (already the
case on Universal Blue images; see NVIDIA's own install guide otherwise).
Whether plain `--nvidia` is actually enough has not been tested here — try
it first since it's simpler, fall back to the CDI form above if Resolve
reports something like "Unsupported GPU processing mode" on launch.
## App menu entry (icon, no terminal)
Same approach as Houdini's: write a minimal `.desktop` by hand and export
it, rather than adapting Resolve's own shipped `.desktop` files. Resolve's
shipped `DaVinciResolve.desktop` uses the `%u` field code for file-manager
"open with" support, and Resolve crashes (`AppConfig::LoadAllSiteInfo`
assertion) if it's ever launched with a stray/unexpanded argument — not
every app launcher strips unused field codes before running `Exec=`. A
hand-written `.desktop` with no field codes at all sidesteps this
entirely. See CLAUDE.md for how this was found.
```bash
distrobox enter davinci
cat > /tmp/davinci.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=DaVinci Resolve
Comment=Editing, visual effects, color correction and audio post production
Exec=davinci-run
Icon=/opt/resolve/graphics/DV_Resolve.png
Terminal=false
Categories=AudioVideo;AudioVideoEditing;
StartupWMClass=resolve
EOF
distrobox-export --app /tmp/davinci.desktop
```
This copies the icon to `~/.local/share/icons/` on the host and writes
`~/.local/share/applications/davinci-davinci.desktop`. Distrobox also
auto-creates a generic `davinci.desktop` ("Terminal entering davinci") when
the box is created — set `NoDisplay=true` in that file, or delete it, if you
don't want both entries in the app menu.
## Known gotchas (from upstream, not yet hit here ourselves)
- **No audio**: Resolve uses ALSA via the `pipewire-alsa` plugin baked into
the image. If your host doesn't run PipeWire, swap it inside the box:
`sudo dnf remove pipewire-alsa && sudo dnf install alsa-plugins-pulseaudio`.
- **Codecs**: the free version's codec support is limited — this is a
Blackmagic licensing limitation, not something this image can fix.
- **Studio + USB dongle**: needs a udev rule on the host to let the
container see the license dongle. See
[davincibox's README](https://github.com/zelikos/davincibox#davinci-resolve-studio-crashes-on-checking-licences)
if you hit "Checking Licences..." crashes.