integrated GPU passthrough proxmox & plex

Y’all ever use plex for multiple years before realizing you might not be using the integrated GPU on your Intel nuc for transcoding? Yeah me neither…
Turns out it isn’t automatic, which I would have assumed for a dedicated graphics card. I’ve read enough about GPU passthrough to know it’s a thing, but my little NUC doesn’t have a dedicated GPU, so I kind of assumed that whatever integrated GPU was on the processor itself would automatically get passed through. In hindsight it seems obvious it wouldn’t, but up until now I was living so blissfully ignorant.
If you’re unsure, do the following inside whatever container plex is in.
# list devices
ls -la /dev/dri/
If nothing shows up then you’re in the same boat as I was.
Add this to the container config in /etc/pve/lxc/[CTID].conf after you backup the original:
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
Restart the container, and you should be set.
phil@plex:~$ ls -la /dev/dri/
total 0
drwxr-xr-x 3 nobody nogroup 100 Oct 30 09:47 .
drwxr-xr-x 7 root root 500 Dec 11 17:48 ..
drwxr-xr-x 2 nobody nogroup 80 Oct 30 09:47 by-path
crw-rw---- 1 nobody nogroup 226, 0 Oct 30 09:47 card0
crw-rw---- 1 nobody nogroup 226, 128 Oct 30 09:47 renderD128
The group and permissions were confusing so I checked group ownership using:
# check which user plex is
ps aux | grep -i plex
# check groups plex is in
groups plex
Returned:
# should say render or video depending on OS
plex : plex video
So all good! Just don’t forget to check the GUI and go through: Settings > Transcoder and make sure “Use hardware acceleration when available” is checked. I still can’t scrub as well on Plex as I can on Jellyfin which is lame, so idk if this even really did anything. Still ongoing I suppose.