Skip to content

Instantly share code, notes, and snippets.

@patrix87
Last active October 31, 2026 03:36
Show Gist options
  • Select an option

  • Save patrix87/5cf66223549f7291351e83b5e09fbaae to your computer and use it in GitHub Desktop.

Select an option

Save patrix87/5cf66223549f7291351e83b5e09fbaae to your computer and use it in GitHub Desktop.
GPU Passthrough for Jellyfin on Proxmox

GPU Passthrough for Jellyfin on Proxmox

A step-by-step, click-and-paste guide to passing a discrete PCIe GPU from a Proxmox 9 host into a Linux VM and using it for Jellyfin hardware transcoding inside a Docker container.

Target setup

  • Host: Proxmox VE 9 (Debian Trixie–based)
  • Guest: a Linux VM (Ubuntu 24.04 / Debian 12 used here) running Docker
  • App: a single Jellyfin container that wants /dev/dri/renderD128
  • GPU: any modern discrete card — Intel Arc, NVIDIA, AMD. Examples below use an Intel Arc A380 (8086:56a5); substitute your own vendor:device ID.

A GPU passed through this way is exclusive to one VM at a time. No SR-IOV / vGPU tricks.


0. What you need before you start

  • A Proxmox host with a second GPU (or an iGPU) for its own console. If the card you want to pass is the only GPU, see the "iGPU-only host" note in Section 3.
  • BIOS/UEFI access on the host.
  • The VM already created (any Linux distro with a recent kernel — 6.5+ recommended for Intel Arc).
  • Root shell on the Proxmox host and sudo on the VM.

1. Enable virtualization + IOMMU in firmware

Reboot into BIOS/UEFI and turn on both of these. Names vary by vendor:

Intel AMD
CPU virtualization "Intel Virtualization Technology" / VT-x "SVM Mode" / AMD-V
IOMMU "VT-d" / "Intel VT for Directed I/O" "IOMMU" / "AMD-Vi"

Save and boot back into Proxmox.

Verify on the host

# CPU virtualization flag present?
grep -oE 'vmx|svm' /proc/cpuinfo | sort -u
# Intel prints "vmx", AMD prints "svm". Empty = firmware disabled.

# IOMMU active? Read from the journal, not `dmesg` — the kernel ring buffer
# can age out boot messages on a long-running host (e.g., a chatty ICMPv6
# warning loop), making `dmesg | grep` look empty even when IOMMU is fine.
journalctl -k -b | grep -iE 'DMAR|IOMMU|AMD-Vi' | head
# Intel: "DMAR: IOMMU enabled"
# AMD:   "AMD-Vi: IOMMU performance counters supported"
# No output at all = firmware toggle is still off.

# Cross-check:
find /sys/kernel/iommu_groups/ -mindepth 1 -maxdepth 1 -type d | wc -l
# > 0 (usually 20–40) = IOMMU is active.

If any of these fails, fix it before going further — nothing below will work.


2. Identify the GPU

On the Proxmox host:

lspci -nnk | grep -A3 -E 'VGA|3D|Display'

Example output:

0a:00.0 VGA compatible controller [0300]: Intel Corporation DG2 [Arc A380] [8086:56a5] (rev 05)
        Subsystem: ASRock Incorporation Device [1849:6004]
        Kernel driver in use: i915
        Kernel modules: i915, xe

Write down two things:

  • PCI bus address — 0a:00.0 (used in the Proxmox VM config)
  • Vendor:device ID — 8086:56a5 (used in the kernel command line)

Confirm it's in its own IOMMU group

