AMD Ryzen 7 "Renoir" 4750G APU and iGPU pass-thru (to Windows 10 guest)?

Miniterror

New Member
Oct 25, 2021
11
1
3
34
Yes it could be different because you have a 5x series with integrated GPU. I'm not sure on what the kernel and new library compatibility requirements are for it. A quick Google seems to suggest others have passed through the igpu successfully.
Seems like you are better Google ninja then me then.
Been trying for a over a week now in getting this work.
Breaking my head on it and so far im out of luck
 

paulmorabi

Member
Mar 30, 2019
75
8
13
42
Seems like you are better Google ninja then me then.
Been trying for a over a week now in getting this work.
Breaking my head on it and so far im out of luck

Getting integrated GPU's to pass through can be especially tricky. It could also depend on IOMMU groupings from your motherboard and CPU. On the software side, kernel and mesa libraries are the more important.

While you are trying to get it working, you could install docker on your Proxmox host and run Plex through it. That should bypass any pass-through issues you are having and give you transcoding.
 

Miniterror

New Member
Oct 25, 2021
11
1
3
34
Little step forward, think now i have a permissions prolem somewhere, but im total noob at this stuff.
I have done the LXC as privileged now and now when i do a ls -sla i get output and doing a vainfo also gives me output.
So i think the GPU parts is now being sent into the LXC, problem is that is has problems accessing the device.
I found some one stating that the renderd128 must be pat of the video group, looking at it now its part of the syslog group.
Tried a "sudo chgrp video /dev/dri/renderD128" but that didnt fix it unfortionally.

Code:
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing h264_vaapi (encoder)
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Generic error in an external library
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for h264_vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing h264_nvenc (encoder)
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API nvenc
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Cannot load libcuda.so.1

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Could not dynamically load CUDA

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for h264_nvenc
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing hevc (decoder) with hwdevice vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Generic error in an external library
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for hevc
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing hevc (decoder) with hwdevice nvdec
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API nvdec
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Cannot load libcuda.so.1

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Could not dynamically load CUDA

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for hevc

Testing a bit more with sugestions from my Google searches i found the command "ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -f lavfi -i testsrc2=size=1920x1080 -vf 'format=nv12,hwupload' -vcodec h264_vaapi -t 10 -bf 0 -movflags frag_keyframe+empty_moov+default_base_moof test.mp4"
Doing this command i actually see some converting going on and it generates the test.mp4 file.
So it actually seems to have the iGPU in the LXC, must be a permissions problem then for the groups attached to the card
 
Last edited:

paulmorabi

Member
Mar 30, 2019
75
8
13
42
Little step forward, think now i have a permissions prolem somewhere, but im total noob at this stuff.
I have done the LXC as privileged now and now when i do a ls -sla i get output and doing a vainfo also gives me output.
So i think the GPU parts is now being sent into the LXC, problem is that is has problems accessing the device.
I found some one stating that the renderd128 must be pat of the video group, looking at it now its part of the syslog group.
Tried a "sudo chgrp video /dev/dri/renderD128" but that didnt fix it unfortionally.

Code:
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing h264_vaapi (encoder)
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Generic error in an external library
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for h264_vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing h264_nvenc (encoder)
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API nvenc
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Cannot load libcuda.so.1

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Could not dynamically load CUDA

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for h264_nvenc
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing hevc (decoder) with hwdevice vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Generic error in an external library
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for hevc
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing hevc (decoder) with hwdevice nvdec
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API nvdec
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Cannot load libcuda.so.1

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Error — [Transcode] [FFMPEG] - Could not dynamically load CUDA

Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Could not create hardware context for hevc

Testing a bit more with sugestions from my Google searches i found the command "ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -f lavfi -i testsrc2=size=1920x1080 -vf 'format=nv12,hwupload' -vcodec h264_vaapi -t 10 -bf 0 -movflags frag_keyframe+empty_moov+default_base_moof test.mp4"
Doing this command i actually see some converting going on and it generates the test.mp4 file.
So it actually seems to have the iGPU in the LXC, must be a permissions problem then for the groups attached to the card

Try this for the permissions (run it on the Proxmox host):

sudo chmod g+rw /dev/dri/renderD128 sudo chmod g+rw /dev/dri/card0
 

Miniterror

New Member
Oct 25, 2021
11
1
3
34
Try this for the permissions (run it on the Proxmox host):

sudo chmod g+rw /dev/dri/renderD128 sudo chmod g+rw /dev/dri/card0
Thx, appriciate the assistence, did the commands in the LXC but no luck.
Still looks the same, think this is getting over my head or im doing something wrong.
 

leesteken

Famous Member
May 31, 2020
1,416
265
83
Maybe the numeric IDs of the video group are different between host and container? I don't know how to fix that.

