Plex Hardware Transcoding using docker with AMD iGPU Ryzen 7900


Recommended Posts

Hi there, sharing experience and a guide on how i got this working..

 

Unraid version: 6.12.0-rc5 

Hardware: ASROCK X670E PRO RS + AMD Ryzen 9 7900 + DDR5 + Cache NMVE

 

I have been trying to get the plex container to transcode using hw but was not succesful until I found somebody in Reddit referencing this dockerfile in github. This is the first time I build an image so after few tinkering I think I got it to work. Here are the steps I used incase anybody see this relevant.

 

Github: skjnldsv/docker-plex

 

As I said, this is my first time I build an image.

 

I went into plex and created a text file dockerfileplex.txt and copied the code in github into it. I could see in the dockefile the person is loading the standard plex image but with a series of modules, libraries....I am not an expert on docker so dont understand 100%

 

I used the following CLI command to build the image: docker build - < dockerfileplex.txt

 

After few minutes, the image is created and you are given an image id: in my case this was: 07804fbb5c05

 

Then I used the usual code I use with the standard plex docker to create a new container but referencing the image I just created before: in my case this was:

 

docker run -d \
  --name=plex-amd \
  --net=host \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e VERSION=docker \
  -e PLEX_CLAIM= `claim-GLgDsgXXXXXXXXXXX_` \
  -v /mnt/cache/appdata/plex-amd:/config \
  -v /mnt/user/Media:/media \
  --device=/dev/dri:/dev/dri \
  --restart unless-stopped \
  07804fbb5c05

 

 

You can see the new plex container in the list of containers in unraid and you can stop start restart as usual.

 

once this was up and the setup of the server is up, hw transcoding is working and I managed to get 3/4 streams working on the same time.

 

I installed AMD Radeontop tool and I show below the usage of the iGPU for transcoding...when that picture was taken only one stream was on.

 

Ig any question, please comment and will do my best to guide on the process above.

 

223476915_Screenshot2023-05-16222337.thumb.png.39906e11dfb6f58fcff181ddb98d02f2.png97515254_Screenshot2023-05-16220415.png.1a7629c23be0e0875a53cc9f12a04cfc.png

 

  • Like 2
  • Thanks 1
Link to comment
  • 1 month later...
On 7/14/2023 at 8:18 PM, Apollopayne35 said:

Please could you simplify your instructions? I have a 5700g and wanting to set a Plex docker with it for transcoding. I’ve never created a docker container this way. Only from the community applications 

 

All you have to do is open up the console on your unraid server and type:
 

docker build https://raw.githubusercontent.com/skjnldsv/docker-plex/master/Dockerfile


That command will run for a bit and at the end it'll say:

 

Successfully built <IMAGE ID>

 

Once you see that, copy that image ID and open up your existing Plex container and replace the repository with that new image ID. Alternatively, you can hit "Add Container" and select the profile of your Plex install and simply change the name to something else (I added GPU). The only other thing you need to do is add the following to Extra Parameters (advanced editing):

 

--device='/dev/dri:/dev/dri'


It should start up just like normal and work out of the box. I have an MSI Vega 56 that is currently transcoding three streams. Big thanks to OP for turning me onto this.

Link to comment

Just a small update, I've pushed the image to dockerhub and it's available here for those looking to use this: https://hub.docker.com/r/mindaboveall/plex-amd

 

Just open your current Plex container and swap the repo out with

 

mindaboveall/plex-amd:latest

 

and add
 

--device=/dev/dri:/dev/dri

 

to your Extra Parameters and you're good to go. Will be sporadically updated until I get the time to set something more robust up.

Edited by Mindaboveall
Link to comment
  • 2 weeks later...

Mindaboveall, I'm a newbie at Unraid, and just switched over from VM Virtual Box for my Plex server, for the reason of using my Radeon 7900 to transcode since VM Box doesn't allow GPU passthrough.  I have my Plex (Pass) server up and running on Unraid, and I have the "Enable hardware transcoding" selected in plex, but I am still not getting the GPU to transcode.  

 

Your last post said Plex now supports AMD GUPs, can you point me in the right direction to where I can find out how to get this set up?

 

Thanks!

  • Upvote 1
Link to comment
  • 2 weeks later...
On 8/10/2023 at 10:33 AM, Combat_Archer said:

Mindaboveall, I'm a newbie at Unraid, and just switched over from VM Virtual Box for my Plex server, for the reason of using my Radeon 7900 to transcode since VM Box doesn't allow GPU passthrough.  I have my Plex (Pass) server up and running on Unraid, and I have the "Enable hardware transcoding" selected in plex, but I am still not getting the GPU to transcode.  

 

