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

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
 
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.
 
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:
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
 
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.
 
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:
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)?
 
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
 
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?
 
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:
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
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.
 
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.
 
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
Hey All,

Somewhat new to Proxmox and trying to get iGPU passthrough working so I can use it with my blueiris VM. Looking to see if I could possibly get some help with Ryzen igpu passthrough ... maybe there is something I overlooked or did wrong?

Motherboard: Gigabyte B450 Aorus M (B450M I guess)
CPU: Ryzen 5600G

Note, I initially tried following the proxmox passthrough guide and kept crashing my system. Finally came upon this post and a few other references on Reddit. My host hardware has stopped crashing now when I power on the VM.

I think I've done everything that NetworkingMicrobe mentioned.

When I RDP to the vm, I see that it's got a 'microsoft basic display adapter' that is non-working with ERROR CODE 12. The hardware id definitely belongs to AMD/AMD APU (PCI\VEN_1002&DEV_1638).

Any thoughts on what else to try or did I miss something?



1662504070983.png



-------------------------------- Notes below of what I've done up to this point ---------------------------------

- edit /etc/default/grub (I've tried all 3 variations listed below)

Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt pcie_acs_override=downstream,multifunction initcall_blacklist=sysfb_init video=simplefb:off video=vesafb:off video=efifb:off video=vesa:off disable_vga=1 vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 modprobe.blacklist=radeon,nouveau,nvidia,nvidiafb,nvidia-gpu,snd_hda_intel,snd_hda_codec_hdmi,i915"

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt pcie_acs_override=downstream,multifunction textonly video=efifb:off modprobe.blacklist=radeon,amdgpu"

- dmesg | grep -e DMAR -e IOMMU (this looks like IOMMU is working even though the 'enabled' line isn't displayed)
[ 0.416494] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[ 0.417797] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 0.428567] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
[ 11.095264] AMD-Vi: AMD IOMMUv2 loaded and initialized


- grabbing the IOMMU groups (group 9 and 10 are the ones I tried passing onto the VM; also tried just passing group9 id, the vga controller)

IOMMU Group 0 00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU Group 10 06:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1637]
IOMMU Group 11 06:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
IOMMU Group 12 06:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 [1022:1639]
IOMMU Group 13 06:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 [1022:1639]
IOMMU Group 14 06:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
IOMMU Group 15 07:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 81)
IOMMU Group 16 07:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 81)
IOMMU Group 1 00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU Group 2 00:02.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge [1022:1634]
IOMMU Group 3 00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU Group 4 00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus [1022:1635]
IOMMU Group 5
00:08.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus [1022:1635]
IOMMU Group 6 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 51)
IOMMU Group 6 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 7 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166a]
IOMMU Group 7 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166b]
IOMMU Group 7 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166c]
IOMMU Group 7 00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166d]
IOMMU Group 7 00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166e]
IOMMU Group 7 00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166f]
IOMMU Group 7 00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1670]
IOMMU Group 7 00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1671]
IOMMU Group 8 01:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset USB 3.1 XHCI Controller [1022:43d5] (rev 01)
IOMMU Group 8 01:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset SATA Controller [1022:43c8] (rev 01)
IOMMU Group 8 01:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Bridge [1022:43c6] (rev 01)
IOMMU Group 8 02:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
IOMMU Group 8 02:01.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
IOMMU Group 8 02:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
IOMMU Group 8 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 16)
IOMMU Group 8 05:00.0 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
IOMMU Group 8 05:00.1 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
IOMMU Group 8 05:00.2 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
IOMMU Group 8 05:00.3 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
IOMMU Group 9 06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c9)


- lspci -nnk

06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c9)