for d in /sys/kernel/iommu_groups/*/devices/* ; do
  n=$(basename "$(dirname "$(dirname "$d")")")
  echo "Group $n: $(basename "$d")"
done | sort -V | grep -B1 -A1 '0a:00'

If the GPU shares its IOMMU group only with its own audio function (0a:00.1), you're fine — pass both. If it shares the group with unrelated devices (NICs, NVMe, USB controllers), you'll need to move the card to a different PCIe slot or use the pcie_acs_override kernel flag (security trade-off; out of scope here).


3. Bind the GPU to vfio-pci on the host

This is the core trick: tell the kernel to claim the GPU with the generic vfio-pci stub driver at boot, so the host's real GPU driver (i915, xe, nouveau, nvidia, amdgpu) never touches it.

3a. Kernel command line

Edit /etc/default/grub and append to GRUB_CMDLINE_LINUX_DEFAULT (keep what's already there):

GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt vfio-pci.ids=8086:56a5"

Replace 8086:56a5 with your vendor:device ID. For multiple IDs (e.g., GPU + its HDMI audio): vfio-pci.ids=8086:56a5,8086:4f92.

Apply:

update-grub

systemd-boot users: if ls /etc/kernel/proxmox-boot-uuids exists, your host uses systemd-boot. Edit /etc/kernel/cmdline instead and run proxmox-boot-tool refresh.

3b. Load vfio modules at boot

Create /etc/modules-load.d/vfio.conf:

vfio
vfio_iommu_type1
vfio_pci

3c. Belt-and-suspenders: modprobe options

Create /etc/modprobe.d/vfio.conf. Replace the IDs and the driver name(s) to match your GPU:

options vfio-pci ids=8086:56a5 disable_vga=1
softdep i915 pre: vfio-pci
softdep xe   pre: vfio-pci

The softdep lines tell modprobe to load vfio-pci before the real GPU driver every time. Driver names by vendor:

GPU softdep lines
Intel Arc / Iris softdep i915 pre: vfio-pci + softdep xe pre: vfio-pci
NVIDIA softdep nouveau pre: vfio-pci + softdep nvidia pre: vfio-pci
AMD softdep amdgpu pre: vfio-pci + softdep radeon pre: vfio-pci

3d. Rebuild initramfs and reboot

update-initramfs -u -k all
reboot

3e. Confirm

lspci -nnk -s 0a:00.0
# Kernel driver in use: vfio-pci    ← required
# Kernel modules: i915, xe          ← OK to still be listed; they're not bound

journalctl -k -b | grep -i 'Default domain type'
# iommu: Default domain type: Passthrough (set via kernel command line)

If Kernel driver in use: still shows the original GPU driver, the binding didn't take. Double-check your IDs match lspci -nn exactly, that you rebuilt initramfs, and that you actually rebooted.

iGPU-only host: if the card you're passing is also the host's only display, add this to the cmdline so the framebuffer drivers release the device: initcall_blacklist=sysfb_init video=efifb:off video=vesafb:off video=simplefb:off The host will lose its console after this — make sure you have SSH working first.


4. Attach the GPU to the VM (Proxmox UI)

In the Proxmox web UI:

  1. VM → Hardware → BIOS → set to OVMF (UEFI). Required for PCIe passthrough.
  2. VM → Hardware → Machine → set to q35. Required for the pcie=1 flag.
  3. VM → Hardware → Add → EFI Disk → pick your storage, format raw, "Pre-Enroll keys" on. Required when switching to OVMF.
  4. VM → Hardware → Add → Serial Port (port 0), then VM → Hardware → Display → Serial terminal 0 (serial0). The console becomes xterm.js instead of noVNC. Don't keep the default std display next to the GPU: see the note at the end of 5c. The guest needs console=ttyS0 on its kernel cmdline (Ubuntu cloud images have it).
  5. VM → Hardware → Add → PCI Device:
    • Device: pick your GPU's bus address (e.g., 0000:0a:00).
    • All Functions: ✓ (passes the GPU's audio function too).
    • PCI-Express: ✓.
    • Primary GPU: leave unchecked. The GPU is a render device, not the VM's display.
    • ROM-Bar: ✓ (default).

Converting an existing SeaBIOS/i440fx VM: switching BIOS + machine type is not a hot edit. Shut the VM down, change BIOS to OVMF, machine to q35, add the EFI disk — then boot once and you may need to reinstall the bootloader from inside the guest (grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu). For brand new VMs, just create them as OVMF+q35 from the start.

Start the VM.


5. Prepare the guest OS

SSH into the VM.

5a. Confirm the VM sees the GPU

lspci -nnk | grep -A3 -E 'VGA|3D|Display'

You should see your card listed with a kernel driver bound (xe, nouveau, nvidia, amdgpu…).

5b. Install the VA-API runtime + diagnostics

These let you verify hardware acceleration. Jellyfin ships its own libraries internally, so this is for debugging from the VM shell.

Intel Arc (Gen 12.5+, including A-series):

sudo apt update
sudo apt install -y intel-media-va-driver-non-free vainfo intel-gpu-tools

NVIDIA:

sudo apt install -y nvidia-driver-XXX libnvidia-encode-XXX libnvidia-decode-XXX
# Replace XXX with your driver branch (e.g., 550).

AMD:

sudo apt install -y mesa-va-drivers vainfo radeontop

5c. (Intel Arc A-series only) pin the binding to i915

On kernel 6.8 i915 claims DG2 PCI IDs by default and xe sits idle behind force_probe. Leave it that way for Arc A-series (A380 / A580 / A750 / A770). The newer xe kernel driver is mandatory for B-series Battlemage and is Intel's long-term direction, but on A-series in 2026-05 the userspace iHD VA-API driver on top of xe still breaks the transcode pipeline: qsv ↔ vaapi hwmap roundtrips segfault and h264_vaapi direct encode hits a missing ioctl. The same hardware works cleanly with i915 + iHD.

For defense in depth (so a future kernel default flip doesn't change which driver claims the card), edit /etc/default/grub in the VM to pin the binding and blacklist xe:

GRUB_CMDLINE_LINUX_DEFAULT="quiet i915.force_probe=56a5 xe.force_probe=!56a5"

Replace 56a5 with your card's device ID if different. Then:

echo 'blacklist xe' | sudo tee /etc/modprobe.d/blacklist-xe.conf
sudo update-grub
sudo update-initramfs -u -k all
sudo reboot

If you're on B-series (Battlemage), do the opposite: keep xe and add i915.force_probe=!<id> xe.force_probe=<id> instead — i915 does not support Battlemage.

Why step 4 drops the emulated VGA (the default Proxmox std display, used for the noVNC console): while probing, i915 claims legacy VGA through the kernel VGA arbiter. Because the passed-through card sits behind a PCIe root port, the arbiter switches off both IO and memory decoding on the emulated VGA and never switches them back on. The VM's framebuffer console then traps to QEMU on every write, and a kernel worker spins at 100% with repeated soft lockup warnings. If you must keep the emulated VGA, hand ownership back once i915 has bound. This only covers the bind, not a later re-grab, so the serial display is the real fix:

sudo tee /usr/local/sbin/vgaarb-return-boot-vga >/dev/null <<'EOF'
#!/bin/sh
set -eu
for dev in /sys/bus/pci/devices/*; do
  [ "$(cat "$dev/boot_vga" 2>/dev/null)" = 1 ] || continue
  exec 3<>/dev/vga_arbiter
  printf 'target PCI:%s' "${dev##*/}" >&3
  printf 'lock io+mem' >&3
  printf 'unlock io+mem' >&3
  exec 3>&-
