***GUIDE*** Plex Hardware Acceleration using Intel Quick Sync


Recommended Posts

On 4/13/2021 at 9:30 AM, soder said:

But, how do I do that in Unraid with Plex in docker? Is there an easy way?

 

Edit: I'm using this docker (are there any differences on the dockers, anyone I should use instead?). https://hub.docker.com/r/linuxserver/plex/ and when when changing from "latest" to "1.22.0.4163" in VERSION on the "edit docker page" in Unraid and press Apply, I'm still on Version 1.22.2.4282 in app.plex.tv when I'm checking from a browser.

 

Edit2: Is it version-1.22.0.4163-d8c4875dd I shall write instead? Or do I need to specify more?

 

Edit3: 1.22.0.4163-d8c4875dd was the exact line. Now I'm down do the working version.

 

When Plex has fixed the problem, what is the best version to be on then? docker, latest or public?

 

/Söder

You're an absolute legend. Thanks!

Link to comment

Hello All,

 

I hope since this thread was recently topped you will not mind if I add a question of my own. I am a new convert to unRAID/docker with its main function being a plex server. Server has a i5-11600K (no PCIe graphics card), I am using unRAID 6.10.0-rc1, and I am using the binhex version of plex running PMS 1.24.0.4930. I know from reading this and other threads on the unRAID and plex forums that I am playing with fire by using Rocket Lake, an rc unRAID version, and the latest version of plex. My thought was that things are moving very quickly and maybe I'd get lucky and the HW transcoding would be fixed in the newest versions.

 

And to some degree, I think some parts were easier. I didn't have to do anything to have the integrated GPU drivers to install (thats now part of 6.10.0) and I only had to add /dev/dri as a device in my binhex-plex docker container for it to be passed properly to the container (see uploaded screenshot for unraid terminal window commands /dev/dr ls -ltr and docker exec -it binhex-plex ls -lh /dev/dri).

 

But hardware decoding is not working for me, and not just on 4K HDR transcodes but also 1080 h.264 files. As so much of the info out there is now a few months old or for other hardware my question is: Is the general consensus that this is something I can possibly fix right now (by switching repositories to linuxserver.io or other, or editing the right files/running the right script, or using the right version of PMS), or is it that I need to sit tight for plex to support Rocket Lake processors properly? 

 

Screen Shot 2021-08-18 at 10.30.56 AM.png

Link to comment
On 8/18/2021 at 10:52 AM, David Stein said:

Hello All,

 

I hope since this thread was recently topped you will not mind if I add a question of my own. I am a new convert to unRAID/docker with its main function being a plex server. Server has a i5-11600K (no PCIe graphics card), I am using unRAID 6.10.0-rc1, and I am using the binhex version of plex running PMS 1.24.0.4930. I know from reading this and other threads on the unRAID and plex forums that I am playing with fire by using Rocket Lake, an rc unRAID version, and the latest version of plex. My thought was that things are moving very quickly and maybe I'd get lucky and the HW transcoding would be fixed in the newest versions.

 

And to some degree, I think some parts were easier. I didn't have to do anything to have the integrated GPU drivers to install (thats now part of 6.10.0) and I only had to add /dev/dri as a device in my binhex-plex docker container for it to be passed properly to the container (see uploaded screenshot for unraid terminal window commands /dev/dr ls -ltr and docker exec -it binhex-plex ls -lh /dev/dri).

 

But hardware decoding is not working for me, and not just on 4K HDR transcodes but also 1080 h.264 files. As so much of the info out there is now a few months old or for other hardware my question is: Is the general consensus that this is something I can possibly fix right now (by switching repositories to linuxserver.io or other, or editing the right files/running the right script, or using the right version of PMS), or is it that I need to sit tight for plex to support Rocket Lake processors properly? 

 

Screen Shot 2021-08-18 at 10.30.56 AM.png

 

having the exact same issue on 11th gen intel. any help would be appreciated.

edit: i did install intel gpu top, and unfortunately that did not work either

Edited by Syed
Link to comment

Hi all, I'm an Unraid/Plex newbie and just set up my first server for Quicksync transcoding with an 11400. I have followed the tutorial in this thread to enable hardware transcoding and it appears to be working as the dashboard shows (hw) during transcoding.

