[TUTORIAL] 13th Gen Intel Proxmox/TrueNAS/Plex hardware transcoding guide

adresner

Member
Mar 22, 2023
93
17
8
Hi everyone, this is my first attempt at making guide here, only using proxmox for a few weeks now, I really hope it’s helpful to someone. Some steps are more detailed than others. So psyched to figure this out. Big shoutout to Blindax on r/Proxmox for pushing me to make this work and sharing his notes with me.

I saw an automated script out there, but nothing beats doing this from scratch!

My hardware:
Asus PRO WS W680-ACE IPMI
Intel 13900K

Kernel 6.2.6-1-pve (seems 6.2.9-1 broke hw transcoding in my build)
Prox 7.4-3

Proxmox Install
1. Download latest Proxmox and Ventoy
https://www.ventoy.net/en/download.html
https://www.proxmox.com/en/downloads

2. Install Proxmox
https://www.proxmox.com/en/proxmox-ve/get-started
https://www.youtube.com/watch?v=_sfddZHhOj4&t=1531s
Choose XFS if you want grub. I tried to install ZFS raid mirror which will install via system-d and I had issues getting all this to work, however I did not try system-d and my guide below.. I was patching together my knowledge when I had the Proxmox install with system-d last week. Would be great to see if someone tries with this guide and system-d, I’m just wiped and not going to try.

3. Login to Proxox, Check/Test your DNS from proxmox, change repositories, update

4. Update Kernel to 6.2 (to support 13th gen Intel CPU)


apt update
apt full-upgrade
apt install pve-kernel-6.2
reboot


5. Setup passthrough (for Grub)
Check your BIOS settings..I am not going to tell you how to setup your BIOS, too many BIOS. In mine (among many changes), I had to choose primary GPU as CPU iGPU and dual monitor enabled. Enabled all the virtual options. Then see links below for details:


nano /etc/default/grub
“quiet intel_iommu=on iommu=pt”
update-grub
nano /etc/modules
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd



update-initramfs -u -k all
Reboot

Check to see if IOMMU is enabled:

dmesg | grep -e DMAR -e IOMMU

https://www.servethehome.com/how-to-pass-through-pcie-nics-with-proxmox-ve-on-intel-and-amd/
https://pve.proxmox.com/wiki/PCI_Passthrough

I suggest you stop here and make sure your iGPU is available in Proxmox. You will need to map this from your LXC so the container can use it.
https://pve.proxmox.com/wiki/PCI_Passthrough
Groups[/SIZE]

find /sys/kernel/iommu_groups/ -type l

Devices

lspci

Device Details with groups

lspci -v

To ID VGA

lspci | grep VGA

I saw this:
00:02.0 VGA compatible controller: Intel Corporation Device a780 (rev 04) (prog-if 00 [VGA controller])
DeviceName: Onboard - Video
Subsystem: ASUSTeK Computer Inc. Device 8694
Flags: bus master, fast devsel, latency 0, IRQ 317, IOMMU group 0
Memory at 60fd000000 (64-bit, non-prefetchable) [size=16M]

Memory at 4000000000 (64-bit, prefetchable) [size=256M]
I/O ports at 6000
Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]

Capabilities: [40] Vendor Specific Information: Len=0c <?>
Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable+ 64bit-
Capabilities: [d0] Power Management version 2
Capabilities: [100] Process Address Space ID (PASID)
Capabilities: [200] Address Translation Service (ATS)
Capabilities: [300] Page Request Interface (PRI)
Capabilities: [320] Single Root I/O Virtualization (SR-IOV)
Kernel driver in use: i915
Kernel modules: i915

6. Setup your storage server or whatever you plan is to hold your media, I’m using TrueNas with an HBA passthrough. Plenty of guides out there.

7. In my case, setup your share. I created a single share called plex in TrueNas. I connected to Plex share on my mac, created 3 folders. Movies, TV Shows, and Music.
https://support.plex.tv/articles/naming-and-organizing-your-movie-media-files/

8. Create LXC
Ubuntu 22.04
Privileged Container
30GB Disk (don’t think it needs more than this?)
4 cores
4GB of ram
512 swap

9. Edit the config file of your LXC
Proxmox by default does not give LXC containers access to the iGPU.
Add the following to your LXC configuration in order to allow it.
Note: This only works with privileged containers.


nano /etc/pve/lxc/<container id>.conf

For Proxmox >= 7.0

lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file

https://herold.space/proxmox-lxc-intel-quick-sync-for-plex/

10. I then followed this guide to mount my share within Proxmox and then inside my container. If there is a more direct way to to do this, please teach me
https://www.youtube.com/watch?v=IRinDKhPqlU&t=300s

