Plex hw transcoding in a jail crashes TrueNas

ignas

Cadet
Joined
Oct 24, 2022
Messages
4
I have recently enabled hardware transcoding in a Plex jail according this thread.
Additional thing I had to do to see /dev/dri and /dev/drm was add postinit command kldload drm i915kms

MB: Odroid H2+
HDD controller: IBM 81Y4494 H1110 SAS-2 6Gbps HBA LSI 9211-4i P20 IT Mode
CPU: Intel(R) Celeron(R) J4115 CPU @ 1.80GHz
GPU: Intel UHD Graphics 600
RAM: 2x KINGSTON 16GB 2400MHz DDR4 CL14 SODIMM HyperX Impact
Boot: 2x Sandisk Cruzer Fit 32Gb
Data drives: 2x (mirror) Seagate IronWolf 10TB 3.5'' 256MB ST10000VN0008
System drives: 2x (mirror) Seagate IronWolf 125 250 GB ZA250NM1A002 SSD

Everything seems to be set, but once I start HW transcoding in plex, in less than a second my TrueNAS server crashes and reboots.
I am new to debugging TrueNAS, so I don't know where to looks for these logs. But the fact that jail crashes the whole TrueNAS is really bad. Also I have not found a similar issue on the internet.
My hardware supports HW transcoding. This is the output of vainfo in plex jail:
Code:
root@plex:~ # vainfo
Trying display: wayland
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Trying display: x11
error: can't connect to X server!
Trying display: drm
libva info: VA-API version 1.16.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_16
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.16 (libva 2.16.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.3 (intel-media-22.4.3)
vainfo: Supported profile and entrypoints
      VAProfileNone                   :    VAEntrypointVideoProc
      VAProfileNone                   :    VAEntrypointStats
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointFEI
      VAProfileH264Main               :    VAEntrypointEncSliceLP
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointFEI
      VAProfileH264High               :    VAEntrypointEncSliceLP
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:    VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :    VAEntrypointVLD
      VAProfileVP8Version0_3          :    VAEntrypointEncSlice
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointEncSlice
      VAProfileHEVCMain               :    VAEntrypointFEI
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileHEVCMain10             :    VAEntrypointEncSlice
      VAProfileVP9Profile0            :    VAEntrypointVLD
      VAProfileVP9Profile2            :    VAEntrypointVLD


What could be wrong? How can I get the HW transcoding working?

Version: TrueNAS-13.0-U2
Jail version: 13.1-RELEASE-p1
Plex pkg version: plexmediaserver-plexpass-1.29.0.6219

Tried plex from a plugin, also tried fresh jail and installing from pkg, same behaviour.
 

ignas

Cadet
Joined
Oct 24, 2022
Messages
4
I checked dmesg:

Code:
Fatal trap 9: general protection fault while in kernel mode
cpuid = 3; apic id = 06
instruction pointer    = 0x20:0xffffffff80b126b4
stack pointer            = 0x0:0xfffffe01de953a60
frame pointer            = 0x0:0xfffffe01de953a60
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = interrupt enabled, resume, IOPL = 0
current process        = 17555 (PMS ReqHandler)
trap number        = 9
panic: general protection fault
cpuid = 3
time = 1666605791
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01de953880
vpanic() at vpanic+0x17f/frame 0xfffffe01de9538d0
panic() at panic+0x43/frame 0xfffffe01de953930
trap_fatal() at trap_fatal+0x385/frame 0xfffffe01de953990
calltrap() at calltrap+0x8/frame 0xfffffe01de953990
--- trap 0x9, rip = 0xffffffff80b126b4, rsp = 0xfffffe01de953a60, rbp = 0xfffffe01de953a60 ---
_rw_wowned() at _rw_wowned+0x4/frame 0xfffffe01de953a60
vm_page_busy_acquire() at vm_page_busy_acquire+0x127/frame 0xfffffe01de953aa0
remap_io_mapping() at remap_io_mapping+0x120/frame 0xfffffe01de953af0
i915_gem_fault() at i915_gem_fault+0x281/frame 0xfffffe01de953b70
linux_cdev_pager_populate() at linux_cdev_pager_populate+0x11b/frame 0xfffffe01de953be0
vm_fault_allocate() at vm_fault_allocate+0x2fb/frame 0xfffffe01de953c50
vm_fault() at vm_fault+0x2df/frame 0xfffffe01de953d70
vm_fault_trap() at vm_fault_trap+0x6d/frame 0xfffffe01de953dc0
trap_pfault() at trap_pfault+0x1f3/frame 0xfffffe01de953e20
trap() at trap+0x40a/frame 0xfffffe01de953f30
calltrap() at calltrap+0x8/frame 0xfffffe01de953f30
--- trap 0xc, rip = 0x8061f17aa, rsp = 0x7fffda5c6b08, rbp = 0x7fffda5c6b40 ---
 
Joined
Jan 27, 2020
Messages
577
You're running unsupported hardware. Nobody will/can help you here. That's the bitter truth of TrueNAS, sorry.
On wether your hardware would be able to run hw transcode on FreeBSD, I cannot comment. But I can say, that even on TrueNAS supported hardware, hw transcode does not work reliable.
 

ignas

Cadet
Joined
Oct 24, 2022
Messages
4
You're running unsupported hardware. Nobody will/can help you here. That's the bitter truth of TrueNAS, sorry.
On wether your hardware would be able to run hw transcode on FreeBSD, I cannot comment. But I can say, that even on TrueNAS supported hardware, hw transcode does not work reliable.
How about TrueNAS SCALE? I imagine if linux support the hardware, trueNAS should too.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
How about TrueNAS SCALE? I imagine if linux support the hardware, trueNAS should too.

You are welcome to imagine that if you like, but please be aware that reality will shatter your dreams. TrueNAS is optimized to run on server grade gear. There's lots of hardware out there for which FreeBSD or Linux support is quite marginal, and a ZFS filer is a very stressy environment.

Your board has a Gemini Lake J4115 processor on it which does indeed have Intel UHD 600 graphics. However, the board is limited to 8GB of RAM, which is the bare minimum for Scale, and is less than the minimum (16GB) for core. Adding packages like Plex on top increases the memory requirement, so there's not a way for you to get to the 10-12GB RAM that you'd need to have a chance to run Plex.
 

ignas

Cadet
Joined
Oct 24, 2022
Messages
4
You are welcome to imagine that if you like, but please be aware that reality will shatter your dreams. TrueNAS is optimized to run on server grade gear. There's lots of hardware out there for which FreeBSD or Linux support is quite marginal, and a ZFS filer is a very stressy environment.

Your board has a Gemini Lake J4115 processor on it which does indeed have Intel UHD 600 graphics. However, the board is limited to 8GB of RAM, which is the bare minimum for Scale, and is less than the minimum (16GB) for core. Adding packages like Plex on top increases the memory requirement, so there's not a way for you to get to the 10-12GB RAM that you'd need to have a chance to run Plex.
The board supports 32 Gb of ram. And I am running 32 Gb on it.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
The board supports 32 Gb of ram. And I am running 32 Gb on it.

I stand corrected. Except that Intel ARK says that the J4115 only takes 8GB. Mmm. Weird.


I do see some other pages that claim your device will go to 32GB though. That's too bad, because this just went from "I have a likely culprit" to "I have no idea".
 
Top