Activating Plex hardware acceleration

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Am I missing something or SOL?

Which version of TrueNAS Core? I am being silly - if you followed the guide you are on TrueNAS Core and an “lspci -q” will show us whether the iGPU shows up from a hardware perspective; if you didn’t catch the part in the guide that talks about 9th gen CPUs then you are on FreeNAS 11.3 and yes, that won’t work.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
I followed https://github.com/kern2011/Freenas-Quicksync but can't get /dev/dri to show in FreeNAS (or Plex jail), but drm is there.

Intel Core i5-9400 on AsRock Z390M-ITX motherboard.

Pretty sure QuickSync is supported, its why I bought it, but I don't see anything in BIOS related to QS or iGPU.

Am I missing something or SOL?

If you can run the command lspci

That will let you know whether your iGPU is showing up.

Also, do you have a GPU in the machine, I had 2 in mine and that was blocking the iGPU.
 

dexll

Dabbler
Joined
Jul 16, 2020
Messages
10
“lspci -q” will show us whether the iGPU shows up from a hardware perspective
I don't see 'iGPU' anywhere after running that command.

guide that talks about 9th gen CPUs then you are on FreeNAS 11.3 and yes, that won’t work.
Version: FreeNAS-11.3-U3.2 :(

do you have a GPU in the machine
no GPU... (I don't think)


root@MyNaS[~]# lspci -q
00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop)
00:12.0 Signal processing controller: Intel Corporation Cannon Lake PCH ThermalController (rev 10)
00:14.0 USB controller: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller (rev 10)
00:14.2 RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)
00:16.0 Communication controller: Intel Corporation Cannon Lake PCH HECI Controller (rev 10)
00:17.0 SATA controller: Intel Corporation Cannon Lake PCH SATA AHCI Controller(rev 10)
00:1c.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #6 (rev f0)
00:1c.6 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #7 (rev f0)
00:1d.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Z390 Chipset LPC/eSPI Controller (rev 10)
00:1f.3 Audio device: Intel Corporation Cannon Lake PCH cAVS (rev 10)
00:1f.4 SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller (rev 10)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (7) I219-V (rev 10)
02:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
I followed https://github.com/kern2011/Freenas-Quicksync but can't get /dev/dri to show in FreeNAS (or Plex jail), but drm is there.

Intel Core i5-9400 on AsRock Z390M-ITX motherboard.

Pretty sure QuickSync is supported, its why I bought it, but I don't see anything in BIOS related to QS or iGPU.

Am I missing something or SOL?
Your config is in the Compatibility list? Also see Hardware requirements Intel Xeon / Intel server C2xx chipsets.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
> VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop)

There it is. BIOS and motherboard are fine. Now you just need to be on a version of FreeBSD that supports that iGPU, and that’s FreeBSD 12.1, which is available with TrueNAS Core 12.0.

That FreeNAS 11.3 does not support the iGPU in 8th and 9th generation CPUs is called out in the guide, but I get that “generation” may not be super-obvious to people. It’s the first digit after ix- , so an i5-9xxx is 9th generation, “Coffee Lake Refresh”. No go on FreeBSD 11.3 for its iGPU.

iGPU btw just means “internal Graphics Processing Unit”, as in built-in graphics on a processor. You won’t see that term in lspci, it’s a generic term for any kind of GPU that’s not an add on card or separate chip on the motherboard, but instead built right into the CPU packaging.

You can either become familiar with boot environments and be very clear that you will NOT update your pool and understand what feature flags are, and try out TrueNAS Core now; or do all the same stuff and wait for the next Beta / RC or even release version.

In a nutshell, the boot environment lets you get back to 11.3 without fuss, check System->Boot; and if you upgrade your pool, you can’t go back (meaningfully), so do not ever upgrade your pool unless you know you are, indeed, boldly going forward, cause you can’t find reverse.

I am running TrueNAS Core Beta 1 and it’s fine, with a couple quirks around bhyve and upgrading jails, nothing major. I’m not ready to upgrade my pool though, I want to be able to fall back to 11.3 for testing at least. That’s been helpful in tracking down what’s going on with my hw transcode and subtitles, for example. It’ll be a little while before I burn my bridges and update that pool.
 
Last edited:

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
> VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop)

There it is. BIOS and motherboard are fine. Now you just need to be on a version of FreeBSD that supports that iGPU, and that’s FreeBSD 12.1, which is available with TrueNAS Core 12.0.

