Files
second-brain/04-learning/guides/homelab/jellyfin-gpu-hardware-acceleration.md
kiskaadee 8a59b093b8
Brain Structural Validation / Validate Markdown Structure & Links (push) Failing after 8s
infra(validator): add DirectoryContract validation and migration manifest
2026-09-28 15:58:11 -05:00

5.5 KiB

type, project, tags
type project tags
guide homelab
homelab
jellyfin
gpu
vaapi
hardware-acceleration
transcoding
nixos
docker

🎬 Jellyfin GPU Hardware Acceleration (VA-API & QuickSync) Guide

This guide details how to configure, verify, and troubleshoot GPU hardware-accelerated video transcoding for Jellyfin running in Docker on NixOS and Linux hosts.


1. Overview & Architectural Context

When streaming media to clients that do not natively support a video codec, container, or bitrate, Jellyfin transcodes the stream on the fly. Without hardware acceleration, software transcoding runs on the CPU across all cores, causing high CPU load and potential thermal throttling on compact mini PCs.

GPU hardware acceleration offloads video decoding and encoding to dedicated on-die Application-Specific Integrated Circuits (ASICs) — such as AMD's Video Core Next (VCN) or Intel's QuickSync Video (QSV).

Device Nodes & Permission Architecture

  1. Direct Rendering Infrastructure (/dev/dri):
    • card0: DRM master node (modesetting and display output).
    • renderD128: Unprivileged render node dedicated to offscreen compute, video decoding, and encoding.
  2. Host Group Permissions (group_add: ["303"]):
    • Jellyfin executes as a non-root user (PUID:PGID = 1000:1000).
    • On NixOS, /dev/dri/renderD128 is owned by root:render with GID 303 (check via stat -c '%g' /dev/dri/renderD128).
    • Passing group_add: ["303"] grants the unprivileged container process read/write access to the GPU render node without requiring privileged: true.

2. Docker Compose Configuration

In the Jellyfin application stack (~/Sites/homelab-jellyfin/docker-compose.yml), configure device passthrough and supplementary group membership:

services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
    devices:
      - /dev/dri:/dev/dri
    group_add:
      - "303"   # NixOS host render GID (use `stat -c '%g' /dev/dri/renderD128` on host)
    volumes:
      - ./config:/config
      - ./cache:/cache
      - /media:/media:ro
    restart: unless-stopped

Note

On non-NixOS hosts (e.g. Debian/Ubuntu), the render group is typically GID 107 or 110. Always verify the host GID before configuring group_add.


3. GPU Hardware Profiles & Codec Capabilities

AMD Radeon Graphics (e.g. Radeon 780M / Phoenix / RDNA3)

  • Acceleration Framework: VA-API (Video Acceleration API)
  • Render Device: /dev/dri/renderD128
  • Supported Hardware Codecs:
    • H.264 / AVC: Decode & Encode
    • HEVC / H.265 (8-bit & 10-bit): Decode & Encode
    • VP9: Decode
    • AV1: Decode & Encode (RDNA3 / Phoenix)

Intel Integrated Graphics (e.g. Intel N100 / N150 / Alder Lake-N)

  • Acceleration Framework: Intel QuickSync (QSV) (Recommended) or VA-API
  • Render Device: /dev/dri/renderD128
  • Supported Features:
    • Low-Power H.264 / HEVC hardware encoder
    • VPP Tone Mapping / OpenCL HDR-to-SDR conversion
    • AV1 decode (Alder Lake-N)

4. Web Interface Configuration (Jellyfin Dashboard)

  1. Navigate to Admin Dashboard → Playback → Transcoding.
  2. Set Hardware acceleration:
    • For AMD GPUs: Select VAAPI.
    • For Intel GPUs: Select Intel QuickSync (QSV).
  3. Set VA-API / QSV Device: /dev/dri/renderD128.
  4. Under Enable hardware decoding for:
    • Check H.264
    • Check HEVC (8-bit & 10-bit)
    • Check VP9
    • Check AV1 (if supported by hardware)
  5. Check Enable Hardware Encoding.
  6. (Optional) Enable VPP Tone Mapping or Tone Mapping for HDR conversion.
  7. Click Save at the bottom of the page.

5. Verification & Diagnostics

A. Real-Time Playback Info Overlay

  1. Start playing any video in the Jellyfin web or desktop client.
  2. Manually force transcoding by selecting a lower quality (e.g., 720p - 4 Mbps).
  3. Click the Gear icon (Settings) in the player control bar and select Playback Info.
  4. Verify that:
    • Play method: Transcode
    • Transcode reason: Container bitrate exceeds limit or Audio/Video codec not supported
    • Hardware encoding: vaapi or qsv

B. Transcoding Log Inspection

Inspect the FFmpeg transcode log files generated by the server:

  • Open Admin Dashboard → Logs → select FFmpeg.Transcode-*.log.
  • Verify the presence of hardware acceleration flags:
    -hwaccel vaapi -hwaccel_output_format vaapi
    Stream #0:0: Video: h264 (h264_vaapi)
    
  • Ensure no fallback errors (Device creation failed or Permission denied) appear.

C. Live GPU Telemetry & Monitoring

Important

Understanding Telemetry Tools & 0% GPU Misconception:

  • Direct Play vs Transcode: When clients natively support the media format, Jellyfin streams the source file directly (Play method: Direct Play). In this mode, GPU load is expected to be 0%.
  • 3D Engine vs VCN ASIC: Standard GPU monitoring tools like radeontop measure 3D rendering pipeline usage (shaders, rasterizers). Video decode/encode occurs on dedicated Video Core Next (VCN) hardware blocks.

To monitor hardware transcoding engines:

  • AMD Radeon: Run amdgpu_top (monitors VCN decode/encode engines) or read /sys/class/drm/card0/device/gpu_busy_percent.
  • Intel iGPU: Run intel_gpu_top (from intel-gpu-tools) to monitor Video and VideoEnhance engine percentages.