[TUTORIAL] Proxmox GPU passthrough with 12th gen Intel, Truenas scale, Plex

hangrynerd

New Member
Oct 16, 2024
1
1
3
Long time lurker, first time poster.
I have been experimenting with Proxmox for a little over a year now, and thanks to adresner's guide on 13th gen Intel with Plex hardware transcoding, I have had my Plex media server up and running nicely for a while.
My needs have changed, and I had to make some much needed hardware upgrades.
So I decided to do a new set up in the same box but with new and bigger HDDs, more RAM, newer version of lxc, and VM upgrade from Truenas core to scale.
I learned that since 8.2, hardware transcoding has become much easier.
It took a while for me to piece together all the necessary information from Reddit, here, and other random places, so I wanted to contribute to the group by sharing my experience of setting this thing up basically from scratch and detail the steps I took to get it working.
Hope this helps some other noob like myself.

Hardware
Asus PRO WS W680-ACE IPMI
Intel 12900K
128G ECC RAM
Prox 8.4.1

1. Set up Truenas Scale 25.04.1 VM with 4 virtual cores and 32G of RAM. I'll probably go up on RAM as my capacity goes up. I have about 30TB of media right now.

2. PCIE HBA passed through to the VM so my HDDs show up in Truenas.

3. Create datasets for my Plex media and SMB share.

4. On PVE host, create an ubuntu 24.04-2 lxc for the Plex media server. My previous lxc had 8G of RAM, and I often noticed that when more than 2 devices were connected to the server, the RAM usage was nearly getting maxed out.
So this time I gave it 16G. And I made it privileged.

5. On PVE host - datacenter - storage, add a SMB/CIFS share for the Truenas VM I just created.

6. On PVE host - shell, nano /etc/pve/lxc/xxx.conf for the lxc I just created in step 4 and added the following

lxc.apparmor.profile = unconfined #otherwise the 24.04-2 lxc just doesn't start.
mp0: /mnt/pve/whateveryounamedyourstorageonstep5/,mp=/mnt/plex/ #bind mounts inside the PMS lxc for all the Truenas Plex media.

7. Start lxc and log in on the console. Cat /etc/group and note video and render GIDs. Mine was video 44, render 993. Then I cd /mnt/plex/ inside the lxc to make sure all my Truenas data was there with the bind mounts I created in step 6, and it was. Then I powered down the lxc.

8. On PVE host - shell, apt install -y intel-opencl-icd #this installs GPU drivers on the host, and needs to be done any time before step 9.

9. On PVE host - shell, ls -l /dev/dri and note that I have card1, card2 and renderD128. These are the iGPU devices installed from step 8. Yours will probably be different based on your choice of CPU.

10. On PMS lxc GUI - resources - add these devices as following. I don't know if they all needed to be added, but I did. Someone can let me know if this is incorrect.

/dev/dri/card1,gid=44
/dev/dri/card2,gid=44
/dev/dri/renderD128,gid=993

11. Then start the PMS lxc and log in. Do cd /dev/dri to make sure the devices I passed through in step 10 are listed. They were. Apparently the dri folder needs to be 755 and the devices inside the dri folder 660. I didn't have to make this change.

12. Then prep and install plexmediaserver.

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

13. After the install was completed, I noted that the last few lines reported the following and was excited.

PlexMediaServer install: Processor: 12th Gen Intel(R) Core(TM) i9-12900K
PlexMediaServer install: Intel i915 Hardware: Found
PlexMediaServer install: Nvidia GPU card: Not Found

14. Logged into my media server and checked transcoder. Everything I needed was there for HDR tone mapping, hardware acceleration, HVEC encoding, etc.

15. Then I powered the lxc down, pct mount xxx both old and new lxc for the plexmediaserver to access the files inside, and transferred everything from the old /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/* to the new media server in the same directory. I had to delete everything in the new directory first. And I had to chown everything in that directory to be plex:systemd-journal for the server to start. And boom! I'm back online.
 
  • Like
Reactions: groque