done
EOF
sudo chmod 0755 /usr/local/sbin/vgaarb-return-boot-vga
echo 'ACTION=="bind", SUBSYSTEM=="pci", DRIVER=="i915", RUN+="/usr/local/sbin/vgaarb-return-boot-vga"' \
  | sudo tee /etc/udev/rules.d/90-vgaarb-return-boot-vga.rules

i915.disable_display=1 does not avoid this: the vga_get happens during power-domain init, which still runs.

5d. Verify

lspci -nnk | grep -A3 -E 'VGA|3D|Display'
# Kernel driver in use: i915  (or xe on Battlemage / nvidia / amdgpu)

ls -l /dev/dri/
# Expect: card0 (or card1) and renderD128

vainfo
# Long list of VAProfile entries (H264, HEVC, AV1 decode + encode).

sudo intel_gpu_top   # Intel only — live engine usage

If renderD128 is missing, the guest kernel didn't load the GPU driver. Reboot once; if still missing, your kernel may be too old for the card (Arc needs 6.2+, ideally 6.5+).


6. Find the render group GID

Docker containers join groups by numeric GID, not name. Get the host (VM) GIDs:

getent group render
# render:x:992:
getent group video
# video:x:44:

Write both numbers down. They will differ between distros — Ubuntu 24.04 often gives render=992, Debian 12 gives render=104. Use what your VM reports.


7. Jellyfin Docker compose

Create compose.yml (adjust paths/volumes/timezone for your setup):

services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    restart: unless-stopped
    network_mode: host          # easiest for DLNA + client discovery
    devices:
      - /dev/dri:/dev/dri       # full /dev/dri — see note below
    group_add:
      - "992"                   # render GID from step 6
      - "44"                    # video  GID from step 6
    volumes:
      - ./config:/config
      - ./cache:/cache
      - /path/to/media:/media:ro
    environment:
      - TZ=America/Toronto

Start it:

docker compose up -d

Why pass the whole /dev/dri and not just renderD128? Mapping the directory is what the Jellyfin docs recommend and future-proofs you against a second card. Transcoding itself only needs renderD128.

Confirm Jellyfin sees the GPU

docker exec jellyfin /usr/lib/jellyfin-ffmpeg/vainfo
# Should print: "Driver version: Intel iHD driver ..." (or the NVIDIA / Mesa equivalent)
# and a list of VAProfiles including encode entries.

8. Configure Jellyfin transcoding

In the web UI: Dashboard → Playback → Transcoding.

