Files
punktfunk/scripts/headless/env.sh
T
enricobuehler 8b0172d793 docs: VM handoff — CLAUDE.md, Ubuntu bootstrap, headless-Sway setup for M0
Prepares the move to the NVIDIA-GPU Ubuntu VM where M0/M2 run (macOS can't drive the
Wayland/GPU stack). The repo carries the context, since Claude Code sessions are
machine-local and don't transfer.

- CLAUDE.md: project state + design invariants + don't-regress security notes. Auto-loads
  every session, so a fresh session on the VM continues from here.
- scripts/bootstrap-ubuntu.sh: verifies the (already-installed) NVIDIA/NVENC stack,
  installs rustup + PipeWire/portal/wlroots/Sway + DRM/EGL/GBM/VA dev deps; GATES the
  FFmpeg -dev headers so apt can't clobber a custom NVENC build; checks nvidia-drm.modeset.
- scripts/headless/: headless-Sway + xdg-desktop-portal-wlr config templates, the
  NVIDIA-wlroots env workarounds, run-headless-sway.sh, and a wf-recorder->hevc_nvenc
  capture smoke test (proves capture->NVENC with no Rust).
- docs/linux-setup.md: M0 walkthrough + verified gotchas (modeset, headless backend,
  vGPU NVENC licensing, dmabuf->NVENC CPU-copy fallback, FFmpeg-dev gate, crate versions).

Ubuntu 24.04 package names/versions verified against the live archive; scripts pass
shellcheck and `bash -n`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 00:21:20 +02:00

17 lines
1.1 KiB
Bash

# shellcheck shell=bash
# Source before launching headless Sway / the lumen host on an NVIDIA VM:
# source scripts/headless/env.sh
# These are the wlroots-on-NVIDIA workarounds the research turned up (gles2 is the
# known-good renderer; Vulkan is flaky on the proprietary driver — try it only later).
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
export XDG_CURRENT_DESKTOP=sway # so xdg-desktop-portal selects the wlr backend
export WLR_BACKENDS=headless # no physical connectors on a headless VM GPU
export WLR_LIBINPUT_NO_DEVICES=1 # don't error on having no input devices
export WLR_NO_HARDWARE_CURSORS=1 # NVIDIA hw cursors are broken under wlroots
export WLR_RENDERER=gles2 # known-good on NVIDIA; Vulkan often won't start
export __GLX_VENDOR_LIBRARY_NAME=nvidia # GLVND: dispatch GL/EGL to the NVIDIA driver
export GBM_BACKEND=nvidia-drm # route GBM through nvidia-drm (libnvidia-egl-gbm1)
# Escape hatch to prove the pipeline with a software renderer if EGL/GBM misbehaves:
# export WLR_RENDERER_ALLOW_SOFTWARE=1 WLR_RENDERER=pixman