linuxserver / docker-jellyfin

GNU General Public License v3.0
607 stars 91 forks source link

[BUG] Hardware encoding on RX 7900 XTX does not work #194

Closed LunaSquee closed 1 year ago

LunaSquee commented 1 year ago

Is there an existing issue for this?

Current Behavior

Hello! I have recently upgraded to a new RX 7900 XTX GPU and I can no longer do hardware encoding on it, I get this error instead: 'gfx1100' is not a recognized processor for this target.

I tried with and without the AMD linuxserver mod. Works on host.

Expected Behavior

No response

Steps To Reproduce

  1. Get RX 7900 XTX
  2. Try to transcode anything (h264 in my case)
  3. See transcode error

Environment

- OS: Arch Linux
- How docker service was installed: pacman

CPU architecture

x86-64

Docker creation

version: '3'

services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    network_mode: "host"
    group_add:
      - "x"
    environment:
      - DOCKER_MODS=linuxserver/mods:jellyfin-amd
      - PUID=x
      - PGID=x
      - JELLYFIN_PublishedServerUrl=x
    volumes:
      - /x/jellyfin/cache:/cache
      - /x/jellyfin/config:/config
      - /x/complete:/media
    restart: unless-stopped
    devices:
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0

Container logs

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:/dev/dri/renderD128 -filter_hw_device va -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -canvas_size 1920x1080 -i file:"/media/movies/x.mkv" -autoscale 0 -map_metadata -1 -map_chapters -1 -threads 6 -map 0:0 -map 0:1 -codec:v:0 h264_vaapi -rc_mode VBR -b:v 24185393 -maxrate 24185393 -bufsize 48370786 -profile:v:0 high -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -filter_complex "[0:2]scale=s=1920x1080:flags=fast_bilinear[sub];[0:0]setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12,hwdownload,format=nv12[main];[main][sub]overlay=eof_action=pass:shortest=1:repeatlast=0,hwupload_vaapi" -start_at_zero -codec:a:0 libfdk_aac -ac 2 -ab 384000 -af "volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/data/transcodes/734551f8ca073e769669a29d24fff5b2%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/data/transcodes/734551f8ca073e769669a29d24fff5b2.m3u8"

ffmpeg version 5.1.2-Jellyfin Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --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-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
'gfx1100' is not a recognized processor for this target (ignoring processor)
'gfx1100' is not a recognized processor for this target (ignoring processor)
amd: LLVM doesn't support gfx1100, bailing out...
[AVHWDeviceContext @ 0x55fbbd96ea80] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/radeonsi_drv_video.so init failed
[AVHWDeviceContext @ 0x55fbbd96ea80] Failed to initialise VAAPI connection: 2 (resource allocation failed).
Device creation failed: -5.
Failed to set value 'vaapi=va:/dev/dri/renderD128' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

LunaSquee commented 1 year ago

I tried running jellyfin-ffmpeg5 on my host and that works as well. Even with mesa-va-drivers at the same version as my host machine it throws this error. I cannot figure it out myself.

LunaSquee commented 1 year ago

jellyfin-ffmpeg on Ubuntu jammy uses LLVM 14. Seems like this has to be updated by jellyfin maintainers themselves. Closing this issue.