2.PNG.b888e5585113c455a182302a38c06f7f.PNG

However I am unable to get 4K movies to transcode without introducing artifacts:

1.thumb.png.29bbe7b2a363a24e2c909b9e4219d6a4.png

Transcoding from 1080p files works fine. From reading through this thread it appears this may be some sort of issue on Plex's end? I am running Unraid 6.9.2 and the linuxserver version of plex however I am not sure how to determine the current version. Is what I am experiencing a familiar issue or something possibly wrong with my setup? Any help is greatly appreciated!

 

Link to comment

Hi all,

 

I've been having an issue with GPU hangs in plex. I usually use an I5-8600K, but I swapped with an I7-9700K too see if the CPU was the issue too.

Usually, I have Plex running for about a day with multiple people transcoding and I eventually get a GPU hang in the Syslog. In 6.8.3, I see the following error:

Aug 11 01:22:24 JONAD kernel: [drm] GPU HANG: ecode 9:0:0x8fcffff9, in Plex Transcoder [13784], reason: hang on rcs0, action: reset

Aug 11 01:22:24 JONAD kernel: i915 0000:00:02.0: Resetting rcs0 for hang on rcs0

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: i915 0000:00:02.0: Resetting chip for hang on rcs0

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: i915 0000:00:02.0: Failed to reset chip

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

After this, Plex falls back to software transcoding until Unraid is rebooted.

 

In 6.9.2 , a GPU hang also occurs, but the chip manages to reset. This results in streams that endlessly buffer until they are manually refreshed, but stay on HW transcoding. In that case, the error resembles below:

resetting rsc0 for cs error

HW transcoding was working flawlessly for most of 2020, and at one point I added a video card for a Windows VM and messed with IOMMU groups to pass it through. I want to say I started to see problems after that, but I'm not sure. My fallback solution is to just use this Nvidia card for plex transcoding, but I rather liked using QuickSync for this purpose. Does anyone know of problems with i915 in the latest plex versions? I have tried both linuxserver and binhex repo's.

Thanks for your help!

Link to comment
On 8/24/2021 at 11:58 AM, Syed said:

ended up reverting back to the latest stable of unraid, installing intel gpu top and now transcoding works fine with igpu for intel 11th gen

To confirm, you aren't experiencing any artifacts or crashes while hardware transcoding 4K HDR content? According to this plex forum thread, both Tiger Lake and Rocket Lake CPUs have confirmed issues ongoing. Which version of unraid and plex docker are you using? Could you elaborate on what you have done exactly to get it working?

Link to comment
2 hours ago, Ocman76 said:

To confirm, you aren't experiencing any artifacts or crashes while hardware transcoding 4K HDR content? According to this plex forum thread, both Tiger Lake and Rocket Lake CPUs have confirmed issues ongoing. Which version of unraid and plex docker are you using? Could you elaborate on what you have done exactly to get it working?

Most likely he doesn't have 4k HDR videos 

Link to comment
  • 4 weeks later...
  • 3 weeks later...
  • 2 weeks later...
On 8/30/2021 at 10:51 PM, JonaD said:

Hi all,

 

I've been having an issue with GPU hangs in plex. I usually use an I5-8600K, but I swapped with an I7-9700K too see if the CPU was the issue too.

Usually, I have Plex running for about a day with multiple people transcoding and I eventually get a GPU hang in the Syslog. In 6.8.3, I see the following error:

Aug 11 01:22:24 JONAD kernel: [drm] GPU HANG: ecode 9:0:0x8fcffff9, in Plex Transcoder [13784], reason: hang on rcs0, action: reset

Aug 11 01:22:24 JONAD kernel: i915 0000:00:02.0: Resetting rcs0 for hang on rcs0

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: i915 0000:00:02.0: Resetting chip for hang on rcs0

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

Aug 11 01:22:24 JONAD kernel: i915 0000:00:02.0: Failed to reset chip

