Activating Plex hardware acceleration

TensorVortex

Dabbler
Joined
Sep 21, 2019
Messages
14
I just upgraded Truenas Core 12 Beta2, and now the coffeelake CPU quick sync device is visible in /dev/dri now. Before you can only see /dev/drm and no dri. Mine is a 8th gen i5-8400.
Gonna try to enable quick sync today and see how it goes.
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
I just upgraded Truenas Core 12 Beta2, and now the coffeelake CPU quick sync device is visible in /dev/dri now. Before you can only see /dev/drm and no dri. Mine is a 8th gen i5-8400.
Gonna try to enable quick sync today and see how it goes.
I've got TrueNAS-12.0-BETA2.1 and can see only drm in /dev. MB with Intel z390 and intel 9600k
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I've got TrueNAS-12.0-BETA2.1 and can see only drm in /dev. MB with Intel z390 and intel 9600k

Current working theory is that coffee lake refresh is not supported by FreeBSD 12.1.

To confirm, you could run lspci -qnn , that should get you the PCI ID of your iGPU.
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
Current working theory is that coffee lake refresh is not supported by FreeBSD 12.1.

To confirm, you could run lspci -qnn , that should get you the PCI ID of your iGPU.
# lspci -qnn
00:00.0 Host bridge [0600]: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers [8086:3ec2] (rev 0a)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 0a)
00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 630 (Desktop 9 Series) [8086:3e98]
00:12.0 Signal processing controller [1180]: Intel Corporation Cannon Lake PCH Thermal Controller [8086:a379] (rev 10)
00:14.0 USB controller [0c03]: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller [8086:a36d] (rev 10)
00:14.2 RAM memory [0500]: Intel Corporation Cannon Lake PCH Shared SRAM [8086:a36f] (rev 10)
00:16.0 Communication controller [0780]: Intel Corporation Cannon Lake PCH HECI Controller [8086:a360] (rev 10)
00:17.0 SATA controller [0106]: Intel Corporation Cannon Lake PCH SATA AHCI Controller [8086:a352] (rev 10)
00:1c.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port #6 [8086:a33d] (rev f0)
00:1d.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 [8086:a330] (rev f0)
00:1f.0 ISA bridge [0601]: Intel Corporation Z390 Chipset LPC/eSPI Controller [8086:a305] (rev 10)
00:1f.4 SMBus [0c05]: Intel Corporation Cannon Lake PCH SMBus Controller [8086:a323] (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller [8086:a324] (rev 10)
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (7) I219-V [8086:15bc] (rev 10)
01:00.0 Serial Attached SCSI controller [0107]: Broadcom / LSI SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] [1000:0072] (rev 03)
02:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03)
03:00.0 Non-Volatile memory controller [0108]: Intel Corporation SSD Pro 7600p/760p/E 6100p Series [8086:f1a6] (rev 03)
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
00:02.0 VGA compatible controller [0300]: Intel Corporation UHD Graphics 630 (Desktop 9 Series) [8086:3e98]

Thank you for confirming. That PCI ID was added in kernel 4.20; FreeBSD's drm-kmod package is based on kernel 4.16.

drm-devel-kmod, last I looked, was based on 5.3. That's available in FreeBSD 13.

Let's call that confirmed: ix-9xxx CFL Refresh use [8086:3e98] and aren't supported in FreeBSD 12.x.
 

TensorVortex

Dabbler
Joined
Sep 21, 2019
Messages
14
I just upgraded Truenas Core 12 Beta2, and now the coffeelake CPU quick sync device is visible in /dev/dri now. Before you can only see /dev/drm and no dri. Mine is a 8th gen i5-8400.
Gonna try to enable quick sync today and see how it goes.

Quick sync does work, and works 90% of time.
But it does hang if I switch video too fast? or it could be certain format that's causing the hang.
Evreytime I add a new movie/show, and let plex scan new file, it will hang at 'analyse intro'. Haven't checked log yet to see what's really hanging.

a system reboot is required to fix the hang, jail won't be able to shut down itself.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
But it does hang if I switch video too fast? or it could be certain format that's causing the hang.
a system reboot is required to fix the hang, jail won't be able to shut down itself.

Could be a format problem. I see something like you do with files that contain PGS or VOBSUB subtitles. I raised the issue in the Plex forums and Plex dug into it, but unfortunately the logs don’t show anything, and the Plex folk cant reproduce locally.
If you want to pile on with your details - hardware, software, codecs used in the problem files - it may help.
 

kegobeer

