I’m on Unraid 6.11.1 with LinuxServer.io’s docker container - all been working fine for almost a year.
Randomly today transcoding is broken. All clients just break and report transcoder crashed. I’ve since edited the docker template to use 1.29.0.6244 (version variable) and transcoding is back.
I have an i7 3770 with quicksync on. The few errors i see in the logs include:
Oct 24, 2022 20:52:57.543 [0x147757d68b38] ERROR - [Req#3f8/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b8] [AVHWDeviceContext @ 0x145afb275780] Failed to initialise VAAPI connection: -1 (unknown libva error).
Oct 24, 2022 20:52:57.543 [0x147751edeb38] ERROR - [Req#3f9/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b8] Device creation failed: -5.
Oct 24, 2022 20:52:57.543 [0x147756252b38] ERROR - [Req#3fa/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b8] Failed to set value 'vaapi=vaapi:/dev/dri/renderD129' for option 'init_hw_device': I/O error
Oct 24, 2022 20:52:57.543 [0x1477576d7b38] ERROR - [Req#3fb/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b8] Error parsing global options: I/O error
Again rollback has worked. This issue is even for standard x264 files.
And unless I’m very mistaken even if this was HEVC it shouldn’t cause a crash, it should switch to software transcode.
3770 CPU does not like, nor has it ever liked, Intel Media Driver (iHD).
Solution there is VaapiDriver="i965".
What is this device? vaapi=vaapi:/dev/dri/renderD129
It keeps trying to use it because Hardware transcoding is still enabled.
The QSV in a 3770 is on the default renderD128 node.
Oct 24, 2022 20:48:57.506 [0x14775298cb38] DEBUG - [Req#3f4/Transcode] TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Oct 24, 2022 20:48:57.511 [0x14775298cb38] DEBUG - [Req#3f4/Transcode/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/config/Library/Application\ Support/Plex\ Media\ Server/Codecs/c4efa15-4387-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxxx "/usr/lib/plexmediaserver/Plex Transcoder" -codec:0 h264 -hwaccel:0 vaapi -hwaccel_fallback_threshold:0 10 -hwaccel_output_format:0 vaapi -hwaccel_device:0 vaapi -codec:1 aac -analyzeduration 20000000 -probesize 20000000 -i "myfile.mkv" -filter_complex "[0:0]hwupload[0];[0]scale_vaapi=w=480:h=270:format=nv12[1];[1]hwupload[2]" -map "[2]" -codec:0 h264_vaapi -b:0 414k -maxrate:0 553k -bufsize:0 1106k -r:0 25 -force_key_frames:0 "expr:gte(t,n_forced*8)" -filter_complex "[0:1] aresample=async=1:ocl='stereo':rematrix_maxval=0.000000dB:osr=48000[3]" -map "[3]" -metadata:s:1 language=eng -codec:1 aac -b:1 125k -f dash -seg_duration 8 -dash_segment_type mp4 -init_seg_name 'init-stream$RepresentationID$.m4s' -media_seg_name 'chunk-stream$RepresentationID$-$Number%05d$.m4s' -window_size 5 -delete_removed false -skip_to_segment 1 -time_delta 0.0625 -manifest_name "http://127.0.0.1:32400/video/:/transcode/session/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5/manifest?X-Plex-Http-Pipeline=infinite" -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 dash -start_at_zero -copyts -vsync cfr -init_hw_device vaapi=vaapi:/dev/dri/renderD129 -filter_hw_device vaapi -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5/progress
Oct 24, 2022 20:48:57.512 [0x14775298cb38] DEBUG - [Req#3f4/Transcode/JobRunner] Jobs: Starting child process with pid 495
Oct 24, 2022 20:48:57.517 [0x147752b8fb38] DEBUG - Request: [127.0.0.1:46188 (Loopback)] PUT /video/:/transcode/session/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5/progress?status=startup (10 live) #3d9 Signed-in Token (user) (range: bytes=0-)
Oct 24, 2022 20:48:57.518 [0x14775a4f8b38] DEBUG - Completed: [127.0.0.1:46188] 204 PUT /video/:/transcode/session/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5/progress?status=startup (10 live) 0ms 203 bytes (pipelined: 1) (range: bytes=0-)
Oct 24, 2022 20:48:57.543 [0x147757d68b38] ERROR - [Req#3f8/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5] [AVHWDeviceContext @ 0x145afb275780] Failed to initialise VAAPI connection: -1 (unknown libva error).
Oct 24, 2022 20:48:57.543 [0x147751edeb38] ERROR - [Req#3f9/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5] Device creation failed: -5.
Oct 24, 2022 20:48:57.543 [0x147756252b38] ERROR - [Req#3fa/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5] Failed to set value 'vaapi=vaapi:/dev/dri/renderD129' for option 'init_hw_device': I/O error
Oct 24, 2022 20:48:57.543 [0x1477576d7b38] ERROR - [Req#3fb/Transcode/4gfp1x9ahodb86bcb4ogtbv4/55c3b60e-f6c3-4d74-a336-3e39505395b5] Error parsing global options: I/O error
Oct 24, 2022 20:48:57.545 [0x14775a93db38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 495 is 1 (failure)
Oct 24, 2022 20:49:01.351 [0x14775a6fbb38] DEBUG - Auth: authenticated user n as user2
In Preferences.xml, before the closing /> add VaapiDriver="i965"
It will look like SomePref="Value" VaapiDriver="i965" />
It looks like you have two devices coming through. Logically, renderD128 = QSV and renderD129 is either Nvidia or AMD (as far as the kernel is concerned).
If it is an Nvidia coming through, it will look like this (with different slot number)
[chuck@glockner ~.2003]$ ls -la /sys/module/nvidia/drivers/pci:nvidia/
total 0
drwxr-xr-x 2 root root 0 Oct 23 23:23 ./
drwxr-xr-x 34 root root 0 Oct 23 23:23 ../
lrwxrwxrwx 1 root root 0 Oct 23 23:23 0000:07:00.0 -> ../../../../devices/pci0000:00/0000:00:03.0/0000:07:00.0/
--w------- 1 root root 4096 Oct 24 21:14 bind
lrwxrwxrwx 1 root root 0 Oct 24 21:14 module -> ../../../../module/nvidia/
--w------- 1 root root 4096 Oct 24 21:14 new_id
--w------- 1 root root 4096 Oct 24 21:14 remove_id
--w------- 1 root root 4096 Oct 23 23:23 uevent
--w------- 1 root root 4096 Oct 24 21:14 unbind
[chuck@glockner ~.2004]$
At that point, confirm the nvidia encode and decode drivers are installed.
Want ended up working for me was adding
HardwareDevicePath=“/dev/dri/renderD129” to the preferences.xml – not sure what changed but I guess Nvidia AND iQS started coming though to Docker in unraid.