Plex Hardware Transcoding in 25.04.1 container instance

I had been running most of my docker containers in a Jailmaker nspawn jail, but a few weeks ago I finally migrated everything over to a “proper” TrueNAS 25.04.1 container instance. Everything is working great, but the other night I got a load average alert, which is really uncommon as I went fairly overkill on my build.

As I looked into it I noticed I had 5 current stream clients in plex, a few of which were transcoding, none of which seemed to be using hardware transcoding. I checked the plex settings, and it was turned on, and I even forced the transcoding device to the Intel AlderLake device:

But it continues to not use hardware transcoding. I installed intel-gpu-tools and ran intel_gpu_top and got the following:

newmonic:[~]$ sudo intel_gpu_top
Failed to initialize PMU! (Permission denied)

intel_gpu_top runs fine on the actual TrueNAS host.

I am definitely passing /dev/dri thru in the docker mount:

    devices:
      - /dev/dri:/dev/dri

but I’m guessing there is some other incantation I need to invoke for the incus container to make everything work. I didn’t see anything obvious in the TrueNAS instance gui, though.

If anyone has any advice I’d really appreciate it!

Also, I forgot to mention that I had previously ran:

bobbynewmark:[~]$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
bobbynewmark:[~]$ sudo incus config device add newmonic intel-gpu gpu pci=0000:00:02.0 gid=44 gputype=physical
Error: The device already exists

to theoretically pass the igpu thru (the above run was after, which I believe is why the device already exists)…

  intel-gpu:
    gid: "44"
    gputype: physical
    pci: "0000:00:02.0"
    type: gpu

But when I run

newmonic:[~]$  sudo glxinfo | grep "OpenGL renderer"
Error: unable to open display
newmonic:[~]$ lF /dev/dri
total 1
drwxr-xr-x 2 root root        80 Jul 12 06:03 ./
drwxr-xr-x 9 root root       540 Jul 12 06:03 ../
crw-rw---- 1 root video 226,   0 Jul 12 06:03 card0
crw-rw---- 1 root video 226, 128 Jul 12 06:03 renderD128
newmonic:[~]$ groups
grahams video users docker

I just saw this in another thread:

So I ran:

sysctl kernel.perf_event_paranoid=0

on the TrueNAS host, and then I restarted the incus container. Now I am able to successfully run intel_gpu_top in the container, but as far as I can tell, plex continues to not use QSV…

How are you running Plex? As a TrueNAS app? If so, there is an option to share GPU.

I’m running it using docker inside of a instance container.

A friend mentioned he had to chmod 777 /dev/dri in his lxc container (non-TrueNAS afaik) and so I tried that… I chmod 666 the contents as well (card0 and render128).

Afterwards, plex seems to now be happy and I saw the (hw) in the plex dashboard, so i think it’s now working?

well, the friends that fix things using chmod 777 :wink:

another (proper) way would be to look at permissions. /dev/dri inside the container must have certain group permissions (video?) to be accessible for plex

1 Like

Yeah, I will definitely take a swing at figuring out proper perms for everything. I’m using the official plexinc container, and it looks like this might be something the linuxserver crew has dealt with, so maybe I’ll look at switching the image im using as well…

Or you use the TrueNAS plex app. It works very well.

Im glad it works well for you.