That FreeNAS 11.3 does not support the iGPU in 8th and 9th generation CPUs is called out in the guide, but I get that “generation” may not be super-obvious to people. It’s the first digit after ix- , so an i5-9xxx is 9th generation, “Coffee Lake Refresh”. No go on FreeBSD 11.3 for its iGPU.

iGPU btw just means “internal Graphics Processing Unit”, as in built-in graphics on a processor. You won’t see that term in lspci, it’s a generic term for any kind of GPU that’s not an add on card or separate chip on the motherboard, but instead built right into the CPU packaging.

You can either become familiar with boot environments and be very clear that you will NOT update your pool and understand what feature flags are, and try out TrueNAS Core now; or do all the same stuff and wait for the next Beta / RC or even release version.

In a nutshell, the boot environment lets you get back to 11.3 without fuss, check System->Boot; and if you upgrade your pool, you can’t go back (meaningfully), so do not ever upgrade your pool unless you know you are, indeed, boldly going forward, cause you can’t find reverse.

I am running TrueNAS Core Beta 1 and it’s fine, with a couple quirks around bhyve and upgrading jails, nothing major. I’m not ready to upgrade my pool though, I want to be able to fall back to 11.3 for testing at least. That’s been helpful in tracking down what’s going on with my hw transcode and subtitles, for example. It’ll be a little while before I burn my bridges and update that pool.
I've got TrueNAS-12.0-BETA on Z390 and i5-9600k, can you help me with the configuration for supporting HW transcoding?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I've got TrueNAS-12.0-BETA on Z390 and i5-9600k, can you help me with the configuration for supporting HW transcoding?

Should be as simple as following the guide or using Danb35’s script with USE_HW_TRANSCODE=1. How far did you get, and where are you stuck?
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
Should be as simple as following the guide or using Danb35’s script with USE_HW_TRANSCODE=1. How far did you get, and where are you stuck?
I've made everything in the section "Making It work". In jail shell after input "ls /dev" I can see only drm, not dri. Options "Use hardware acceleration when available " and "Use hardware-accelerated video encoding" were enabled in Plex settings, but don't work.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
In jail shell after input "ls /dev" I can see only drm, not dri.

That means it’s not been passed through: It may not be available to be passed through.
How about on the FreeBSD console itself? Do you see dri? What does lspci tell you? What messages do you have in dmesg related to the i915 driver loading?
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
That means it’s not been passed through: It may not be available to be passed through.
How about on the FreeBSD console itself? Do you see dri? What does lspci tell you? What messages do you have in dmesg related to the i915 driver loading?
In TrueNAS itself - only drm, can't see dri

lspci

00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 0a)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 0a)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Desktop 9 Series)
00:12.0 Signal processing controller: Intel Corporation Cannon Lake PCH Thermal Controller (rev 10)
00:14.0 USB controller: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller (rev 10)
00:14.2 RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)
00:16.0 Communication controller: Intel Corporation Cannon Lake PCH HECI Controller (rev 10)
00:17.0 SATA controller: Intel Corporation Cannon Lake PCH SATA AHCI Controller (rev 10)
00:1c.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #6 (rev f0)
00:1d.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Z390 Chipset LPC/eSPI Controller (rev 10)
00:1f.4 SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller (rev 10)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (7) I219-V (rev 10)
01:00.0 Serial Attached SCSI controller: Broadcom / LSI SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
02:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
03:00.0 Non-Volatile memory controller: Intel Corporation SSD Pro 7600p/760p/E 6100p Series (rev 03)

dmesg | grep i915 - nothing
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Okay the device is there. Looks like the script you are running to bring the devfs rules and the driver in isn’t working. Make sure that script is executable and has contents with Unix, not Windows, linefeeds, and that those contents are as expected.

Run the script manually and see what you get for output.

If running the script manually works, make sure your post init task is set up right.

If running the script manually doesn’t work, focus on just the driver part and do that manually witH a Kldload. Provided that works, figure out what you may have missed when creating the script.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
Okay the device is there. Looks like the script you are running to bring the devfs rules and the driver in isn’t working. Make sure that script is executable and has contents with Unix, not Windows, linefeeds, and that those contents are as expected.

Run the script manually and see what you get for output.

If running the script manually works, make sure your post init task is set up right.

