***Update*** : Apologies, it seems like there was an update to the Unraid forums which removed the carriage returns in my code blocks. This was causing people to get errors when typing commands verbatim. I've fixed the code blocks below and all should be Plexing perfectly now
Granted this has been covered in a few other posts but I just wanted to have it with a little bit of layout and structure.
Special thanks to [mention=9167]Hoopster[/mention] whose post(s) I took this from.
What is Plex Hardware Acceleration?
When streaming media from Plex, a few things are happening. Plex will check against the device trying to play the media:
Media is stored in a compatible file container
Media is encoded in a compatible bitrate
Media is encoded with compatible codecs
Media is a compatible resolution
Bandwith is sufficient
If all of the above is met, Plex will Direct Play or send the media directly to the client without being changed. This is great in most cases as there will be very little if any overhead on your CPU. This should be okay in most cases, but you may be accessing Plex remotely or on a device that is having difficulty with the source media.
You could either manually convert each file or get Plex to transcode the file on the fly into another format to be played.
A simple example:
Your source file is stored in 1080p. You're away from home and you have a crappy internet connection. Playing the file in 1080p is taking up too much bandwith so to get a better experience you can watch your media in glorious 240p without stuttering / buffering on your little mobile device by getting Plex to transcode the file first. This is because a 240p file will require considerably less bandwith compared to a 1080p file.
The issue is that depending on which format your transcoding from and to, this can absolutely pin all your CPU cores at 100% which means you're gonna have a bad time. Fortunately Intel CPUs have a little thing called Quick Sync which is their native hardware encoding and decoding core. This can dramatically reduce the CPU overhead required for transcoding and Plex can leverage this using their Hardware Acceleration feature.
How Do I Know If I'm Transcoding?
You're able to see how media is being served by playing a first something on a device.
Log into Plex and go to Settings > Status > Now Playing
As you can see this file is being direct played, so there's no transcoding happening. If you see (throttled) it's a good sign.
It just means is that your Plex Media Server is able to perform the transcode faster than is necessary.
To initiate some transcoding, go to where your media is playing. Click on Settings > Quality > Show All > Choose a Quality that isn't the Default one
If you head back to the Now Playing section in Plex you will see that the stream is now being Transcoded.
I have Quick Sync enabled hence the "(hw)" which stands for, you guessed it, Hardware. "(hw)" will not be shown if Quick Sync isn't being used in transcoding.
1. A Plex Pass - If you require Plex Hardware Acceleration Test to see if your system is capable before buying a Plex Pass.
2. Intel CPU that has Quick Sync Capability - Search for your CPU using Intel ARK
3. Compatible Motherboard
You will need to enable iGPU on your motherboard BIOS
In some cases this may require you to have the HDMI output plugged in and connected to a monitor in order for it to be active.
If you find that this is the case on your setup you can buy a dummy HDMI doo-dad that tricks your unRAID box into thinking that something is plugged in.
Some machines like the HP MicroServer Gen8 have iLO / IPMI which allows the server to be monitored / managed remotely.
Unfortunately this means that the server has 2 GPUs and ALL GPU output from the server passed through the ancient Matrox GPU. So as far as any OS is concerned
even though the Intel CPU supports Quick Sync, the Matrox one doesn't. =/ you'd have better luck using the new unRAID Nvidia Plugin.
Check Your Setup
If your config meets all of the above requirements, give these commands a shot, you should know straight away if you can use Hardware Acceleration.
Login to your unRAID box using the GUI and open a terminal window. Or SSH into your box if that's your thing.
If you see an output like the one above your unRAID box has its Quick Sync enabled. The two items were interested in specifically are card0 and renderD128.
If you can't see it not to worry type this:
There should be no return or errors in the output. Now again run:
You should see the expected items ie. card0 and renderD128
Give your Container Access
Lastly we need to give our container access to the Quick Sync device. I am going to passively aggressively mention that they are indeed called containers
and not dockers. Dockers are manufacturers of boots and pants company and have nothing to do with virtualization or software development, yet. Okay rant over.
We need to do this because the Docker host and its underlying containers don't have access to anything on unRAID unless you give it to them.
This is done via Paths, Ports, Variables, Labels or in this case Devices. We want to provide our Plex container with access to one of the devices on our unRAID box.
We need to change the relevant permissions on our Quick Sync Device which we do by typing into the terminal window:
chmod -R 777 /dev/dri
Once that's done
Head over to the Docker Tab,
click on the your Plex container.
Scroll to the bottom click on Add another Path, Port, Variable
Select Device from the drop down Enter the following:
Click Save followed by Apply. Log Back into Plex and navigate to Settings > Transcoder. Click on the button to SHOW ADVANCED
Enable "Use hardware acceleration where available".
You can now do the same test we did above by playing a stream, changing it's Quality to something that isn't its original format and Checking the Now Playing section to see if Hardware Acceleration is enabled.
If you see "(hw)" congrats! You're using Quick Sync and Hardware acceleration [emoji4]
Persist your config
On Reboot unRAID will not run those commands again unless we put it in our go file. So when ready type into terminal:
Add the following lines to the bottom of the go file
chmod -R 777 /dev/dri
Press Ctrl X, followed by Y to save your go file. And you should be golden!