Jellyfin Forum
Hardware Transcoding FFmpeg error, renderD128 - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Hardware Transcoding FFmpeg error, renderD128 (/t-hardware-transcoding-ffmpeg-error-renderd128)



Hardware Transcoding FFmpeg error, renderD128 - Zinic - 2024-03-21

After the third day of troubleshooting, I kneel before any who can help me!

Hardware Acceleration transcoding does not work for QSV and VAAPI. I've tried every solution online for the specific error I'm getting and nothing works. The solution for other people boiled down to a permissions issue. Specifically, this is my error:
Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -i file:"/Movies/4k UHD/Ralph Breaks The Internet (2018) {imbd-tt5848272} [UHD].mkv" -autoscale 0 -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 59616000 -maxrate 59616000 -bufsize 119232000 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv" -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/transcodes/ae334f858828729cdeb54348e71e7345%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcodes/ae334f858828729cdeb54348e71e7345.m3u8"

ffmpeg version 5.1.4-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  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-libopenmpt --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
[AVHWDeviceContext @ 0x55dd6429ad00] No VA display found for any default device.
Device creation failed: -22.
Failed to set value 'vaapi=va:,kernel_driver=i915,driver=iHD' for option 'init_hw_device': Invalid argument
Error parsing global options: Invalid argument

Info on my setup:
Intel Core i5-12400 (Alder Lake)
64 GB RAM
Running on TrueNAS-SCALE-23.10.2
Community App 10.8.13.1 (up to date) (uses docker)
Code:
admin@truenas[~]$ lspci -nn | grep -Ei "3d|display|vga"
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730] [8086:4692] (rev 0c)
admin@truenas[~]$ ls -lh /dev/dri                     
total 0
drwxr-xr-x 2 root root        80 Mar 20 21:57 by-path
crw-rw-rw- 1 root video  226,  0 Mar 20 21:57 card0
crw-rw-rw- 1 root render 226, 128 Mar 20 21:57 renderD128 <---- Note other group has rw permissions
admin@truenas[~]$ getent group render             
render:x:107:apps

What I have tried: 
Code:
sudo usermod -aG render jellyfin <---- Based on suggestions but jellyfin user is not found
sudo usermod -aG render apps <---- I try apps since jellyfin is part of the apps user/group.
sudo usermod -aG video apps
sudo chmod 666 /dev/dri/card0
sudo chmod 666 /dev/dri/renderD128
In app settings, I added host path to /dev/dri because I could not see it in jellyfin's shell. The mount path was set to /dev/dri
In app settings, I added environmental "device" with value "/dev/driConfused-facedev/dri"
I've tried VAApi too and get the "No VA display found for device /dev/dri/renderD128." ffmpeg error

Why am I still having an issue with this FFmpeg error if I've given it permissions and a path to renderD128?


RE: Hardware Transcoding FFmpeg error, renderD128 - TheDreadPirate - 2024-03-21

Can you switch from the community app to the official jellyfin/jellyfin docker image? Some users have had issues with getting the community app to properly use their GPUs. The official docker image has all the Intel drivers built in.


RE: Hardware Transcoding FFmpeg error, renderD128 - Zinic - 2024-03-22

I tried setting up a custom app but it was too complicated. TrueNas removed the ability to manage your own docker recently. But I fixed the problem and hardware acceleration is working now. The problem was I didn't allocate any GPU. In the Resources Configuration section, I swore I didn't see any other option beside the default "Allocate 0 GPU". But now when I looked back, there are other options to choose from. I selected to allocate 1 GPU for Intel, and it works. 4 days now and this was it. So anticlimactic.
[Image: dvzKuxe.png]


RE: Hardware Transcoding FFmpeg error, renderD128 - Efficient_Good_5784 - 2024-03-22

(2024-03-22, 03:45 AM)Zinic Wrote: I tried setting up a custom app but it was too complicated. TrueNas removed the ability to manage your own docker recently.
Truenas Scale does let you use custom Docker apps, but not with Docker. The GUI lets you pull any container image from any container repo on the internet (ie. Docker Hub, Github's ghcr.io, etc).

Once you have the image downloaded onto your Truenas server, you can launch and run custom apps with it. The catch is that (as of the current TN Scale version) the images will be ran with Kubernetes instead.

Over on the Truenas subreddit, one of the ix-systems employees have made comments that show Docker might come back in the future, so maybe we'll be allowed to choose if we want to run an image using Kubernetes or Docker.


RE: Hardware Transcoding FFmpeg error, renderD128 - Zinic - 2024-03-24

(2024-03-22, 05:40 AM)Efficient_Good_5784 Wrote:
(2024-03-22, 03:45 AM)Zinic Wrote: I tried setting up a custom app but it was too complicated. TrueNas removed the ability to manage your own docker recently.
Truenas Scale does let you use custom Docker apps, but not with Docker. The GUI lets you pull any container image from any container repo on the internet (ie. Docker Hub, Github's ghcr.io, etc).

Once you have the image downloaded onto your Truenas server, you can launch and run custom apps with it. The catch is that (as of the current TN Scale version) the images will be ran with Kubernetes instead.

Over on the Truenas subreddit, one of the ix-systems employees have made comments that show Docker might come back in the future, so maybe we'll be allowed to choose if we want to run an image using Kubernetes or Docker.
Yeah, the settings I needed to set for Kubernetes was too complicated for me. At least with Docker there are plenty of guides and troubleshooting help online. It'd be nice if they brought Docker back. I'm okay using their apps in the meantime if they work.