Aug 11 01:22:24 JONAD kernel: [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout

After this, Plex falls back to software transcoding until Unraid is rebooted.

 

In 6.9.2 , a GPU hang also occurs, but the chip manages to reset. This results in streams that endlessly buffer until they are manually refreshed, but stay on HW transcoding. In that case, the error resembles below:

resetting rsc0 for cs error

HW transcoding was working flawlessly for most of 2020, and at one point I added a video card for a Windows VM and messed with IOMMU groups to pass it through. I want to say I started to see problems after that, but I'm not sure. My fallback solution is to just use this Nvidia card for plex transcoding, but I rather liked using QuickSync for this purpose. Does anyone know of problems with i915 in the latest plex versions? I have tried both linuxserver and binhex repo's.

Thanks for your help!

 

Did you ever find a resolution for this? I have an i5-10400 CPU that up til recently (not sure when to be honest) had been running hardware transcodes flawlessly.  I'm on unRAID 6.9.2 and the latest version of Plex docker from Plex's own repo.  I cannot get hardware transcoding to work now to save my life.... and I don't see any sign of GPU hangs in the logs either.

Link to comment
On 10/29/2021 at 10:02 AM, rswafford said:

 

Did you ever find a resolution for this? I have an i5-10400 CPU that up til recently (not sure when to be honest) had been running hardware transcodes flawlessly.  I'm on unRAID 6.9.2 and the latest version of Plex docker from Plex's own repo.  I cannot get hardware transcoding to work now to save my life.... and I don't see any sign of GPU hangs in the logs either.

More fiddling this morning, and I discovered that the circled checkbox on my Plex server was unchecked.  As soon as I ticked it and tried another video, everything is HW transcoded.  Not sure if this is a new setting, or got toggled off in a recent update, but anyone having problems with HW encoding should make sure both Hardware Acceleration AND Hardware Accelerated Video Encoding are toggled on:

 

image.png.f66a09213a9646360cfde3fee769d3c0.png

Link to comment
  • 2 weeks later...

Just fyi - on my 12600k i can see using /dmesg

Quote

[   21.846855] i915 0000:00:02.0: Your graphics device 4680 is not properly supported by the driver in this
               kernel version. To force driver probe anyway, use i915.force_probe=4680
               module parameter or CONFIG_DRM_I915_FORCE_PROBE=4680 configuration option,
               or (recommended) check for kernel updates.

I will try it out with the suggestions in the message in the coming days but maybe alder lake needs an updated linux kernel we'll see :)

 

edit: tried to use "i915.force_probe=4680" but didn't work for me

Edited by Blobbonator
test result added
Link to comment
  • 3 weeks later...

hello , i posted in the main support forum but no one give a crap .i have a supermicro mobo with ipmi and remote control.

Everytime i try to enable hardware transcoding the full box hangs and i need to do a hard reboot.

 

is there a way to enable quicksync in unraid with a supermicro board?.

specs are i7 6700k+supermicro X11SSH-F +16gb NON ECC +2 sas 9210-8i IT mode ,lots of hard drives 2 cache SSD and a 10 gbps AQC ethernet card. is there a way to enable it or there is no way to do it? ,could it be the reason why everything ,included remote control hard freezes?

Link to comment
  • 2 weeks later...
On 2/13/2019 at 10:16 AM, lotetreemedia said:

***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 :)

 

Y

===========

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

 

image.png.9cd4ae4363ae30830104928b8216beae.png

 

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.

 

image.png.f9dc9b2bb939429edada4c935b7841f9.png

 

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

 

image.png.c517a8048527c23ad8ba422ff5efdef5.png

 

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.

 

PreRequisites

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.

Type:

 

cd /dev/dri
ls
 

 

image.png.9de37b4cc64ab331374ecc9e21f37e1a.png

 

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:

 

modprobe i915
 

There should be no return or errors in the output. Now again run:

 

cd /dev/dri
ls
 

 

You should see the expected items ie. card0 and renderD128

 

Give your Container Access

 

1900818547_UntitledDiagram-Page-1.png.1e8a3cda3771d026d2dd8dbfc6aa43d3.png

 

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

  1. Head over to the Docker Tab,
  2. click on the your Plex container.
  3. Scroll to the bottom click on Add another Path, Port, Variable
  4. Select Device from the drop down Enter the following:

 

Name: /dev/dri
Value: /dev/dri
 

image.png.29c9e3f747da573cd996e7459ec19c1e.png

 

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".

 