EDIT: Changing the numbers will only work if it is not in use by another group and all files/directories are also renumbered. In an unprivileged container, you can map container groups to host groups, but it is tricky to get all the numbers and ranges right. I don't know how to do it for privileged containers.
 
Last edited:

paulmorabi

Member
Mar 30, 2019
75
8
13
42
Thx, appriciate the assistence, did the commands in the LXC but no luck.
Still looks the same, think this is getting over my head or im doing something wrong.
hmm also looking at the logs again, the errors are about loading cuda which is incorrect for AMD integrated graphics. Did you configure transcoding to use VAAPI rather than nvenc (which is for nvidia)?
 

Miniterror

New Member
Oct 25, 2021
11
1
3
34
Maybe the numeric IDs of the video group are different between host and container? I don't know how to fix that.
Been trying to change some group ID's but no success so far.

hmm also looking at the logs again, the errors are about loading cuda which is incorrect for AMD integrated graphics. Did you configure transcoding to use VAAPI rather than nvenc (which is for nvidia)?
Within Plex you can not set wich vendor to use, in the logs i also see Vaapi being mentioned, so i assume it tries both AMD and Nvidia and see wich one it can access.
Code:
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing hevc (decoder) with hwdevice vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API vaapi
 

paulmorabi

Member
Mar 30, 2019
75
8
13
42
Been trying to change some group ID's but no success so far.


Within Plex you can not set wich vendor to use, in the logs i also see Vaapi being mentioned, so i assume it tries both AMD and Nvidia and see wich one it can access.
Code:
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: testing hevc (decoder) with hwdevice vaapi
Dec 04, 2021 22:04:42.941 [0x7fdeebe4eb38] Debug — [Transcode] Codecs: hardware transcoding: testing API vaapi

From here it looks like Plex doesn’t support AMD for transcoding. Can you try with Jellyfin via docker container perhaps to see if you have the pass through working?
 

Miniterror

New Member
Oct 25, 2021
11
1
3
34
From here it looks like Plex doesn’t support AMD for transcoding. Can you try with Jellyfin via docker container perhaps to see if you have the pass through working?
I have sen other people stating it worked fro them, in a docker for example.
Problem is, im still really new to this homeserver and my knowladge is minimal, all i try is from following guides i find on Google.
Dont have docker activated on the system or know how to.

I have installed Jellyfin in the same LXC as Plex though, started a video 4K video in Chrome and it was transcoding by CPU just as Plex does.
Then i activated VAAPI in transcoding and tried the same video again, but now its failing.
So seems like it isnt working in Jellyfin either. For VA API it shows the /dev/dri/renderD128 as device.
Not sure yet where i can find live logging for the attempt to transcode something in Jellyfin

Edit: seems to be trying to but not supporting HDR transcoding?

Code:
root@Plex:/var/log/jellyfin# cat FFmpeg.Transcode-2021-12-05_10-34-12_c2255dcc3b3d98f5a5942517d3592bc9_c72a5838.log
/videos/c2255dcc-3b3d-98f5-a594-2517d3592bc9/hls1/main/0.ts

