I try to follow the docs but somehow it doesn’t work as expected. How does your compose file look and what to choose in the settings?

My current setup: (Not working)

services:
  # original source: https://jellyfin.org/docs/general/installation/container/
  jellyfin:
    image: docker.io/jellyfin/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - JELLYFIN_PublishedServerUrl=https://my.url
    volumes:
      - ./config:/config:Z
      - ./cache:/cache:Z
      - ./media:/media:rw
    ports:
      - 8096:8096
# no need for https since reverse proxy and no local discovery
    restart: always
    device:
      - /dev/dri/:/dev/dri/:Z
      - /dev/dri/renderD128:/dev/dri/renderD128:Z
    group-add:
      - 105
    privileged: true

I do not want a privileged container but I’m experimenting.

  • VAAPI is selected
  • VA-API device: is set to /dev/dri/renderD128
  • enable hardware decoding for : H264, HEVC, HEVC 10bit and VP9 10 bit
  • enable hardware encoding
  • allow encoding in HEVC

to get the group I ran getent group render | cut -d: -f3 on the host which returned 105.

$ podman exec -it jellyfin /usr/lib/jellyfin-ffmpeg/vainfo
Trying display: drm
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864)
vainfo: Supported profile and entrypoints

This command returns VA-API does that mean I can only (or I should) select this method? Or is QSV also possible? What’s better?

podman exec -it jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va -init_hw_device opencl@va
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[AVHWDeviceContext @ 0x55ef07507480] Trying to use DRM render node for device 0.
[AVHWDeviceContext @ 0x55ef07507480] libva: VA-API version 1.21.0
[AVHWDeviceContext @ 0x55ef07507480] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x55ef07507480] libva: Found init function __vaDriverInit_1_21
[AVHWDeviceContext @ 0x55ef07507480] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55ef07507480] Initialised VAAPI connection: version 1.21
[AVHWDeviceContext @ 0x55ef07507480] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864).
[AVHWDeviceContext @ 0x55ef07507480] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x55ef07538b40] Failed to get number of OpenCL platforms: -1001.
Device creation failed: -19.
Failed to set value 'opencl@va' for option 'init_hw_device': No such device
Error parsing global options: No such device

within the container:

# ls -l /dev/dri
total 0
crw-rw----+ 1 nobody nogroup 226,   1 May 17 13:22 card1
crw-rw-rw-. 1 nobody nogroup 226, 128 May 17 13:22 renderD128
# whoami
root
# 
$ getsebool container_use_dri_devices
container_use_dri_devices --> on
$ sudo lshw -c video | grep driver
       configuration: driver=i915 latency=0
  • Kekin@lemy.lol
    link
    fedilink
    English
    arrow-up
    7
    ·
    5 months ago

    I can speak at least for rootless podman, I spent some hours on it and different ways I tried all ended in permission issues.

    I gave up on trying to do it properly and just set the permissions of the /dev/dri device to 666, so that my podman container can use the gpu for transcoding.

    Part of the issue with the container images that I tried is that they create a new user with whatever uid:gid I pass to the container, and so even if my nonroot user is part of the render group, the new user inside the container is not and so it can’t write to the /dev/dri/renderD128 (gpu), and so transcode wouldn’t work.

    That’s where I left the troubleshooting at cause it was being a headache