In this post I cover how to setup a Plex Media Server (PMS) LXC on Proxmox with hardware transcoding and HDR tone mapping. Contrary to popular belief, the Plex LXC does not need to be configured with PCIe passthrough for the GPU. So NO Proxmox IOMMU host configuration is needed to allow the Plex LXC to do hardware transcoding and HDR tone mapping. This procedure uses the awesome tteck Promox Plex LXC script to mostly automate the setup of a Plex LXC with the needed GPU drivers and LXC configuration to enable these GPU offload features.
April 22, 2023 Update: GPU PCIe passthrough is NOT needed for the Plex LXC. So no Proxmox host configuration with VT-d or IOMMU is needed. I have removed those sections from this post to avoid confusion.
Hardware Transcoding and HDR Tone Mapping
Getting Plex hardware transcoding and HDR tone mapping to work requires two components: 1) The Plex LXC GPU drivers for your Proxmox host GPU. In my case, Intel GPU drivers for Ubuntu 22.04 (the LXC OS) and Alder Lake 2) Plex Media Server (PMS) built-in media drivers that support your specific GPU. The PMS media drivers are not something you have any control over. They are baked into PMS.
Getting both driver stacks to support your GPU can be challenging for both hardware transcoding and HDR tone mapping. As of April 22, 2023, the built-in PMS Intel media drivers don’t have full support for hardware transcoding and HDR tone mapping across all Alder Lake (12th Gen) GPUs. Neither hardware transcoding nor HDR tone mapping works for Alder Lake-N (e.g. N100, released Q1 ’23) CPUs. Hardware transcoding does work for higher end Alder Lake CPUs, such as the i5-1240P.
I got an advanced developer build of PMS that has newer Intel media drivers and it does enable hardware transcoding AND HDR tone mapping for both of my Alder Lake servers. Plex says a public release is “soon”.
Synology Migration Guide (Optional)
If you want to migrate your Plex Media Server that is running on your Synology NAS (while leaving your media library on the Synology) to a Plex Server LXC, you can check out my post: Migration Guide: Plex on Synology to Proxmox LXC. Before you go through that post, follow this one in its entirety to verify hardware transcoding works. After which you can then migrate your PMS configuration to the Plex LXC, and access your media library on the Synology via NFS.
I validated this setup on two different Beelink mini-PCs. The SEi12 Pro has an Alder Lake i5-1240P (12 cores, 16 threads), and the Beelink Mini S12 Pro has an Alder Lake N100 (4 cores, 4 threads).
Beelink SEi12 Pro Mini PC, 12th Gen Intel Core i5-1240P
Beelink Mini S12 Pro, 12th Gen Intel N100
Proxmox Kernel 6.2.9-1
Ubuntu 22.04 LXC Image with Plex (from tteck)
I suggest sticking with Ubuntu 22.04 as the LXC OS. That’s what I tested and I know it works. Newer or older versions may have Intel driver support issues, so use at your own risk. The latest 6.2.x Linux kernels have the best Alder Lake support, so that’s one reason why I upgraded the Kernel.
If you already have Proxmox installed, you can skip this section and go to the Proxmox GPU Verification section below.
I wrote an in-depth Proxmox installation guide that included a Home Assistant section. We can re-use most of that content and just skip the sections applicable to Home Assistant. Click on that link and open in another window. For the purposes of a Plex LXC with GPU transcoding, follow these sections in my Proxmox Quick Start Guide:
- Proxmox Storage Recommendations – I stuck with the default EXT4 with LVM-thin.
- Creating Proxmox USB Boot Media
- Installing Proxmox VE
- Proxmox Post Install Configuration – Make sure to upgrade to the 6.2.x kernel
Any other sections in my post like CPU power optimization, SMART monitoring, VLAN enable, and SSL cert are optional and have no impact on the Plex LXC. You can safely skip them.
Proxmox GPU Verification
Although the Plex LXC doesn’t need PCIe/GPU passthrough, we can verify that Proxmox recognizes the GPU and get the model number. In the Proxmox UI click on your host in the left pane and in the middle pane click on Shell. Enter the following command to find the VGA adapter:
lspci -v | grep -e VGA
Here we can see I have an Intel GPU at PCIe address 00:02.0.
Let’s get more details about that VGA adapter:
lspci -v -s 00:02.0
Now that we know Proxmox recognizes the GPU and has a kernel driver, let’s deploy the Plex LXC.
Plex LXC Installation
- Login to Proxmox and select your Proxmox server in the left pane.
- Click on Shell in the middle pane.
- Enter the following command to start the Plex LXC install via the tteck script. Press Enter on Yes.
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/plex.sh)"
4. Select Advanced.
5. Select 22.04 Jammy.
6. Change CONTAINER TYPE to Privileged.
7. Enter a complex password.
8. Accept the container ID.
9. Set the Hostname.
10. Change the Disk Size as needed. Note: I’d go for 16GB minimum.
11. Change Core Count as needed. Note: I’d recommend starting with 2-4 cores.
12. Change RAM as needed. Note: Plex is light on memory usage, so even 1024MB should be plenty.
13. Leave the Bridge.
14. Optionally set a static IP (e.g. 192.168.10.45/24). Note: Strongly recommended to use static IP.
15. Set a Gateway IP.
16. Don’t disable IPv6 (unless you need to).
17. Leave MTU Size.
18. Set DNS Search Domain (if needed).
19. Set a DNS server IP.
20. Leave the MAC address blank.
21. Leave the VLAN.
22. Enable Root SSH access.
23. Don’t enable verbose mode.
24. Press enter on Yes, Create Plex LXC.
25. Select your storage by using the arrow keys, then press space to select, and tab to OK.
26. Again, select the storage you want to use.
27. Wait for the OS to download and update. Make take a few minutes. DO NOT do ANYTHING in the Proxmox console during the install. Wait for the Plex should be reachable message.
Note: tteck’s Plex LXC installer downloads and installs a number of libraries needed for hardware GPU acceleration. So you might see other guides on the internet that manually install several packages. Those steps can be skipped with his Plex LXC script.
Plex LXC Driver Verification
1. Let’s verify that the Ubuntu Plex LXC sees the GPU. SSH into the Plex LXC container and run the command below. Look for at least one renderD entry.
ls -l /dev/dri
2. Tteck’s Plex LXC deployment script automatically installs the latest hardware acceleration packages (i.e. Intel drivers). So no need to do any wget commands to install those drivers. If for some reason you need a different Intel driver set you can find the official Intel GitHub repository here. We should check to verify that Plex found the GPU. Run the command below and verify Plex recognizes your specific GPU model.
Note: If you are using an Alder Lake-N CPU, as of April 23, 2023 those are not yet recognized. A forthcoming PMS update will fix that issue.
cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs more Plex\ Media\ Server.log | grep dri
If you want to migrate from Plex Media Server on Synology to Plex LXC, while maintaining your media library on the Synology, check out my post Migration Guide: Plex on Synology to Proxmox LXC. This section assumes you have either done a PMS migration (from any platform), or created a new media library with at least one high-res video clip to test cellular transcoding. I’ll assume you know enough about about Plex to configure that yourself.
1. In order to test if transcoding is working, it’s easiest to setup inbound internet access to your Plex server and then use a device like a phone on a cellular connection (NOT WiFi) to stream media and verify Plex is hardware transcoding. Once you are at the Plex main dashboard, click on Remote Access in the left pane.
2. On your router configure port forwarding and setup remote access within Plex. Verify that Plex shows your server is accessible outside your network.
3. In the left pane click on Transcoder. Tick the box next to Use hardware acceleration when available. The box under that setting should be checked by default. Verify.
4. UN-check the Enable HDR tone mapping option (more on why below).
Note: As of the publication date of this post, Plex is using an older Intel Media Driver that doesn’t support Alder Lake for HDR tone mapping. According to Plex “soon” they will have an updated driver that will support HDR tone mapping on Alder Lake. Once they release an updated PMS that supports Alder Lake tone mapping, you can check that box.
4. If you do enable HDR tone mapping and the video is not smooth, run the command below to look for errors related to OpenCL, such as: Failed to get number of OpenCL platforms: -1001. You may need to wait for an updated Plex Intel graphics driver as previously mentioned. Until then, disable HDR tone mapping.
more "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log" | grep ERROR
5. Take your phone and turn off WiFi. Launch the Plex player on your phone and start watching a video. In the Plex dashboard it should show hw transcoding. Even with hardware transcoding, you may see a Plex LXC CPU spike when you start playing media. I was testing with a 2 vCPU LXC container and for a few minutes when I started a movie the CPU hovered around 60%. Then it leveled off between 1% and 13%.
Getting hardware transcoding to work on a Plex LXC on Proxmox is pretty easy with tteck’s awesome Plex LXC script. No GPU or PCIe passthrough is needed. As as of this publication date, Plex hasn’t updated their internal Intel driver to support Alder Lake HDR tone mapping, or Alder Lake-N CPUs for hardware transcoding. An updated PMS should be out “soon” that fixes these gaps. Have fun streaming!