11. Light up your LXC and check to see if the iGPU is listed


ls -l /dev/dri

Should have output like this (its picking up my GPU, you might only have one render D128):
total 0
drwxr-xr-x 2 root root 140 Apr 6 03:26 by-path
crw-rw---- 1 root video 226, 0 Apr 6 03:26 card0
crw-rw---- 1 root video 226, 1 Apr 6 03:26 card1
crw-rw---- 1 root video 226, 2 Apr 6 03:26 card2
crw-rw---- 1 root syslog 226, 128 Apr 6 03:26 renderD128
crw-rw---- 1 root syslog 226, 129 Apr 6 03:26 renderD129

12. Install Drivers in the LXC



apt install cifs-utils
apt install -y curl gnupg-utils
apt install net-tools
apt update && apt upgrade -y

Install dependencies
https://zoomadmin.com/HowToInstall/UbuntuPackage/ocl-icd-libopencl1


sudo apt-get update -y
sudo apt-get install -y ocl-icd-libopencl1

https://github.com/linuxserver/docker-plex/issues/309
https://github.com/intel/compute-runtime/releases
Please check the above link for the most up to date drivers (I tried this with some old links, old links = old drivers = bad day for new CPU


mkdir neo
cd neo
wget https://github.com/intel/intel-grap....13230.7/intel-igc-core_1.0.13230.7_amd64.deb
wget https://github.com/intel/intel-grap...3230.7/intel-igc-opencl_1.0.13230.7_amd64.deb
wget https://github.com/intel/compute-ru...level-zero-gpu-dbgsym_1.3.25593.11_amd64.ddeb
wget https://github.com/intel/compute-ru...1/intel-level-zero-gpu_1.3.25593.11_amd64.deb
wget https://github.com/intel/compute-ru...l-opencl-icd-dbgsym_23.05.25593.11_amd64.ddeb
wget https://github.com/intel/compute-ru....11/intel-opencl-icd_23.05.25593.11_amd64.deb
wget https://github.com/intel/compute-ru...d/23.05.25593.11/libigdgmm12_22.3.0_amd64.deb
sudo dpkg -i *.deb


13. Install Plex

curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo gpg --dearmor -o /etc/apt/keyrings/plex.gpg
echo "deb [signed-by=/etc/apt/keyrings/plex.gpg] https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
apt update && apt install -y plexmediaserver


Hope you see results like this, pls notice the Intel i915 Hardware Found
results:
Setting up plexmediaserver (1.31.3.6868-28fc46b27) ...
PlexMediaServer install: PlexMediaServer-1.31.3.6868-28fc46b27 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: New
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: syslog
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /tmp
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Processor: 13th Gen Intel(R) Core(TM) i9-13900K
PlexMediaServer install: Intel i915 Hardware: Found

PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
Created symlink /etc/systemd/system/multi-user.target.wants/plexmediaserver.service -> /lib/systemd/system/plexmediaserver.service.
PlexMediaServer install: PlexMediaServer-1.31.3.6868-28fc46b27 - Installation successful. Errors: 0, Warnings: 0

14. Might need to change dome of /dev/dri (I did not have to do this, the linked guide below had some good and bad info in it. The bad being saying to turn off your IOMMU and this point that I didn’t need, but it did mention this so I put it here in case someone needed it, I did not.)
/bin/chgrp video /dev/dri
/bin/chmod 755 /dev/dri
/bin/chmod 660 /dev/dri/*
Reference https://www.razib.io/dev/proxmox-pl...th-generation-cpu-and-quick-sync-transcoding/

15. Mount Share inside Plex
https://www.youtube.com/watch?v=IRinDKhPqlU&t=300s

16. Log into Plex, configure a library, upload a movie, and enable hardware decoding option, make sure you set the transcode directory. I used the /tmp file reported in the Plex install

17. Test a movie on your phone over 3/4/5G (not on the same wifi as your server) - Open the dashboard and you should see a (hw) next to transcoding. If you don’t, then this guide isn’t for you or you need to adjust somehow. More detailed guides on this part out there.

That should be it... hope this works for you
 
Last edited:
Hi,

just a small heads-up: Please mark this thread as a “Tutorial”. You can do so by clicking the “Edit Thread” button on top then selecting the “Tutorial” prefix. That should make it easier to find this thread.

Thanks!
 
  • Like
Reactions: adresner
Hi,

just a small heads-up: Please mark this thread as a “Tutorial”. You can do so by clicking the “Edit Thread” button on top then selecting the “Tutorial” prefix. That should make it easier to find this thread.

Thanks!
Done
 
  • Like
Reactions: xokia
You created almost exactly what I was trying to get setup. Only difference is the motherboard I have an ASUS B760-I
I have iommu enabled

I am using systemd instead of grub, IOMMU shows up though.
I created the VM using the proxmox GUI. I installed TrueNAS on the VM and then installed plex server on TrueNAS
I cant get the video HW to pass through to TrueNAS

This is all mostly new to me and probably way overkill for my needs but its a fun learning experience.

I tried installing using an Ubuntu container like you did

root@ubuntu-plex:~/neo# curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo gpg --dearmor -o /etc/apt/keyrings/plex.gpg
gpg: can't create '/etc/apt/keyrings/plex.gpg': No such file or directory
gpg: no valid OpenPGP data found.
gpg: dearmoring failed: No such file or directory
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3072 100 3072 0 0 111k 0 --:--:-- --:--:-- --:--:-- 115k
(23) Failed writing body

had to create directory /etc/apt/keyrings then command would run

I already had a /etc/apt/sources.list.d/plex.list and a /etc/apt/sources.list.d/plexmediaserver.list
I had to remove /etc/apt/sources.list.d/plex.list

Then it seemed to work
 
Last edited:
You created almost exactly what I was trying to get setup. Only difference is the motherboard I have an ASUS B760-I
I have iommu enabled

I am using systemd instead of grub, IOMMU shows up though.
I created the VM using the proxmox GUI. I installed TrueNAS on the VM and then installed plex server on TrueNAS
I cant get the video HW to pass through to TrueNAS

This is all mostly new to me and probably way overkill for my needs but its a fun learning experience.

I tried installing using an Ubuntu container like you did

root@ubuntu-plex:~/neo# curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo gpg --dearmor -o /etc/apt/keyrings/plex.gpg
gpg: can't create '/etc/apt/keyrings/plex.gpg': No such file or directory
gpg: no valid OpenPGP data found.
gpg: dearmoring failed: No such file or directory
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3072 100 3072 0 0 111k 0 --:--:-- --:--:-- --:--:-- 115k
(23) Failed writing body

had to create directory /etc/apt/keyrings then command would run

I already had a /etc/apt/sources.list.d/plex.list and a /etc/apt/sources.list.d/plexmediaserver.list
I had to remove /etc/apt/sources.list.d/plex.list

Then it seemed to work
Your mistake is trying to run Plex Server on TRUENAS, you won't get the iGPU to passthrough to your VM and then the container in it.

You should run Plex within a container directly on Proxmox. TrueNas is just for your file server, reason using it as a VM is so you can do HBA passthrough.

Where you able to get it working?
 
  • Like
Reactions: xokia
Your mistake is trying to run Plex Server on TRUENAS, you won't get the iGPU to passthrough to your VM and then the container in it.

You should run Plex within a container directly on Proxmox. TrueNas is just for your file server, reason using it as a VM is so you can do HBA passthrough.

Where you able to get it working?
Yes I was able to get it up and going using ubuntu and your tutorial after I made those minor edits to the plexserver keys.
Now I have to go back and attach the storage which is running on the same machine but in TrueNAS VM
 
  • Like
Reactions: adresner
I'm happy to hear that. Can you tell me which part of my guide I should edit? The steps in my guide, I followed them cut and paste and it worked... so not sure why you ran into that error?
 
  • Like
Reactions: xokia
I'm happy to hear that. Can you tell me which part of my guide I should edit? The steps in my guide, I followed them cut and paste and it worked... so not sure why you ran into that error?
root@ubuntu-plex:~/neo# curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo gpg --dearmor -o /etc/apt/keyrings/plex.gpg
gpg: can't create '/etc/apt/keyrings/plex.gpg': No such file or directory

dont know why but I had to create a directory called keyrings then it could create the plex.gpg

Also I had /etc/apt/sources.list.d/plex.list and a /etc/apt/sources.list.d/plexmediaserver.list
I had to delete /etc/apt/sources.list.d/plex.list

Then it worked

*update* linked external drive works like a charm and HW transcoding I can see working now. Transcodes a 4k movie with barely any CPU. Nice!!!
Thanks for putting this together. I was beating my head in with TrueNAS this works great.
 
Last edited:
I will be interested to hear from the next person who follows this... I'm really glad it worked for you (even with the small issue).
 
My instructions are for Grub.

Unfortunate update, my HW transcoding seems to have stopped working. I will start to troubleshoot... might take this guide down.
 
My instructions are for Grub.

Unfortunate update, my HW transcoding seems to have stopped working. I will start to troubleshoot... might take this guide down.
What I am saying is that you are running systemd not grub click on the link I provide it explains it.

"PlexMediaServer install: Process Control: systemd" ,<- this in your output referenced above tells me you are running systemd

you need to modify /etc/kernel/cmdline instead of /etc/default/grub

Did you system freeze? Mine froze after about and hour or so of transcoding. I built again today to see if fresh install fixes it.
 
Last edited:
I saw that too! I was wondering what the heck is going on.. I see systemd in the LXC but for sure booting Proxmox via Grub. I wonder if the LXC is using systemd? is that how it works? or do I have a mismatch here and that is why my hw failed?

Feeling quite down at the moment that it was working and now it's not... trying to retrace my steps
 
I saw that too! I was wondering what the heck is going on.. I see systemd in the LXC but for sure booting Proxmox via Grub. I wonder if the LXC is using systemd? is that how it works? or do I have a mismatch here and that is why my hw failed?

Feeling quite down at the moment that it was working and now it's not... trying to retrace my steps
Mine works great dont give up. I trashed mine because I was doing a lot of hacking to try and get plex working in TrueNAS with HW encode. After starting over everything works great.

I think you are probably using systemd. Its seems to be the default for proxmox 7.x

You can type pstree in your proxmox cmd window you should see systemd as the first item.

root@HomeServer:~# pstree
systemd─┬─agetty
├─chronyd───chronyd
├─cron
├─dbus-daemon
├─dmeventd───2*[{dmeventd}]
├─dtach───lxc-console
├─2*[iscsid]
 
Last edited:
I am at a loss here.

Somehow I have a grub / systemd issue. I installed grub, no question. I confirmed it was grub

Now I am still booting with grub but seems like systemd once its booted? How is that even possible lol

Are you using systemd? Sounds like its time to start over again

pstree
systemd─┬─agetty
├─chronyd───chronyd
├─cron
├─dbus-daemon
├─dmeventd───2*[{dmeventd}]
├─2*[iscsid]

Screenshot 2023-04-11 at 3.16.31 PM.png
 
Turns out my Kernel updated and that was the issue.. I just booted with the previous kernel and I'm good to go. Love this stuff..
 
I didn't have to switch back, I was using Grub all along, this is the explanation

"It appears to boot with GRUB in UEFI mode, which is normal if your root filesystem (Proxmox installation) is not on ZFS. Following the Proxmox manual, it also matches GRUB booting in UFEI mode. Even if the \EFI\proxmox\grubx64.efi is not identical to your \EFI\BOOT\BOOTX64.EFI, it's definately not \EFI\systemd\systemd-bootx64.efi that would indicate systemd-boot. In short: you are using GRUB and not systemd-boot, so you have exactly what you wanted."

Turns out my real issue was updating to 6.2.9-1
So now I have to find a way to default boot into 6.2.6-1

Have to edit the grub file, trying to get the right edit now. Luckily I didn't break it all down and rebuild!
 
I didn't have to switch back, I was using Grub all along, this is the explanation

"It appears to boot with GRUB in UEFI mode, which is normal if your root filesystem (Proxmox installation) is not on ZFS. Following the Proxmox manual, it also matches GRUB booting in UFEI mode. Even if the \EFI\proxmox\grubx64.efi is not identical to your \EFI\BOOT\BOOTX64.EFI, it's definately not \EFI\systemd\systemd-bootx64.efi that would indicate systemd-boot. In short: you are using GRUB and not systemd-boot, so you have exactly what you wanted."

Turns out my real issue was updating to 6.2.9-1
So now I have to find a way to default boot into 6.2.6-1

Have to edit the grub file, trying to get the right edit now. Luckily I didn't break it all down and rebuild!
I'm not sure I fully follow how all it works. I'm not a SW or IT guys just a HW engineer (so a hobbiest) when it comes to SW. LInux is outside my realm of expertise.

efibootmgr -v this should say grub mine does. But I still get systemd under pstree.

What issue were you having and why will 6.2.6-1 fix it? I noticed mine crashes randomly sitting idle. I think its probably a sleep issue, going into lower level power states. I think I am probably out this was fun but I need a stable system probably will just run everything in windows. My fear if data recovery is something goes down. Hope you get yours going and you find what was wrong.
 
Last edited:
I am not an expert with Linux either, but I believe it has to do with booting grub on an EFI system.

Seems that 6.2.9-1 is most likely not compatible with the Intel drivers. That would be my guess. In about 12 months, the support for 13th gen should be MORE main stream, can't wait lol
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!