Proxmox: Install Plex LXC with HW Transcoding/HDR Tone Mapping

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.

My Setup

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). 

Setup Details:

Beelink SEi12 Pro Mini PC, 12th Gen Intel Core i5-1240P
Beelink Mini S12 Pro, 12th Gen Intel N100
Proxmox 7.4-3
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.

Installing Proxmox

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:

  1. Proxmox Storage Recommendations – I stuck with the default EXT4 with LVM-thin.
  2. Creating Proxmox USB Boot Media
  3. Installing Proxmox VE
  4. 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

  1. Login to Proxmox and select your Proxmox server in the left pane.
  2. Click on Shell in the middle pane.
  3. 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
				
			
Plex Logs showing Alder Lake GPU

Verify Transcoding

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%. 

Hardware Transcoding is Active

Summary

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!

Print Friendly, PDF & Email

Related Posts

Subscribe
Notify of
14 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
budley
June 14, 2023 5:51 am

I’m new to Linux and Proxmox, so for the past month I’ve been struggling through successes and failures with VMs and LXCs at an alarming rate. (I’ve reinstalled Proxmox at least 7 times now in the past week alone.) Your blog is a godsend and very much appreciated. Many thanks!

Shetu
July 4, 2023 10:59 am

Hi
I stuck at this point. Prxmpx 8, Cpu i5-8400
unable to open file ‘/var/lib/pve-manager/apl-info/releases.turnkeylinux.org’ – No such file or directory
 – Downloading LXC Template…unable to open file ‘/var/lib/pve-manager/apl-info/releases.turnkeylinux.org’ – No such file or directory

Dyfinder1
July 8, 2023 12:55 pm

Hi Derek,
If you could make a note for people, I followed this guide and ran into an issue where I couldn’t get HW to work after following this guide perfectly. To get HW transcoding to work, I had to downgrade my plex media server installation from the latest built to plexmediaserver_1.32.0.6918-6f393eda1_amd64.deb
I got this version from https://github.com/axlecrusher/plex_download_urls/blob/master/archives/linux-x86_64.debian.md
Regardless, I hope this comment helps any who came across this issue as well 🙂

Miguel
July 31, 2023 2:51 pm

Hi, excellent guide! But i have a problem, in my plex interface don´t have this options:
Use hardware acceleration when available
Enable HDR tone mapping

The plex version that i use is: 1.32.5.7349

All movies that i reproduce appear as:
Video: transcode [hevc -> h264]
Audio: transcode [aac -> aac]

Thanks for your comments

Juozis
August 3, 2023 12:50 am

Why do you use privileged container? Doesn’t it expose security risk?

Allistaah
August 6, 2023 8:01 pm

How do you update the Plex server that was installed with this script?

myreal
September 2, 2023 12:04 am

Hey,

I’ve installed Plex LXC with tteck script previously, hardware transcoding worked fine. Then I followed this guide: https://www.derekseaman.com/2023/06/proxmox-ve-8-windows-11-vgpu-vt-d-passthrough-with-intel-alder-lake.html, which worked out perfect, but then broke Plex HW transcoding. Any ideas what should I adjust in Plex LXC?

I’m on 12700 (alder lake).

Dyfinder
September 19, 2023 6:52 pm
Reply to  Derek Seaman

Do you know of a fix or a workaround? Disabling HDR Tone Mapping kills the saturation

elvasilep
September 23, 2023 1:48 pm

Hi,

I followed the instructions exactly to install Plex MS on LXC on Proxmox 8 on Celeron N5105 (Jasper Lake). All the diver visibility test passed, including Plex actually identifying it as Jasper Lake CPU. Unfortunately no hw xcoding 🙁

However, after adding “intel_iommu=on iommu=pt i915.enable_guc=2″ in the grub GRUB_CMDLINE_LINUX_DEFAULT and “vfio
vfio_iommu_type1 vfio_pci vfio_virqfd” in /etc/modules on the host, as documented in many of the internet related entries, hw xcoding started working :-)))

The tteck scripts are awesome though. Thanks for pointing them out.

Rikusj
October 5, 2023 2:47 am

I would like to install plex using your guide (used your proxmox / HA guides previously with great success).

My proxmos server has a 4tb SATA drive installed. How would you suggest I make the drive available for Plex in a way that it can also be accessed by Sonarr and via windows 11 as a network share?

Thanks!

MilesTEG
March 6, 2024 9:02 am

Hello,
I’ve got a NUC with an AMD Ryzen™ 9 7940HS with iGPU AMD 780M.
Do you think it’ll be possible to get HW transcode with this iGPU ?