Cadet
Joined
Oct 7, 2020
Messages
4
First, thanks to everyone that's contributed to this thread. Reading it has been incredibly helpful. I can't get hw working, but everything else seems to be running correctly.

My info:
I'm running FreeNAS 11.3 U5
I have a C226 chipset with a Xeon E3-1275 v3 (Lenovo TS-140 motherboard)
Using danb35's script

The script detects the iGPU, everything is installed correctly, I have the DRI and DRM directories, the VGA compatible controller shows up under lspci, the jail starts correctly with devfs_ruleset 10, and hardware encoding/decoding is enabled in Plex (I'm a PlexPass owner). However, I can't get hardware during transcoding.

Originally I was running 12.0 RC1, and I had the same problems, so I installed 11.3 to see if that was the problem, but the same thing is happening on both installs. Is it because the i915 driver isn't in the /plexmediaserver-plexpass/lib/dri directory? I see the i965 and iHD drivers are in there.

Thanks.
 

kegobeer

Cadet
Joined
Oct 7, 2020
Messages
4
Looking in the Plex logs I see that it says hardware transcoding is enabled but no hard decode accelerator was found, so even though the jail shell shows dri and drm folders, and in a normal ssh window the iGPU is available, it looks like Plex can't access it. I am running PMS 1.20.1.3252.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
That sounds like something to dig into with the Plex devs over at the Plex forums. You've done all you can do on the FreeBSD side of things.
 

Cyberpower678

Dabbler
Joined
Jul 27, 2020
Messages
37
First, thanks to everyone that's contributed to this thread. Reading it has been incredibly helpful. I can't get hw working, but everything else seems to be running correctly.

My info:
I'm running FreeNAS 11.3 U5
I have a C226 chipset with a Xeon E3-1275 v3 (Lenovo TS-140 motherboard)
Using danb35's script

The script detects the iGPU, everything is installed correctly, I have the DRI and DRM directories, the VGA compatible controller shows up under lspci, the jail starts correctly with devfs_ruleset 10, and hardware encoding/decoding is enabled in Plex (I'm a PlexPass owner). However, I can't get hardware during transcoding.

Originally I was running 12.0 RC1, and I had the same problems, so I installed 11.3 to see if that was the problem, but the same thing is happening on both installs. Is it because the i915 driver isn't in the /plexmediaserver-plexpass/lib/dri directory? I see the i965 and iHD drivers are in there.

Thanks.
try running 'pw user mod plex -G video' from within the Plex jail and try again. Plex may need a restart after that command.
 

kegobeer

Cadet
Joined
Oct 7, 2020
Messages
4
I should have put that in my post - I verified the user was in the correct video group.
 

kegobeer

Cadet
Joined
Oct 7, 2020
Messages
4
You have it working on the same hardware I'm using? If so, can you list the steps you did to get it working?
 

Cyberpower678

Dabbler
Joined
Jul 27, 2020
Messages
37
You have it working on the same hardware I'm using? If so, can you list the steps you did to get it working?
Our hardware is not the same but I use the i915 driver as well.

I’m using a custom devfs rule set that passes drm and dri to the jail. The plex user is a member of the video group in the jail and plex is set to use HW acceleration. It’s possible that Xeon just isn’t compatible with Plex. Can you show me what’s in your devfs script?
 

ARRRRGGGGHHH

Dabbler
Joined
Mar 25, 2020
Messages
32
hw encode/decode no longer works for me since upgrading to 12.0 RELEASE.

Well... It does. But only once. Then the server locks up and hw encode doesn't work at all.

Disable hw encoding and plex works again.

But can't stop the plex service or stop the jail.

Have tried this in a brand new jail with same problem.

At first it looked really good as i could decode/encode more HEVC streams than ever but...

It just stops working after a short while and it's all broken.

Tried all the versions of jail. They all have the same problem.

And all of the guides don't seem to match so i have no idea what new thing needs to be set for 12.0 to work correctly.

On an i5 7400.

It all worked fine before moving to Truenas12.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I’ve seen a similar issue I think. There’s nothing special you can do, other than troubleshoot the issue with the Plex devs on their forum. This is somewhere in Plex, most likely.

The guide on GitHub should match, there’s been no changes in 12.0 to the basic workflow.
 

ARRRRGGGGHHH

Dabbler
Joined
Mar 25, 2020
Messages
32
Right.

Can I roll back to 11.3?

Or because my pools are upgraded I am stuffed?

Oh and it doesn't work at all now. Not even a brand new jail where as it used to work sometimes before locking up.

I think I will have to move away from FreeNAS.
 
Top