Recommended settings for Intel Arc (see Jellyfin's Intel HW acceleration docs for other vendors):

Setting Value
Hardware acceleration Intel QuickSync (QSV)
QSV Device leave blank (defaults to /dev/dri/renderD128)
Enable hardware decoding for H264, HEVC, MPEG2, VC1, VP9, AV1, HEVC 10bit, VP9 10bit, HEVC RExt 8/10bit, HEVC RExt 12bit (not VP8: Arc has no VP8 decoder)
Prefer OS native DXVA or VA-API hardware decoders ✓ (default; required for Dolby Vision)
Enable hardware encoding ✓
Enable Intel Low-Power H.264 / HEVC hardware encoder ✓ (Arc only has the low-power encoder)
Allow encoding in HEVC format ✓
Allow encoding in AV1 format off (client support is still uneven)
Enable Tone mapping ✓ (OpenCL, algorithm BT.2390)
Enable VPP Tone mapping off
Deinterlacing method BWDIF

Check the codec list against vainfo for your own card: tick only what it lists as VAEntrypointVLD. A major Jellyfin upgrade can reset this page to defaults, so recheck it after one.

For NVIDIA, pick NVENC instead and tick the codecs your card supports (consult the NVIDIA codec matrix for your GPU generation). For AMD, pick VAAPI (AMF on Linux is limited).

Save. Play a video that needs to transcode (force a lower quality from the client), then on the VM:

sudo intel_gpu_top   # Render/3D + Video engines should show activity
# Or for NVIDIA: nvidia-smi dmon

The Jellyfin Dashboard → Activity panel should show the stream as "Transcoding" — that's the GPU doing its job.


9. Common failures

Symptom Cause Fix
VM won't start, error mentions vfio: failed to set iommu IOMMU disabled Re-check firmware + iommu=pt, reboot
Host lspci -nnk shows i915 / nouveau / nvidia instead of vfio-pci vfio-pci didn't claim the card Check IDs match exactly, update-initramfs -u -k all, reboot
/dev/dri/renderD128 missing in the VM Guest kernel didn't load the driver Confirm lspci shows the card in the VM; install the right driver package; kernel too old for Arc → upgrade to 6.5+
Container error: "Permission denied" opening /dev/dri/renderD128 Wrong GID in group_add Re-run getent group render on the VM, update compose, recreate container
Jellyfin transcodes but CPU is pegged and GPU idle Hardware encoding not enabled, or VA-API runtime missing Tick "Enable hardware encoding"; verify with docker exec jellyfin /usr/lib/jellyfin-ffmpeg/vainfo
Transcode starts but says "fallback to software" in Jellyfin logs Codec not supported by the GPU, or wrong driver Check vainfo output for the relevant encode profile; some codecs (e.g., AV1 encode) only exist on newer cards

Going further: automation

This tutorial is intentionally manual. Once it's working, the same steps can be codified so a fresh node + fresh VM lands ready-to-go:

  • Host config (kernel cmdline, modprobe.d, vfio modules) → an Ansible role that drops the same files into /etc/default/grub, /etc/modules-load.d/vfio.conf, /etc/modprobe.d/vfio.conf and runs update-grub + update-initramfs with a reboot handler.
  • Proxmox VM definition (OVMF, q35, EFI disk, hostpci) → OpenTofu / Terraform with the bpg/proxmox provider. Use a PCI Resource Mapping (Datacenter → Resource Mappings → PCI Devices) so the Terraform refers to the device by a stable alias instead of a bus address that can shift when slots get reshuffled.
  • Guest OS prep (driver pick, VA-API runtime, render group) → an Ansible playbook that templates the GRUB cmdline, installs the runtime packages, and looks up getent group render to template the Docker .env with the correct GID — so the same compose file works on hosts where the GID differs.

That's the path I took on my homelab; pinging me if you want pointers to a reference repo.


Credits / further reading

@hobblygobbly

hobblygobbly commented May 30, 2026 •

Copy link
Copy Markdown

Thanks a lot for this, I was finally able to get it working after struggling with trial and error myself and your guide helped me during the last stretch.

For others that read this, if you are using the iGPU on the Alder Lake N100, remember that it only supports decoding AV1, not encoding AV1. So in Jellyfin remember to untick "Allow encoding in AV1 format". Always double check your hardware support. Spent 30 minutes troubleshooting before I realised that I ticked this by mistake.

@THX-101

THX-101 commented Jun 8, 2026 •

Copy link
Copy Markdown

I'm getting an error in vainfo and a fatal playback error in Jellyfin. Output of vainfo:

~$ vainfo
Trying display: wayland
Trying display: x11
error: can't connect to X server!
Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

~$ sudo intel_gpu_top
intel_gpu_top: ../tools/intel_gpu_top.c:1871: init_engine_classes: Assertion `max >= 0' failed.
Aborted

I'm using a Arc A310. Do you have any idea what causes this ?

@patrix87

patrix87 commented Jun 8, 2026

Copy link
Copy Markdown
Author

~$ vainfo

Not really, never seen that error before.
Looks like vainfo is trying to connect to x11 or wayland which is odd.
Are you installying Jellyfin on a GUI distro instead of the server one ?

@THX-101

THX-101 commented Jun 8, 2026 •

Copy link
Copy Markdown

[EDIT:] sudo apt install --reinstall firmware-linux-nonfree fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment