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 3 the three transcodes above all running.

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.

 

 

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.