linuxserver / docker-jellyfin

GNU General Public License v3.0
634 stars 95 forks source link

Intel QuickSync on Docker/Debian 11 (TrueNAS Scale) not working: Device creation failed: -5 with qsv=hw #109

Closed allthesebugsv2 closed 2 years ago

allthesebugsv2 commented 3 years ago

linuxserver.io


Expected Behavior

QuickSync hardware acceleration should work.

Current Behavior

Videos are not playing with QuickSync enabled. After disabling hardware acceleration they work fine. VAAPI also works fine.

Steps to Reproduce

Note that I first had to delete the outdated library file according to #107

  1. Try to play a video which needs transcoding with QSV enabled
  2. Jellyfin displays an error that the media cannot be played
  3. Manually execute the command Jellyfin used to transcode the video
  4. Get the the error message I pasted below

Environment

OS: Debian 11 (TrueNAS Scale) CPU architecture: Intel J5040 How docker service was installed: Comes preinstalled from the distro repo Docker Container Version Jellyfin 10.7.5 (last pulled on 5th May 21)

Command used to create docker container (run/create/compose/screenshot)

version: "2.1"
services:
  jellyfin:
    image: ghcr.io/linuxserver/jellyfin
    container_name: jellyfin
    environment:
      - PUID=1003
      - PGID=1005
      - UMASK_SET=<022>
      - DOCKER_MODS=linuxserver/mods:jellyfin-opencl-intel
    volumes:
      - /storage/jellyfin:/config
      - /pool/media/movies:/data/movies
    ports:
      - 8096:8096
      - 8920:8920 
      - 7359:7359/udp 
      - 1900:1900/udp 
    devices:
      - /dev/dri:/dev/dri #optional
    restart: unless-stopped

Docker logs

Error when trying to play a movie with

/usr/lib/jellyfin-ffmpeg/ffmpeg -c:v hevc_qsv -init_hw_device qsv=hw ...

ffmpeg version 4.3.1-Jellyfin Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-gpl --enable-version3 --enable-static --enable-libfontconfig --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --arch=amd64 --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-vdpau --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvenc --enable-nvdec --enable-ffnvcodec
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100
[AVHWDeviceContext @ 0x55a420d7dc00] libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so has no function __vaDriverInit_1_0
[AVHWDeviceContext @ 0x55a420d7dc00] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value 'qsv=hw' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

vainfo on the host

libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ()
vainfo: Supported profile and entrypoints
VAProfileNone                   : VAEntrypointVideoProc
VAProfileNone                   : VAEntrypointStats
VAProfileMPEG2Simple            : VAEntrypointVLD
VAProfileMPEG2Main              : VAEntrypointVLD
VAProfileH264Main               : VAEntrypointVLD
VAProfileH264Main               : VAEntrypointEncSlice
VAProfileH264Main               : VAEntrypointFEI
VAProfileH264Main               : VAEntrypointEncSliceLP
VAProfileH264High               : VAEntrypointVLD
VAProfileH264High               : VAEntrypointEncSlice
VAProfileH264High               : VAEntrypointFEI
VAProfileH264High               : VAEntrypointEncSliceLP
VAProfileVC1Simple              : VAEntrypointVLD
VAProfileVC1Main                : VAEntrypointVLD
VAProfileVC1Advanced            : VAEntrypointVLD
VAProfileJPEGBaseline           : VAEntrypointVLD
VAProfileJPEGBaseline           : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3          : VAEntrypointVLD
VAProfileHEVCMain               : VAEntrypointVLD
VAProfileHEVCMain               : VAEntrypointEncSlice
VAProfileHEVCMain               : VAEntrypointFEI
VAProfileHEVCMain10             : VAEntrypointVLD
VAProfileHEVCMain10             : VAEntrypointEncSlice
VAProfileVP9Profile0            : VAEntrypointVLD
VAProfileVP9Profile2            : VAEntrypointVLD

vainfo inside the container

libva info: VA-API version 1.11.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_11
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.11 (libva 2.11.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.3 (bec8e13)
vainfo: Supported profile and entrypoints
VAProfileNone                   : VAEntrypointVideoProc
VAProfileNone                   : VAEntrypointStats
VAProfileMPEG2Simple            : VAEntrypointVLD
VAProfileMPEG2Main              : VAEntrypointVLD
VAProfileH264Main               : VAEntrypointVLD
VAProfileH264Main               : VAEntrypointEncSlice
VAProfileH264Main               : VAEntrypointFEI
VAProfileH264Main               : VAEntrypointEncSliceLP
VAProfileH264High               : VAEntrypointVLD
VAProfileH264High               : VAEntrypointEncSlice
VAProfileH264High               : VAEntrypointFEI
VAProfileH264High               : VAEntrypointEncSliceLP
VAProfileVC1Simple              : VAEntrypointVLD
VAProfileVC1Main                : VAEntrypointVLD
VAProfileVC1Advanced            : VAEntrypointVLD
VAProfileJPEGBaseline           : VAEntrypointVLD
VAProfileJPEGBaseline           : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3          : VAEntrypointVLD
VAProfileHEVCMain               : VAEntrypointVLD
VAProfileHEVCMain               : VAEntrypointEncSlice
VAProfileHEVCMain               : VAEntrypointFEI
VAProfileHEVCMain10             : VAEntrypointVLD
VAProfileHEVCMain10             : VAEntrypointEncSlice
VAProfileVP9Profile0            : VAEntrypointVLD
VAProfileVP9Profile2            : VAEntrypointVLD
nyanmisaka commented 2 years ago

VPP TM only requires the built-in Intel media driver whereas OpenCL TM requires an extra compute-runtime (OpenCL mod).

VPP TM is a fixed function from Intel’s driver thus there’s no fine tuning options for colors and brightness like the OpenCL TM.

If the OpenCL TM fails the transcoding, there must be something wrong with the mod installation. Share your ffmpeg log please.

j0nnymoe commented 2 years ago

Closing as this seems to be fixed and not a container issue.