Activating Plex hardware acceleration

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Move now, don't upgrade your pool. If you are not using the features, then don't enable the feature flags, that simple.
 

elorimer

Contributor
Joined
Aug 26, 2019
Messages
194
Is here somebody with Coffee Lake CPU and TrueNAS 12 beta who can successfully turn on HW acceleration?
I have a Gemini Lake CPU (so, sorta a generation newer and off to the side) on TrueNAS12 beta and can turn on HW acceleration but the drivers have bugs that keep it from working well.
 

capindc

Cadet
Joined
Oct 24, 2017
Messages
4
Yorick 1st thank you for all the support you give to the community. I would like to know if you have time to help me.
I am running 12.1 Jails. I only see the drm I do not see dri can you help

freenas# lspci
00:00.0 Host bridge: Intel Corporation 8th Gen Core 8-core Desktop Processor Host Bridge/DRAM Registers [Coffee Lake S] (rev 0d)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 0d)
00:01.1 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x8) (rev 0d)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop 9 Series) (rev 02)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCImode]
00:1b.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #17 (rev f0)
00:1b.2 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #19 (rev f0)
00:1b.4 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #21 (rev f0)
00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #1 (rev f0)
00:1c.2 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #3 (rev f0)
00:1c.4 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #5 (rev f0)
00:1c.5 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #6 (rev f0)
00:1c.6 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #7 (rev f0)
00:1c.7 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #8 (rev f0)
00:1d.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #9 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Z370 Chipset LPC/eSPI Controller
00:1f.2 Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
00:1f.4 SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2)
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I only see the drm I do not see dri can you help

You mean in FreeBSD proper? I'm not sure what's causing that, you're the second user who's reporting issues with Coffee Lake. You certainly have the hardware visible, and I'm assuming you're loading the driver on boot.

Do you have drm messages in dmesg that may shed light?
 

capindc