image.png.e6ee4c51219761eded26a316dd45b427.png

 

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.

 

image.png.448e67bb89fb03886652d7f00b8b5df8.png

 

If you see "(hw)" congrats! You're using Quick Sync and Hardware acceleration emoji4.png

 

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:

 

nano /boot/config/go
 

Add the following lines to the bottom of the go file

 

modprobe i915
chmod -R 777 /dev/dri
 

image.png.ac780f8412108de519155289a3a3f9d6.png

 

Press Ctrl X, followed by Y to save your go file. And you should be golden!

 

Just wanted to say thanks - this worked. I'm still leery of the whole "chmod 777" step but yea, it works. Hopefully UnRAID includes this as a toggle in the UI in the next release. Seems simple enough on the surface, although I'm sure it really isn't that simple.

Link to comment
  • 3 weeks later...

I'm still struggling to get the /dev/dri device to show up. Does this depend on a feature of the motherboard that I am not aware of? I haven't even tried the plex side because the device does not exist and intel_gpu_top -L returns no devices.

 

Specs:

unraid 6.9.2

CPU: intel i7-11700K

Motherboard: MSI Z590-A Pro with iGPU enabled in bios (On msi it's called IGD and it makes your iGPU your primary. I assume that's all that is needed). Also HVM and IOMMU is enabled.

intel_gpu_top is installed

/boot/config/modprobe.d/i915.conf file created

 

Not sure how important this will be for my set up but I'm hoping to add a 4k movie soon and I want to be able to watch it on different devices.

 

Link to comment
5 hours ago, voyager12 said:

I'm still struggling to get the /dev/dri device to show up. Does this depend on a feature of the motherboard that I am not aware of? I haven't even tried the plex side because the device does not exist and intel_gpu_top -L returns no devices.

 

Specs:

unraid 6.9.2

CPU: intel i7-11700K

Motherboard: MSI Z590-A Pro with iGPU enabled in bios (On msi it's called IGD and it makes your iGPU your primary. I assume that's all that is needed). Also HVM and IOMMU is enabled.

intel_gpu_top is installed

/boot/config/modprobe.d/i915.conf file created

 

Not sure how important this will be for my set up but I'm hoping to add a 4k movie soon and I want to be able to watch it on different devices.

 

I could be wrong but I don’t think 6.9.2 will work with 11th gen Core CPU’s. I believe it’s limited to 10th gen.

Link to comment
28 minutes ago, voyager12 said:

I just tried with the ASRock z590 Pro4 and that doesn't work either. Am I missing something? Does it not work with the Z590 chipset?

If you have other video cards for pass through is the Intel GPU set as the primary video card in the BIOS? I know some boards will disable Quick Sync if it’s not primary.

Edited by Taddeusz
Link to comment
16 minutes ago, voyager12 said:

I just tried with the ASRock z590 Pro4 and that doesn't work either. Am I missing something? Does it not work with the Z590 chipset?

There is nothing I know of in the Z590 chipset that would prevent the iGPU from being supported.  Of course, the first step is always to get /dev/dri to show up if you want to use the iGPU for hardware transcoding.

 

In the case of the last few motherboards I have used with hardware transcoding, setting the primary graphics adapter to onboard, iGFX, IGD, etc. according to the BIOS is all that was needed to cause /dev/dri to show up.  Do not set primary graphics adapter to Auto if that is an option.

 

Intel GPU Top appeared be messing with my i915 drivers so I uninstalled it.  You might want to do that until you get /dev/dri with the proper contents to show up.

 

image.png.7151cdf09cf35462bbeaf6854201003a.png

 

At one point I had /dev/dri without renderD128 but you need that for transcoding.  Uninstalling Intel GPU top and recreating the i915.conf with the 'touch' method resolved it for me.

 

I will try reinstalling Intel GPU Top now that I know I have /dev/dri and i915 drivers working properly.

  • Thanks 1
Link to comment

I set my primary graphics card to onboard for both boards and am still not able to get /dev/dri to show up. As a side note, when I add an nvidia graphics card and install the drivers, it shows up at the /dev/dri spot instead, so it seems that I am not setting the iGPU to be primary correctly. But the setting is doing something because the terminal does display on the integrated graphics HDMI port.

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.