If running the script manually doesn’t work, focus on just the driver part and do that manually witH a Kldload. Provided that works, figure out what you may have missed when creating the script.

I think Yorick is referring to this script, rather than the Dan script.

Code:
#!/bin/sh

echo '[devfsrules_bpfjail=101]
add path 'bpf*' unhide

[plex_drm=10]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add include $devfsrules_bpfjail
add path 'dri*' unhide
add path 'dri/*' unhide
add path 'drm*' unhide
add path 'drm/*' unhide' >> /etc/devfs.rules

service devfs restart

kldload /boot/modules/i915kms.ko


As it appears you are not seeing drm and dri, so there is a stop here where something is not working.
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
I think Yorick is referring to this script, rather than the Dan script.

Code:
#!/bin/sh

echo '[devfsrules_bpfjail=101]
add path 'bpf*' unhide

[plex_drm=10]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add include $devfsrules_bpfjail
add path 'dri*' unhide
add path 'dri/*' unhide
add path 'drm*' unhide
add path 'drm/*' unhide' >> /etc/devfs.rules

service devfs restart

kldload /boot/modules/i915kms.ko


As it appears you are not seeing drm and dri, so there is a stop here where something is not working.
I've used exactly this script.

When try to run script manually:
#machine /root/scripts/plex-ruleset.sh
kldload: can't load /boot/modules/i915kms.ko: module already loaded or in kernel
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Interesting. The driver loads, but /dev/dri isn't present, and you say you don't see anything in dmesg. This sounds like an OS-level issue. For reference, here is the relevant part of dmesg with a Kaby Lake CPU.

Edit: This is a really long shot. You want to make sure modeset wasn't changed to enable IPMI. sysctl compat.linuxkpi.i915_modeset should show -1.

Code:
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
Failed to add WC MTRR for [0xc0000000-0xcfffffff]: -22; performance may suffer
[drm] Got stolen memory base 0x0, size 0x0
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] Connector eDP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.eDP-1
[drm]   - kern.vt.fb.default_mode
[drm] failed to retrieve link info, disabling eDP
[drm] Initialized i915 1.6.0 20171222 for drmn0 on minor 0
[drm] Cannot find any crtc or sizes
drmn0: successfully loaded firmware image with name: i915/kbl_dmc_ver1_04.bin
[drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
 
Last edited:

dexll

Dabbler
Joined
Jul 16, 2020
Messages
10
There it is. BIOS and motherboard are fine. Now you just need to be on a version of FreeBSD that supports that iGPU, and that’s FreeBSD 12.1, which is available with TrueNAS Core 12.0.

Thank you! That sounds promising. Would you say the TrueNAS 12.0 Beta is safe to install? By safe, I mean safe for my data. This is just a home media server. I plan on of course exporting my config and detaching a mirror of my boot drive. Any other considerations I should be aware of before I upgrade? Thanks again!
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
Is here somebody with Coffee Lake CPU and TrueNAS 12 beta who can successfully turn on HW acceleration?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
@dexll Safe for your data, yes. But as you see in this discussion, there's no guarantee the FreeBSD drivers will work for you. Just make really sure you do NOT click on the "Upgrade Pool" option, because once you do, there's no going back. It's safe for your pool, but it locks you into TrueNAS Core 12.0 or later.
 

dexll

Dabbler
Joined
Jul 16, 2020
Messages
10
Just make really sure you do NOT click on the "Upgrade Pool" option, because once you do, there's no going back.
Thank you. I will heed that advice. The data will still be accessible though right?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
The data will still be accessible though right?

Read-only, yes, as long as none of the new pool features are in use. If they are, they must be taken out of use first. Encryption is one example, certain new quota options another. Read-only pool import is also a CLI process, I don't think FreeNAS auto-imports pools that have unsupported feature flags. You're really best off leaving the feature flags alone until you are certain you are staying with 12.0 and never, ever going back.
 

dexll

Dabbler
Joined
Jul 16, 2020
Messages
10
Honestly, I really do have every intention to upgrade to TrueNAS as soon as the dust settled from the integration. If TrueNAS is the future of FreeNAS I am in Whole Hog. Given that, in your opinion do you feel it is safe to move into the beta and upgrade my pool now if I truly have no intention of looking back? I am not using encryption, quotas, or feature flags. Just simple SMB shares only and a Plex jail.
 
Top