Cadet
Joined
Oct 24, 2017
Messages
4
dmesg log is huge and I am not seeing all of the file. Is there away I could see it all also what kind of drm message should I look for
Yes FreeBSD 12.1
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
You can configure your SSH service to allow root logins (obviously don't expose that to Internet), log in with an SSH client of choice (Win10 has it built in, or PuTTY, whatever works for you), and run dmesg | less.

An example of what that looks like when it works is in this thread, a message this past Friday, on the previous page.

When I run kldstat on my Kaby Lake CPU, this is what that looks like.

Code:
30    1 0xffffffff83a2b000   12c0fc i915kms.ko
31    1 0xffffffff83b58000    75e60 drm.ko
32    3 0xffffffff83bce000    13f30 linuxkpi_gplv2.ko
33    2 0xffffffff83be2000      6d0 debugfs.ko
34    1 0xffffffff83be3000     240d i915_kbl_dmc_ver1_04_bin.ko
 
Last edited:

capindc

Cadet
Joined
Oct 24, 2017
Messages
4
I do not see any drm messages in dmesg
when I run kldstat
8 1 0xffffffff838fc000 12c0fc i915kms.ko
29 1 0xffffffff83a29000 75e60 drm.ko
30 3 0xffffffff83a9f000 13f30 linuxkpi_gplv2.ko
31 2 0xffffffff83ab3000 6d0 debugfs.ko
32 1 0xffffffff83ab4000 acf mac_ntpd.ko
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
It never loads the firmware, and it's interesting you see nothing in dmesg. Also i915kms comes in earlier than I'd expect. Just to check the obvious - you're running the script that loads i915 post-init, not pre-init, right?

I don't have anything particularly clever to suggest, since I don't have a CL to test with. If this was my system, I'd simplify. No script, experiment with kldload /boot/modules/i915kms.ko from command line, see whether that behaves differently when it's not loaded on boot, and see what the FreeBSD desktop group can suggest.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
It never loads the firmware, and it's interesting you see nothing in dmesg. Also i915kms comes in earlier than I'd expect. Just to check the obvious - you're running the script that loads i915 post-init, not pre-init, right?

I don't have anything particularly clever to suggest, since I don't have a CL to test with. If this was my system, I'd simplify. No script, experiment with kldload /boot/modules/i915kms.ko from command line, see whether that behaves differently when it's not loaded on boot, and see what the FreeBSD desktop group can suggest.


Hi Yorick, I have been looking at upgrading my Freenas. Someone mentioned in the thread earlier that the i3 8100 might be a good candidate, and I know you mentioned earlier in this thread that you need Kaby Lake or better for 4k transcoding. So that would fit the bill.

I just wondered if you had any thoughts or recommendations that would fit the bill from your experience, not only personally but given how active and helpful you are on the forums you might have a wider breadth of experience to draw on.

The i3 8100 can be nabbed for less than $65 at the moment, and considering this is all I really need it to do (beyond the VPN/PiHole) I wanted to get your opinion on it. That price point is not fixed, just saying damn that is cheap and it may be worth the upgrade if only to shut up family members who are complaining that they can't all watch movies at the same time, but if you have a superior suggestion I can do the value comparison.

Thanks!
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
@capindc, I might have an idea. If you’re game to do some sleuthing, this would require a couple steps. From the FreeBSD 12.0 release notes:


FreeBSD has changed the way graphics drivers are handled on amd64 and i386. Graphics drivers for modern ATI/AMD® and Intel® graphics cards are now available in the Ports Collection. The base drivers are still available and will be installed by default, but they lack support for current generation laptop and desktop systems.

In most cases it is enough to install graphics/drm-kmod from ports or packages to install a driver appropriate for the system, then adding the appropriate driver to kld_list in rc.conf(5).”

I know that TrueNAS, by design, reverts to its version of packages on boot. Two step test would be therefore to see whether the drm-kmod pkg has a newer /boot/modules/i915kms.ko that works, and then if so, discuss the best way to load it.

You’d want to boot without the script activated.

Then edit /usr/local/etc/pkg/repos so that local.conf is disabled and FreeBSD.conf is enabled.

pkg install drm-kmod, then kldload /boot/modules/i915kms.ko . Full path is important.

and see whether /dev/dri shows up.
If so, then copying the i915kms.ko so it’s next to the script (doesn’t get overwritten) and calling that from the script may be a workaround, and then petition ix to ship with newer drivers.

If not, then I’m back to “I don’t understand this, ask some FreeBSD folk for help”.

@Dravinian, as you can see, coffee lake support is currently not there, and we don’t know why, yet. You can do what I did at the time: buy the hardware you want; tell Plex to optimize ahead of time to keep your relatives happy (an SDR alongside 4k is better quality anyway), and tinker with hardware decode until it works.
 

capindc

Cadet
Joined
Oct 24, 2017
Messages
4
@Yorick First the plex server would not start because the ruleset was set to 10 changed to 5 nothing changed to 100 it started with DRM but still no DRI. So I have changed everything back start asking the guys on the freeBSD
 

elorimer

Contributor
Joined
Aug 26, 2019
Messages
194
The libva-intel-media graphics driver is updated from 20.2.p4 to 20.3.p3 but this didn't change anything for me.

I also went down the path of changing to the FreeBSD.conf repo and updating; then the pms jail wouldn't restart for me.
 
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
At this point it’s not about the jail, it’s about getting the iGPU recognized in FreeBSD. Once that’s done, only then would testing start on how to pass it through to the jail - which likely will “just work” at that point though.

Thanks for testing, and as you do, focus on FreeBSD, not the Plex jail. That keeps the testing simpler. That’s my recommendation at least.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Turns out I do have a Coffee Lake generation machine, of sorts - this laptop, with a Whiskey Lake i5-8365U.

Since the issue here is loading the drivers, I did that: Fresh install of TrueNAS Core 12.0 Beta 1, then try to load i915kms.ko from console. Hardware console so I'd see any messages that might come up.

Result: The driver loads and detects the iGPU fine. Which means this isn't an issue with an outdated drm-kmod. Either drm-kmod plain doesn't support the CPUs people have tried this on so far, or something else is going on.

Here's a screenshot of what that looks like, lspci -q and then kldload /boot/modules/i915kms.ko. This test setup was never going to have a pool, so don't expect anything Plex-related. Since the failures are at FreeBSD level, though, not with the Plex jail, it's a good enough test.

/dev/drm and /dev/dri are present in FreeBSD after loading the driver.

Edit: Just as a recap, so far we have two reports of the driver loading on 8th gen - Gemini Lake, Whiskey Lake - and two reports of the driver not loading on 9th gen Desktop, Coffee Lake Refresh.

TrueNAS-Coffee-Lake.jpg
 
Last edited:

Cyberpower678

Dabbler
Joined
Jul 27, 2020
Messages
37
Maybe some can help me out here. I'm planning a data migration to new server hardware and would like to use TrueNAS. I have installed TrueNAS onto a test disk, so I can experiment and figure out what works best. One of the things I'm trying to set up is of course HW acceleration. I have an Intel CPU with UHD 610. I see /dev/drm, but not /dev/dri when I run kldload i915kms.

FreeBSD is 12.1, running TrueNAS 12.0 Beta
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I managed to get myself into a boot loop by setting compat.linuxkpi.i915_enable_guc. If you're thinking of fiddling with that setting, be aware it may crash your machine when loading i915kms.ko.
 

Cyberpower678

Dabbler
Joined
Jul 27, 2020
Messages
37
I managed to get myself into a boot loop by setting compat.linuxkpi.i915_enable_guc. If you're thinking of fiddling with that setting, be aware it may crash your machine when loading i915kms.ko.
Got any idea why I can't get /dev/dri to appear with my Intel G5900?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
Got any idea why I can't get /dev/dri to appear with my Intel G5900?

In short, your CPU is too new. See https://forums.freebsd.org/threads/...or-intel-integrated-graphics-with-xorg.66732/.

=== THE "NEW" AND THE "OLD" DRIVER ===​
As the title suggests, since FreeBSD 11.2-RELEASE, we have two kms drivers with the same name. In FreeBSD 11.1-RELEASE there is only the i915kms.ko driver from the base system. Since FreeBSD 11.2-RELEASE there are two - the one in the base system and the new one in the ports. Both share the same name (i915kms.ko).​
The driver in the base system is (like all kernel modules) located in /boot/kernel/, while the one from the ports will be in /boot/modules/ after building and installing it.​
The base system i915kms.ko driver supports the Intel Core family processors up to the Haswell (4th) generation of Intel Core processors. The new i915kms.ko driver available from ports (graphics/drm-next-kmod) since FreeBSD 11.2-RELEASE, supports Intel Core family processors up to Kaby Lake (7th) generation.​
 

Cyberpower678

Dabbler
Joined
Jul 27, 2020
Messages
37
I managed to get myself into a boot loop by setting compat.linuxkpi.i915_enable_guc. If you're thinking of fiddling with that setting, be aware it may crash your machine when loading i915kms.ko.
So you know, this is
In short, your CPU is too new. See https://forums.freebsd.org/threads/...or-intel-integrated-graphics-with-xorg.66732/.

=== THE "NEW" AND THE "OLD" DRIVER ===​
As the title suggests, since FreeBSD 11.2-RELEASE, we have two kms drivers with the same name. In FreeBSD 11.1-RELEASE there is only the i915kms.ko driver from the base system. Since FreeBSD 11.2-RELEASE there are two - the one in the base system and the new one in the ports. Both share the same name (i915kms.ko).​
The driver in the base system is (like all kernel modules) located in /boot/kernel/, while the one from the ports will be in /boot/modules/ after building and installing it.​
The base system i915kms.ko driver supports the Intel Core family processors up to the Haswell (4th) generation of Intel Core processors. The new i915kms.ko driver available from ports (graphics/drm-next-kmod) since FreeBSD 11.2-RELEASE, supports Intel Core family processors up to Kaby Lake (7th) generation.​
I'm using TrueNAS which uses FreeBSD 12.1-STABLE
 

Cyberpower678

Dabbler
Joined
Jul 27, 2020
Messages
37
I misread your message. I thought what you were writing only applied to FreeBSD 11. Do you know at all if this will be supported down the road?
 
Top