[SOLVED] HelpNeeded: Ryzen APU + Arch Linux LXC + Jellyfin VAAPI

TheHellSite

Active Member
Mar 4, 2020
78
53
38
I am currently trying to get VAAPI working for Jellyfin inside my Arch Linux LXC.
Google pointed me to many different tutorials from which I think I picked the most up to date information from.

My PVE version: 7.0-11 with the lastest upgrades

Code:
arch: amd64
cores: 4
features: mount=cifs,nesting=1
hostname: VOD
memory: 4096
nameserver: 10.12.20.1
net0: name=eth0,bridge=vmbr2,hwaddr=02:89:76:13:42:00,ip=dhcp,tag=20,type=veth
ostype: archlinux
rootfs: data_ssd:2040/vm-2040-disk-0.raw,size=8G
swap: 0
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file

Code:
1. Proxmox Host: Find the GPU device number.

ls -l /dev/dri


2. Proxmox Host: Add it to the LXC configuration file.
nano /etc/pve/lxc/LXC_ID.conf
add the lines below...

lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file


3. LXC Guest: Start the LXC, change group of render device, install the latest Mesa drivers and reboot the LXC.

chgrp render /dev/dri/*
usermod -aG render jellyfin
pacman -Syyu mesa --noconfirm && reboot


4. Jellyfin: Enable VAAPI.
Go to: Admin --> Server --> Dashboard --> Playback

Hardware acceleration: VAAPI
VA API Device: /dev/dri/renderD128

Code:
root@PVE:~# ls -l /dev/dri
total 0
drwxr-xr-x 2 root root         80 Sep 27 17:15 by-path
crw-rw---- 1 root video  226,   0 Sep 27 17:15 card0
crw-rw---- 1 root render 226, 128 Sep 27 17:15 renderD128

sometimes it also outputs this

root@PVE:~# ls -l /dev/dri
total 0
drwxr-xr-x 2 root root       80 Sep 27 17:15 by-path
crwxrwxrwx 1 root  989 226,   0 Sep 27 17:15 card0
crwxrwxrwx 1 root  989 226, 128 Sep 27 17:15 renderD128

Code:
[root@VOD ~]# ls -l /dev/dri
total 0
crw-rw---- 1 root render 226,   0 Sep 27 17:15 card0
crw-rw---- 1 root render 226, 128 Sep 27 17:15 renderD128

Code:
ffmpeg version n4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[AVHWDeviceContext @ 0x562e48f35480] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value '/dev/dri/renderD128' for option 'vaapi_device': Input/output error
Error parsing global options: Input/output error


What am I missing?
Is it even necessary to passthrough the card0 device?
Do I also need to install mesa drivers on the host or just inside the LXC?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!