{"Protocol":0,"Id":"c2255dcc3b3d98f5a5942517d3592bc9","Path":"/mnt/Movies/PAW Patrol The Movie (2021)/PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":9320801280,"Name":"PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU","IsRemote":false,"ETag":"5eb76cd75a079fcef3e1892ecdb8feb2","RunTimeTicks":51604480000,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"hevc","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":"bt2020nc","ColorTransfer":"smpte2084","ColorPrimaries":"bt2020","Comment":null,"TimeBase":"1/1000","CodecTimeBase":"1001/24000","Title":null,"VideoRange":"HDR","localizedUndefined":null,"localizedDefault":null,"localizedForced":null,"DisplayTitle":"4K HEVC HDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":14449599,"BitDepth":null,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,"Height":2160,"Width":3840,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"Main 10","Type":1,"AspectRatio":"16:9","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p10le","Level":150,"IsAnamorphic":null},{"Codec":"eac3","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":"1/48000","Title":null,"VideoRange":null,"localizedUndefined":null,"localizedDefault":null,"localizedForced":null,"DisplayTitle":"En - Dolby Digital\u002B - 6 ch - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":640000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"subrip","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":"0/1","Title":"English","VideoRange":null,"localizedUndefined":"Undefined","localizedDefault":"Default","localizedForced":"Forced","DisplayTitle":"English","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":15089599,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:"/mnt/Movies/PAW Patrol The Movie (2021)/PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -b:v 24082665 -maxrate 24082665 -bufsize 48165330 -profile:v:0 high -level 41  -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "tonemap_vaapi=format=nv12:transfer=bt709:matrix=bt709:primaries=bt709" -start_at_zero -vsync -1 -codec:a:0 aac -ac 6 -ab 640000 -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 "/var/lib/jellyfin/transcodes/521e1b052bea37d09944ebaec0c76e9c%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/lib/jellyfin/transcodes/521e1b052bea37d09944ebaec0c76e9c.m3u8"


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
Guessed Channel Layout for Input Stream #0.1 : 5.1
Input #0, matroska,webm, from 'file:/mnt/Movies/PAW Patrol The Movie (2021)/PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU.mkv':
  Metadata:
    encoder         : libebml v1.4.0 + libmatroska v1.6.1
  Duration: 01:26:00.45, start: 0.000000, bitrate: 14449 kb/s
    Stream #0:0: Video: hevc (Main 10), yuv420p10le(pc, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default)
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : English
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (eac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[Parsed_tonemap_vaapi_0 @ 0x562c0b70e200] VAAPI driver doesn't support HDR
[Parsed_tonemap_vaapi_0 @ 0x562c0b70e200] Failed to configure output pad on Parsed_tonemap_vaapi_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[aac @ 0x562c0b5aae80] Qavg: 65536.000
[aac @ 0x562c0b5aae80] 2 frames left in the queue on closing


vainfo output:
Code:
root@Plex:/var/log/jellyfin# vainfo
error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 21.0.3 for AMD RENOIR (DRM 3.41.0, 5.13.19-1-pve, LLVM 12.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
 
Last edited:

paulmorabi

Member
Mar 30, 2019
75
8
13
42
I have sen other people stating it worked fro them, in a docker for example.
Problem is, im still really new to this homeserver and my knowladge is minimal, all i try is from following guides i find on Google.
Dont have docker activated on the system or know how to.

I have installed Jellyfin in the same LXC as Plex though, started a video 4K video in Chrome and it was transcoding by CPU just as Plex does.
Then i activated VAAPI in transcoding and tried the same video again, but now its failing.
So seems like it isnt working in Jellyfin either. For VA API it shows the /dev/dri/renderD128 as device.
Not sure yet where i can find live logging for the attempt to transcode something in Jellyfin

Edit: seems to be trying to but not supporting HDR transcoding?

Code:
root@Plex:/var/log/jellyfin# cat FFmpeg.Transcode-2021-12-05_10-34-12_c2255dcc3b3d98f5a5942517d3592bc9_c72a5838.log
/videos/c2255dcc-3b3d-98f5-a594-2517d3592bc9/hls1/main/0.ts

{"Protocol":0,"Id":"c2255dcc3b3d98f5a5942517d3592bc9","Path":"/mnt/Movies/PAW Patrol The Movie (2021)/PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":9320801280,"Name":"PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU","IsRemote":false,"ETag":"5eb76cd75a079fcef3e1892ecdb8feb2","RunTimeTicks":51604480000,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"hevc","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":"bt2020nc","ColorTransfer":"smpte2084","ColorPrimaries":"bt2020","Comment":null,"TimeBase":"1/1000","CodecTimeBase":"1001/24000","Title":null,"VideoRange":"HDR","localizedUndefined":null,"localizedDefault":null,"localizedForced":null,"DisplayTitle":"4K HEVC HDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":14449599,"BitDepth":null,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,"Height":2160,"Width":3840,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"Main 10","Type":1,"AspectRatio":"16:9","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p10le","Level":150,"IsAnamorphic":null},{"Codec":"eac3","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":"1/48000","Title":null,"VideoRange":null,"localizedUndefined":null,"localizedDefault":null,"localizedForced":null,"DisplayTitle":"En - Dolby Digital\u002B - 6 ch - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":640000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"subrip","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":"0/1","Title":"English","VideoRange":null,"localizedUndefined":"Undefined","localizedDefault":"Default","localizedForced":"Forced","DisplayTitle":"English","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":15089599,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:"/mnt/Movies/PAW Patrol The Movie (2021)/PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -b:v 24082665 -maxrate 24082665 -bufsize 48165330 -profile:v:0 high -level 41  -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "tonemap_vaapi=format=nv12:transfer=bt709:matrix=bt709:primaries=bt709" -start_at_zero -vsync -1 -codec:a:0 aac -ac 6 -ab 640000 -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 "/var/lib/jellyfin/transcodes/521e1b052bea37d09944ebaec0c76e9c%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/lib/jellyfin/transcodes/521e1b052bea37d09944ebaec0c76e9c.m3u8"


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
Guessed Channel Layout for Input Stream #0.1 : 5.1
Input #0, matroska,webm, from 'file:/mnt/Movies/PAW Patrol The Movie (2021)/PAW Patrol The Movie (2021) [WEBDL-2160p][HDR][10bit][h265][EAC3 5.1]-NAISU.mkv':
  Metadata:
    encoder         : libebml v1.4.0 + libmatroska v1.6.1
  Duration: 01:26:00.45, start: 0.000000, bitrate: 14449 kb/s
    Stream #0:0: Video: hevc (Main 10), yuv420p10le(pc, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default)
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : English
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (eac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[Parsed_tonemap_vaapi_0 @ 0x562c0b70e200] VAAPI driver doesn't support HDR
[Parsed_tonemap_vaapi_0 @ 0x562c0b70e200] Failed to configure output pad on Parsed_tonemap_vaapi_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[aac @ 0x562c0b5aae80] Qavg: 65536.000
[aac @ 0x562c0b5aae80] 2 frames left in the queue on closing


vainfo output:
Code:
root@Plex:/var/log/jellyfin# vainfo
error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 21.0.3 for AMD RENOIR (DRM 3.41.0, 5.13.19-1-pve, LLVM 12.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

My understanding is that if you get the output you see from vainfo then the GPU pass-through has worked. Which means the remaining issue is within the tool/application you are trying to configure. I haven’t used Plex for many years so I can’t speak for it. According to the logs, it’s looking to use VAAPI and that could/should access the GPU via the mesa libraries installed. If Plex doesn’t explicitly support AMD then you’re adding another big variable in the equation when trying to get it working. And probably can’t rely on it working without issue over the long term.

For Jellyfin, the issue looks ffmpeg related. I’ve got a similar problem with transcoding In Jellyfin (see here). Someone else in Reddit replied to me that they had transcoding working in Jellyfin and it stopped working recently so possibly these issues are related to Jellyfin’ s ffmpeg.

Re: docker, it might be worth to give it a try because it makes managing your system much nicer. It also makes troubleshooting problems much more straightforward as the docker image includes all necessary libraries and other files. I know it’s another thing to learn but if you’ve made it this far, you can get on top of docker I am sure (look at docker-compose and also consider Portainer for GUI management and watchtower for auto updates).

As to where to from here, like I said, I think the pass-through itself is working but the issues are in the applications. I use frigate for a home cctv camera and with the lxc setup I gave you, it works fine (but as I also said, ffmpeg issues in Jellyfin). You could try another app that needs gpu transcoding to see if it works or try via docker, either in the lxc or the host.
 
  • Like
Reactions: Miniterror

pottproll

New Member
Dec 3, 2020
12
5
3
31
I have sen other people stating it worked fro them
Hi there. Thats right, i got Jellyfin VAAPI transcoding working in an unprivileged debian bullseye lxc. The right ID Mapping did the trick.
unprivileged: 1 lxc.cgroup.devices.allow: c 226:128 rwm lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file lxc.idmap: u 0 100000 106 lxc.idmap: g 0 100000 106 lxc.idmap: u 106 108 1 lxc.idmap: g 106 108 1 lxc.idmap: u 107 100107 65429 lxc.idmap: g 107 100107 65429

I added some IDs for a different cache path to exclude it from the lxc backup because the transcoding blew up the backup size big time. Let me know if you need specific help.
 

paulmorabi

Member
Mar 30, 2019
75
8
13
42
Hi there. Thats right, i got Jellyfin VAAPI transcoding working in an unprivileged debian bullseye lxc. The right ID Mapping did the trick.
unprivileged: 1 lxc.cgroup.devices.allow: c 226:128 rwm lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file lxc.idmap: u 0 100000 106 lxc.idmap: g 0 100000 106 lxc.idmap: u 106 108 1 lxc.idmap: g 106 108 1 lxc.idmap: u 107 100107 65429 lxc.idmap: g 107 100107 65429

I added some IDs for a different cache path to exclude it from the lxc backup because the transcoding blew up the backup size big time. Let me know if you need specific help.

Thanks for this. Do you know what the idmap does?

There's also been some progress in this thread here. I've got it working also with latest mesa libraries and a few other tweaks. These may be useful for you. No 10 bit transcoding yet though.
 

pottproll

New Member
Dec 3, 2020
12
5
3
31
Thanks for this. Do you know what the idmap does?
From the wiki:

"However you will soon realise that every file and directory will be mapped to "nobody" (uid 65534), which is fine as long as

  • you do not have restricted permissions set (only group / user readable files, or accessed directories), and
  • you do not want to write files using a specific uid/gid, since all files will be created using the high-mapped (100000+) uids.
Sometimes this isn't acceptable, like using a shared, host mapped NFS directory using specific UIDs. In this case you want to access the directory with the same - unprivileged - uid as it's using on other machines. You need to change the mapping."

I got a new project now and try to get a lxc with the integrated gpu and a desktop working (and jellyfin transcoding at the same time) to access it via html5 with apache cuacamole from anywhere.
 
  • Like
Reactions: paulmorabi

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!