I’ve read a lot of comments stating that Plex HW transcoding can not be made to work with the vaapi APIs exported by AMD APUs with integrated graphics. This is true, at least looking at how Plex sets things up out of the box.
Manually copying over the libva drivers for AMD GPUs plus related shared libraries fixed the problem for me.
Running the whole shebang in a Docker container also checks out, here’s my patch for the linuxserver.io Plex container (apply the patch and rebuild the container)
Let me know if this works for you Ryzen APU users out there too.
From what you supplied, it looks like it only supports the onboard GPU.
Is this correct?
If so, do you happen to know what it would take to support all capable Radeon GPU cards (of which there are many out there)? I ask because you did include radeonsi_drv
May I also have the DEBUG log ZIP file which captures this entire sequence?
( I’m looking from the point of the MDE through FFMPEG launch )
Sure happy to share a debug log. Just let me know where to drop it.
I believe this should work with most recent AMD architectures that properly expose their capabilities trough vaapi (However I did not test with any other device, this Ryzen APU is my first team red system in a while).
I have validated actual GPU usage by looking at radeontop metrics. Plex itself also shows the (hw) tag.
I am not sure about the 280x. The currently used core for recent APUs (Renoir in my case) seem to handle h265just fine and transcode 4K HEVC to h264 without a hitch. Some of the support will also be dependant to what version of libmesa/gallium/dri-radeon etc. your system uses.
Hope someone can repro my results. Be sure to use radeontop (or something like that) to validate GPU load on transcoding.
My system is Xen with passthrough to a Kubernetes host running in a domU (aka VM). I know Nvidia has a solid setup for this when running containers; however, I do expect to be venturing into some untested territory here. Hence the advantage to Xen: I can spin-up another domU running Ubuntu or something and pass the GPU(s) through that way, then run the same docker image.
For testing, I was going to throw Ubuntu onto an USB to boot an older machine and pull down that docker image you linked to, and patch it, to test.
Awesome! Thanks a ton! Finally hw transcoding on my Renoir APU.
I’m running Plex in a LXC container on a Proxmox system with GPU Passthrough. I had to switch my container to privileged and copy the files from /usr/lib/x68_64… to the destination folder.
Have you tried HDR files? For me Plex is still using the CPU with 4k HEVC HDR files. Non-HDR 4k are fine (like in your screenshot).
Logs for HDR files:
Error — [Transcoder] [AVHWDeviceContext @ 0x25c3bc0] No matching devices found.
Error — [Transcoder] [Parsed_hwmap_2 @ 0x2594140] Failed to created derived device context: -19.
Error — [Transcoder] [Parsed_hwmap_2 @ 0x2594140] Failed to configure output pad on Parsed_hwmap_2
Error — [Transcoder] Error reinitializing filters!
Error — [Transcoder] Failed to inject frame into filter network: No such device
Error — [Transcoder] Error while processing the decoded data for stream #0:0
Yeah, that’s where the hope lies with the Plex Transcoder team, fancier features like HDR are likely to be buggy, this could be on the Plex or Mesa/Gallium side.
Ah ok. My vainfo output looks the same (except I’m on a lower kernel).
I was just curious if the problem was on my side. I’ve got only 4 files with HDR so right now it’s not important at all. All the other files are working fine and I’m super happy about it! Thanks again!
Edit: HDR files work if you untick the Enable HDR tone mapping option in the transcoder settings.
For those of us less technically inclined, how do I go about setting all this up? I’d like to set my 1650 free and use my Ryzen 3 3200g Radeon Vega 8 as the hardware encoder of choice so I can assign the 1650 to a VM.
Should I backup my current Plex container first? I am running my Plex container on unRAID server.
Could you detail exactly what you did to make this work? How does one apply the patch? What parameters does one need on the docker run command or docker-compose?
My instructions work for those running Plex in a docker container. To make things easier I have deployed my patched version to the Docker Hub registry:
https://hub.docker.com/r/mauimauer/plex
so instead of the official plex container or the linuxserver.io variant you could run mauimauer/plex.
However I have attached a patch in my first post allowing those who want to do so to have insight into the changes I’ve made.
@mauimauer I’m using your docker repository and it’s working great with my Ryzen 2400GE! Any luck with merging the patch back to linuxserver mainline? It’d be great if we could get the regular updates that they push out.