Subsystem: Gigabyte Technology Co., Ltd Device [1458:d000]
Kernel driver in use: vfio-pci
Kernel modules: amdgpu
06:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1637]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1637]
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
06:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
Subsystem: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
Kernel driver in use: ccp
Kernel modules: ccp
06:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 [1022:1639]
Subsystem: Gigabyte Technology Co., Ltd Renoir USB 3.1 [1458:5007]
Kernel driver in use: xhci_hcd
Kernel modules: xhci_pci
06:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 [1022:1639]
Subsystem: Gigabyte Technology Co., Ltd Renoir USB 3.1 [1458:5007]
Kernel driver in use: xhci_hcd
Kernel modules: xhci_pci
06:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
Subsystem: Gigabyte Technology Co., Ltd Family 17h (Models 10h-1fh) HD Audio Controller [1458:a194]
Kernel driver in use: snd_hda_intel

- /etc/modprobe.d/vfio.conf
options vfio-pci ids=1002:1638,1002:1637 disable_vga=1

- /etc/modules
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

- /etc/modprobe.d/blacklist.conf (did this anyway)
blacklist amdgpu
blacklist radeon

- /etc/modprobe.d/pve-blacklist.conf
blacklist amdgpu


- vm config (I've also tried a few variations on the hostpci0 line just to test it; like not passing the audio device at 06:00.1). Seabios does not work ... I get some type of power up issue with the vm)

bios: ovmf
boot: order=virtio0;ide2;net0
cores: 2
efidisk0: local-zfs:vm-102-disk-0,efitype=4m,pre-enrolled-keys=1,size=1M
hostpci0: 0000:06:00.0;0000:06:00.1,pcie=1,x-vga=1
ide2: local:iso/virtio-win-0.1.221.iso,media=cdrom,size=519030K
machine: pc-q35-7.0
memory: 4096
meta: creation-qemu=7.0.0,ctime=1662388633
name: w10b
numa: 0
ostype: win10
scsihw: virtio-scsi-pci
sockets: 2
vga: none
virtio0: local-zfs:vm-102-disk-1,cache=writeback,size=100G
 
I have the same problem.
after passthrough vga of group oa.00 then lost connection of pve

0a:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] (rev cb)
0a:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller
0a:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor
0a:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1
0a:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1
0a:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller

0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev cb)
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd]
Kernel driver in use: amdgpu
Kernel modules: amdgpu
0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de]
Kernel modules: snd_hda_intel
0a:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
Subsystem: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
Kernel driver in use: ccp
Kernel modules: ccp
0a:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e0]
Subsystem: ASRock Incorporation Raven USB 3.1 [1849:ffff]
Kernel driver in use: xhci_hcd
Kernel modules: xhci_pci
0a:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e1]
Subsystem: ASRock Incorporation Raven USB 3.1 [1849:ffff]
Kernel driver in use: xhci_hcd
Kernel modules: xhci_pci
0a:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
Subsystem: ASRock Incorporation Family 17h (Models 10h-1fh) HD Audio Controller [1849:2220]
Kernel modules: snd_hda_intel
 
Okay, so after messing around with a bunch of things I read today, I got my error code to 43 and that may have set me on the right path to something that works. It's late here (almost midnight), I'm just going to outline what my current config is where the Ryzen igpu is being passed over properly.

Right now, I'm not positive which one of these things got it working. All I know is that it's working compared to what I tried the other night.

- install the drivers off AMD's website. since I knew the hardware ID was there, I wanted to get that out of the way. It did show the Amd/Radeon gpu but still with error X.