Your last post said Plex now supports AMD GUPs, can you point me in the right direction to where I can find out how to get this set up?

 

Thanks!

I figured this out based on the info above, first, make sure you have the Radeon-Top plugin installed and working. Install the "Official" Plex docker, I was unable to get this to work with Binhex or Linuxserver (possible the AMD drivers are not installed). On the install template page, click "Add another Path, Port, Variable, Label, or Device", change config type to Device, give it a name (I used AMD GPU), for value enter "/dev/dri:/dev/dri" (without quotes). Complete the remaining setup (specify your local media folder and set a transcode directory, preferrably a location on your cache pool) and click apply to create the docker. After setup, dont forget to enable hardware transcoding (requires plex pass) in the plex settings.
This is working great with my Ryzen 5 5500U with Radeon iGPU. I was able to test 4 simultaneous HW transcodes (1080p HEVC to SD).

Edited by Nofences
Incorrect plugin name
Link to comment
  • 3 weeks later...
On 8/20/2023 at 8:49 PM, Nofences said:

I figured this out based on the info above, first, make sure you have the AMD-Top plugin installed and working. Install the "Official" Plex docker, I was unable to get this to work with Binhex or Linuxserver (possible the AMD drivers are not installed). On the install template page, click "Add another Path, Port, Variable, Label, or Device", change config type to Device, give it a name (I used AMD GPU), for value enter "/dev/dri:/dev/dri" (without quotes). Complete the remaining setup (specify your local media folder and set a transcode directory, preferrably a location on your cache pool) and click apply to create the docker. After setup, dont forget to enable hardware transcoding (requires plex pass) in the plex settings.
This is working great with my Ryzen 5 5500U with Radeon iGPU. I was able to test 4 simultaneous HW transcodes (1080p HEVC to SD).

Firstly I can't seem to find AMD-Top. Secondly i did everything else and now can select my GPU as a transcoder device, but now all my streams buffer super hard every 5 seconds. im using an RX 580 8GB. Am I doing something wrong?

Link to comment
13 hours ago, stanek7110 said:

Firstly I can't seem to find AMD-Top. Secondly i did everything else and now can select my GPU as a transcoder device, but now all my streams buffer super hard every 5 seconds. im using an RX 580 8GB. Am I doing something wrong?

Apologies, the plugin is actually called Radeon Top, not AMD. Install the plugin and restart.

Link to comment
13 hours ago, Nofences said:

Apologies, the plugin is actually called Radeon Top, not AMD. Install the plugin and restart.

I do have that plugin. I think i figured out the issue. All my movies were in 4k and i think the rx 580 was struggling with the 4k. once i dropped them down to 1080p it seems to handle it much better. still seems like the max remote streams i can get is 3 without buffering. btw all movies are YTS all below 3mbps.

Link to comment
  • 2 weeks later...
On 7/27/2023 at 10:17 PM, Mindaboveall said:

Well it was a really solid two weeks but Plex Media Server now supports AMD GPUs so this is all no longer needed. Thus ends my foray into docker building.

Care to share how you got this working?

 

I just upgraded from an old intel to the 7900 and transcoding pegs out all cores with no hit on the iGPU.  I had things working with the intel.  

Link to comment
6 hours ago, jace055 said:

Care to share how you got this working?

 

I just upgraded from an old intel to the 7900 and transcoding pegs out all cores with no hit on the iGPU.  I had things working with the intel.  

See my post above from Aug 20, it has instructions for enabling HW transcoding using official Plex container and AMD GPU.

Edited by Nofences
Link to comment
On 9/19/2023 at 10:33 PM, Nofences said:

See my post above from Aug 20, it has instructions for enabling HW transcoding using official Plex container and AMD GPU.

Thank you.  

 

I still can't seem to get this to work.  I am on the latest original Plex docker.  I assume the GPU plugin is working but I can't get it to move. With Intel, it really moved.  

image.png.bff59c35a5176ce6f3c750851c766f6b.png

How is your 4k transcode performance?  Converting 1080 to anything else barley shows a bump on the processor but one 4k transcode will immediately eat 75% on all cores for a few minutes before settling to 30%.  

Link to comment

So here are my results converting 4K to 1080P Single Transcode

278047613_1Transcode.png.7045752eaf43dc303cedb4ccc5bfb3c0.png

1161604171_1transcodeplex.png.7f766a412fd5dc759cbc4785ac5376d2.png

 

Multiple Transcodes

1356788348_3Transcode.png.1c4055c64cc29b0e946381002330e485.png1995556834_3transcodesplex.thumb.png.073efdc232b8704b4df4fe1094ded2fc.png

 

You are correct, CPU did increase, while GPU did not, but all three report HW transcoding and this is from an ADM Ryzen 5 5500U with Radeon iGPU

 

750586153_3TranscodeCPU.png.2d6583cd1bd524b79f4fa6e3b6f2ccde.png

This was with the three transcodes above all running.

If your GPU is older, not sure what is officially supported by Plex. Might be worth a look through their forums for your GPU and see what other's experience with it is.

 

 

Edited by Nofences
Corrected grammar for clarity
Link to comment

@Nofences thank you for the information!

 

I played with this all weekend. Unloading dockers and reloading along with changing configurations. No luck. 
 

Today I noticed there was an update to plex server. I’m now on 7557 and everything is working!  I can transcode 4K down to almost nothing with no hit on the CPU. The APU is doing the work and the plug-in reports it correctly. 
 

tldr: Update plex for the fix. I have a ryzen 9 7900 processor. 

  • Like 1
Link to comment
17 hours ago, Hiko0 said:

@jace055 As this is huge news for all AMD-users, could you maybe also post some screenshots on what you were transcoding and how this was affecting your system's resources? 

I’ll post some up in a day or so. Currently in the middle of a parity check and I’d like to let it finish before I play around with anything. 
 

15 hours ago, matew said:

Hello, @jace055 - was anything published by plex in e.g. release notes, saying that amd iGPUs are finally fully supported? Many thanks.

 

On the plex forums there is a thread of all the plex server change logs.  I think the relevant bit is “(Transcoder) Certain newer AMD GPU models couldn’t be used for hardware transcoding on Linux (#14416)” in post 596.
 

https://forums.plex.tv/t/plex-media-server/30447/600

 

Looking at the last handful of updates it looks like they have been working on AMD transcoding for a while. Although tin 7571 it looks like they are attempting to fix it again. I’m going to stay on 7557 since I have it working as expected. 

  • Thanks 1
Link to comment
11 hours ago, animeking1987 said:

@Nofences I have followed your instructions for setting up the AMD transcoding and mine is still not HW transcoding. I have a 

AMD Ryzen 7 5700 @ 3700 MHz and  I still get this when I Transcode. I have installed the Top plugin as well as add the variable device:image.png.21cc1e5b0b67213bd866c010e4bc3224.png

Are you using the "Official" Plex container? I was unable to get it to work using LSIO or Binhex Plex containers. Did you enable HW transcoding in the Plex settings? Can you post a picture of the container settings? I will try to help as much as possible, but can only really share what worked for me. 

Link to comment

@Hiko0

 

Below are some screenshots from a little testing today.  

I have a 7900 (non X) on an MSIX670 mobo.  I run a bare metal VM passed through with an iNvidia graphics card.  When idle the processor hovers around 5%.

I am running Plex official docker v1.32.6.7557

This is 4 4K streams transcoded down to various bitrates.  2 Streams were being played in browser on the VM.  The others were on different devices. 

 

56176692_Screenshot2023-10-04084403.png.cc8d724930b04fedba322ad148a040eb.png

1323975705_Screenshot2023-10-04084527.png.84c8c83822ec6b3c24c0fa36d2586ef9.png

 

901828579_Screenshot2023-10-04084455.png.4f8f6c197ffa4b850c985d2402faa780.png83829971_Screenshot2023-10-04084439.png.523a075e89ad6ca7aaf36408f69cb261.png351770136_Screenshot2023-10-04084506.png.9367e1b4fb64ecdb9e82c03277205307.png638025621_Screenshot2023-10-04084514.png.e5a516384378d15f8b01a5cc0e233576.png

Edited by jace055
  • Thanks 1
Link to comment
On 10/3/2023 at 12:59 PM, animeking1987 said:

@Nofences I have followed your instructions for setting up the AMD transcoding and mine is still not HW transcoding. I have a 

AMD Ryzen 7 5700 @ 3700 MHz and  I still get this when I Transcode. I have installed the Top plugin as well as add the variable device:image.png.21cc1e5b0b67213bd866c010e4bc3224.png

Are you running a 5700 or a 5700g? The non g version doesn't have an iGPU.

Link to comment
On 10/10/2023 at 5:45 PM, matew said:

@jace055 11% GPU utilization seems to me pretty low, are we sure that plex is not utilizing the CPU somehow as well?

It does seem low to me as well. My main win/takeaway is the processor doesn't jump to 70-80% utilization when I start a single 4k transcode.  So the GPU is doing something. I assumed the built in codec doesn't use much processing power from the processor itself and is offloading the workload to the dedicated chips.     

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.