- /etc/default/grub (probably don't need that last piece with efifb but too late for me to delete and retest it)

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on pcie_acs_override=downstream,multifunction textonly video=efifb:off"

- based on how some of the comments I read in some other threads and I think on the unraid forum, amdgpu doesn't need to be blacklisted, i removed everything I had blacklisted in these two files. Which was also why I removed all the other stuff in the grub cmdline.

/etc/modprobe.d/blacklist.conf
/etc/modprobe.d/pve-blacklist.conf

- /etc/modprobe.d/vfio.conf (I removed my audio device that was here; will maybe go back and re-add it back in later but i don't actually need it right now)
options vfio-pci ids=1002:1638 disable_vga=1

- dumped the vbios file; unsure if this is 100% needed and it's more so the gpu/hook reset that did it.
cd /sys/bus/pci/devices/0000:06:00.0
echo 1 > rom
cat rom > /usr/share/kvm/ryzen-5600g-vbios.bin
echo 0 > rom

- vm.conf; i could have sworn this was working with the i440fx but I swapped it back to q35 after one of the reboots and the the windows drivers were once again showing error 43 on reboot. not positive how stable the vm is with the gpu right now but i'm going to leave it running over the next few days.

bios: ovmf
boot: order=virtio0;ide2;net0
cores: 2
cpu: kvm64
efidisk0: local-zfs:vm-102-disk-0,efitype=4m,pre-enrolled-keys=1,size=1M
hostpci0: 0000:06:00.0,pcie=0,rombar=0,x-vga=1,romfile=ryzen-5600g-vbios.bin
ide2: local:iso/virtio-win-0.1.221.iso,media=cdrom,size=519030K
machine: pc-q35-6.2
memory: 4096
meta: creation-qemu=7.0.0,ctime=1662388633
name: w10b
numa: 0
ostype: win10
scsihw: virtio-scsi-pci
smbios1: uuid=ea406534-bafa-4bbf-820e-381e7d40f001
sockets: 2
vga: none
virtio0: local-zfs:vm-102-disk-1,cache=writeback,size=100G
vmgenid: 7448ceac-d942-44fe-afea-c9ed1bbdd05d

- before starting the vm, gpu hook/reset (I read about this in another forum post here)
echo 1 > /sys/bus/pci/devices/0000\:06\:00.0/remove
echo 1 > /sys/bus/pci/rescan

'dmesg' should show something similar to this after you run the reset above

[12847.795020] vfio-pci 0000:06:00.0: vgaarb: changed VGA decodes: olddecodes=none,decodes=io+mem:owns=io+mem
[12847.813427] pci 0000:06:00.0: Removing from iommu group 9
[12853.797389] pcieport 0000:02:04.0: bridge has subordinate 05 but max busn 06
[12853.797476] pci 0000:06:00.0: [1002:1638] type 00 class 0x030000
[12853.797498] pci 0000:06:00.0: reg 0x10: [mem 0xd0000000-0xdfffffff 64bit pref]
[12853.797518] pci 0000:06:00.0: reg 0x18: [mem 0xe0000000-0xe01fffff 64bit pref]
[12853.797535] pci 0000:06:00.0: reg 0x20: [io 0xe000-0xe0ff]
[12853.797548] pci 0000:06:00.0: reg 0x24: [mem 0xfce00000-0xfce7ffff]
[12853.797590] pci 0000:06:00.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[12853.797643] pci 0000:06:00.0: PME# supported from D1 D2 D3hot D3cold
[12853.797689] pci 0000:06:00.0: 126.016 Gb/s available PCIe bandwidth, limited by 8.0 GT/s PCIe x16 link at 0000:00:08.1 (capable of 252.048 Gb/s with 16.0 GT/s PCIe x16 link)
[12853.797798] pci 0000:06:00.0: vgaarb: setting as boot VGA device
[12853.797809] pci 0000:06:00.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[12853.797847] pci 0000:06:00.0: Adding to iommu group 9
[12853.797914] pci 0000:06:00.0: BAR 0: assigned [mem 0xd0000000-0xdfffffff 64bit pref]
[12853.797932] pci 0000:06:00.0: BAR 2: assigned [mem 0xe0000000-0xe01fffff 64bit pref]
[12853.797949] pci 0000:06:00.0: BAR 5: assigned [mem 0xfce00000-0xfce7ffff]
[12853.797961] pci 0000:06:00.0: BAR 4: assigned [io 0xe000-0xe0ff]
[12853.798001] vfio-pci 0000:06:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem


- started the vm and I saw that the error 43 was gone and I was able to see the gpu column in task manager. I forced chrome software rendering off in chrome://flags to make sure other than the window manager was using gpu; played a 4k video over rdp session

Selection_402.jpg
 
- dumped the vbios file; unsure if this is 100% needed and it's more so the gpu/hook reset that did it.
cd /sys/bus/pci/devices/0000:06:00.0
echo 1 > rom
cat rom > /usr/share/kvm/ryzen-5600g-vbios.bin
echo 0 > rom

@p1new
How did you manage to dump the vbios?
I'm trying to get a Ryzen7 5650GE to work, but I don't have any output on HDMI and, of course, code 43 in vm...
The displays only show serveral lines of text - the normal grub message when loading the host kernel - and not the usual Proxmox VM UEFI splash screen...
Booting `Proxmox VE GNU/Linux' Loading Linux 5.15.74-1-pve ... Loading initial-ramdisk

I was going to try dumping the vbios and trying with that, but it seems the there is no rom file...

root@proxmox:~# cd /sys/bus/pci/devices/0000\:09\:00.0/ root@proxmox:/sys/bus/pci/devices/0000:09:00.0# echo 1 > rom -bash: rom: Permission denied root@proxmox:/sys/bus/pci/devices/0000:09:00.0# ls -la total 0 drwxr-xr-x 4 root root 0 Nov 30 07:04 . drwxr-xr-x 15 root root 0 Nov 30 07:03 .. -r--r--r-- 1 root root 4096 Nov 30 07:08 ari_enabled -r--r--r-- 1 root root 4096 Nov 30 07:08 boot_vga -rw-r--r-- 1 root root 4096 Nov 30 07:08 broken_parity_status -r--r--r-- 1 root root 4096 Nov 30 07:05 class -rw-r--r-- 1 root root 4096 Nov 30 07:08 config -r--r--r-- 1 root root 4096 Nov 30 07:08 consistent_dma_mask_bits -r--r--r-- 1 root root 4096 Nov 30 07:08 current_link_speed -r--r--r-- 1 root root 4096 Nov 30 07:08 current_link_width -rw-r--r-- 1 root root 4096 Nov 30 07:08 d3cold_allowed -r--r--r-- 1 root root 4096 Nov 30 07:05 device -r--r--r-- 1 root root 4096 Nov 30 07:08 dma_mask_bits lrwxrwxrwx 1 root root 0 Nov 30 07:08 driver -> ../../../../bus/pci/drivers/vfio-pci -rw-r--r-- 1 root root 4096 Nov 30 07:08 driver_override -rw-r--r-- 1 root root 4096 Nov 30 07:08 enable lrwxrwxrwx 1 root root 0 Nov 30 07:08 firmware_node -> ../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:09/LNXVIDEO:00 lrwxrwxrwx 1 root root 0 Nov 30 07:08 iommu -> ../../0000:00:00.2/iommu/ivhd0 lrwxrwxrwx 1 root root 0 Nov 30 07:05 iommu_group -> ../../../../kernel/iommu_groups/24 -r--r--r-- 1 root root 4096 Nov 30 07:05 irq drwxr-xr-x 2 root root 0 Nov 30 07:08 link -r--r--r-- 1 root root 4096 Nov 30 07:08 local_cpulist -r--r--r-- 1 root root 4096 Nov 30 07:08 local_cpus -r--r--r-- 1 root root 4096 Nov 30 07:08 max_link_speed -r--r--r-- 1 root root 4096 Nov 30 07:08 max_link_width -r--r--r-- 1 root root 4096 Nov 30 07:08 modalias -rw-r--r-- 1 root root 4096 Nov 30 07:08 msi_bus -rw-r--r-- 1 root root 4096 Nov 30 07:08 numa_node drwxr-xr-x 2 root root 0 Nov 30 07:08 power -r--r--r-- 1 root root 4096 Nov 30 07:08 power_state --w--w---- 1 root root 4096 Nov 30 07:08 remove --w------- 1 root root 4096 Nov 30 07:08 rescan -r--r--r-- 1 root root 4096 Nov 30 07:08 resource -rw------- 1 root root 268435456 Nov 30 07:08 resource0 -rw------- 1 root root 268435456 Nov 30 07:08 resource0_wc -rw------- 1 root root 2097152 Nov 30 07:08 resource2 -rw------- 1 root root 2097152 Nov 30 07:08 resource2_wc -rw------- 1 root root 256 Nov 30 07:08 resource4 -rw------- 1 root root 524288 Nov 30 07:08 resource5 -r--r--r-- 1 root root 4096 Nov 30 07:08 revision lrwxrwxrwx 1 root root 0 Nov 30 07:04 subsystem -> ../../../../bus/pci -r--r--r-- 1 root root 4096 Nov 30 07:07 subsystem_device -r--r--r-- 1 root root 4096 Nov 30 07:07 subsystem_vendor -rw-r--r-- 1 root root 4096 Nov 30 07:04 uevent -r--r--r-- 1 root root 4096 Nov 30 07:04 vendor root@proxmox:/sys/bus/pci/devices/0000:09:00.0#

Remove/rescan seems to be working without errors:
[ 686.178652] vfio-pci 0000:09:00.0: vgaarb: changed VGA decodes: olddecodes=none,decodes=io+mem:owns=none [ 686.196828] pci 0000:09:00.0: Removing from iommu group 24 [ 686.197958] pci 0000:09:00.0: [1002:1638] type 00 class 0x030000 [ 686.198007] pci 0000:09:00.0: reg 0x10: [mem 0xffd0000000-0xffdfffffff 64bit pref] [ 686.198041] pci 0000:09:00.0: reg 0x18: [mem 0xffe0000000-0xffe01fffff 64bit pref] [ 686.198062] pci 0000:09:00.0: reg 0x20: [io 0xe000-0xe0ff] [ 686.198082] pci 0000:09:00.0: reg 0x24: [mem 0xfca00000-0xfca7ffff] [ 686.198274] pci 0000:09:00.0: PME# supported from D1 D2 D3hot D3cold [ 686.198358] pci 0000:09:00.0: 126.016 Gb/s available PCIe bandwidth, limited by 8.0 GT/s PCIe x16 link at 0000:00:08.1 (capable of 252.048 Gb/s with 16.0 GT/s PCIe x16 link) [ 686.199021] pci 0000:09:00.0: vgaarb: VGA device added: decodes=io+mem,owns=none,locks=none [ 686.199140] pci 0000:09:00.0: Adding to iommu group 24 [ 686.199458] pci 0000:09:00.0: BAR 0: assigned [mem 0xffd0000000-0xffdfffffff 64bit pref] [ 686.199500] pci 0000:09:00.0: BAR 2: assigned [mem 0xffe0000000-0xffe01fffff 64bit pref] [ 686.199536] pci 0000:09:00.0: BAR 5: assigned [mem 0xfca00000-0xfca7ffff] [ 686.199559] pci 0000:09:00.0: BAR 4: assigned [io 0xe000-0xe0ff] [ 686.200012] vfio-pci 0000:09:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
 
Glad i found this topic. @RtcBoy thank you for shaing the Renoir bios. I can boot with OVMF/UEFI and BIOS, i see the Proxmox bootscreen. But when entering Windows i see pixel blocks (both BIOS and UEFI). Any ideas?


1679942727389.jpeg

EDIT: Excatly the same image with Linux guests! Please - we need a solution!
 
Last edited:
@NetworkingMicrobe
I use GOTupd tool made an uefi igpu bios which can go with OVMF.
I can see desktop before driver install,but I got the same problem after driver installed.
I think GPU generat multi display layer and at final step all layers mixed together to a single screen, the mouse layer is good and the others are corrupted.May be without driver installed all image use a single same display layer as mouse.
Some other info said old driver without amd link remote display func can work at some Radeon addin card, I will try old 3400G APU.
May the new driver put the image to some new place where remote display func can read from.
Attach file is my bios.
hi, could you please provide more details about adding uefi support the legacy vbios.
 

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 yours easily in our online shop.

Buy now!