-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request - Plex LXC with Hardware Acceleration Support #8
Comments
Currently I'm not running a Plex Media Server so, if you're willing to test and give feedback I'd appreciate it. Run the following in the Proxmox web shell (replace 106 with your Plex Media Server LXC ID)
|
Hi tteck, thanks for such a quick response and script! Unfortunately I can see that the plex server is still not using hardware acceleration as screenshot attached. If it uses Intel Quick Sync, it will show "Transcode(hw)" instead of "Transcode". I am using your latest script - checked in about half an hour ago. I can confirm that the script has updated LXC conf file with the hardware acceleration config. So I thought that the problem may be because this container is an unprivileged LXC instead of a privileged LXC as stated in the link hardware acceleration would only work in a privileged LXC. See https://herold.space/proxmox-lxc-intel-quick-sync-for-plex/ Following this solution https://www.reddit.com/r/Proxmox/comments/irjylk/how_can_i_edit_an_unprivileged_container_to_make/, I have made the LXC privileged and reboot. And I can confirm the LXC is privileged using one of the checking mechanism. Unfortunately the Plex LXC is still not using Intel Quick Sync for hardware acceleration. Let me know if you need me to provide any kind of logs as I don't know what to provide. Don't worry too much if you don't have time. In the meantime, I will do more research on internet to see if I can find other things to try. But this is not blocking anything anyway, I just want to see if hardware acceleration in PVE can enable me to transcode 4k video or not or stream more video etc. |
Thanks, In your LXC conf file change to match below, reboot the LXC and give feedback
FYI, all of my scripts create privileged containers. |
Ah, I didn't realise that. Yes, I can confirm all of containers created by your script are privileged already. Unfortunately the hardware acceleration is still not working after the change you proposed. The plex setting is correct as well. But let me check if anything wrong with my account first on another windows Plex server first just to root out other potential problems - will report back tomorrow after I tried it a windows machine. Thanks very much, tteck. |
When you find time add this to the conf
I appreciate your help! |
Nah, it's you who are helping me. I have tried windows client with an older intel processor and hardware acceleration is working fine with my account. I can also confirm the same transcode setting is used. I can see that my plex pass is working on my Samsung TV client as well because it can play trailers when I set it to. Just tried to add the code you suggested and it didn't work either. So the conf files I tried just now are
and
Will go to sleep now but let me know if you want me to try anything else or dump any logs and I can do that tomorrow or later. |
I assume you've installed the Intel Graphics acceleration drivers? example: |
Are we still actively working toward Plex Hardware Acceleration Support? |
Hi tteck, thanks for the reference. I didn't install the Intel Graphics acceleration drivers. With the reference you gave, I managed to install that. But it didn't enable hardware transcode either. I am searching more information from internet as well and try to understand more to see if I can troubleshoot further from my end. https://forums.plex.tv/t/pms-installation-guide-when-using-a-proxmox-5-1-lxc-container/219728 is guide for promox 5 while I am using proxmox 7. I wonder if any configuration need to be updated. |
@relliky - What's your CPU? I have the same problem. I am also unable to run hardware acceleration in Plex. I've tried everything and nothing. It seems to me that maybe my CPU is too old - Intel Core i7 4785T. And with you ? |
For what it's worth: I run Plex with HW acceleration in LXC on two different machines and it works on both. One has Core i5-7400 and the other Core i5-11400. |
Hi @zawias , @osaether thanks for the feedback. It's good to know that this is actually working and it is likely something wrong to my environment. I am running with Intel i5-5250U. According to intel website, both your i7-4785T and my i5-5250U features Intel Quick Sync Video. https://ark.intel.com/content/www/us/en/ark/products/80814/intel-core-i74785t-processor-8m-cache-up-to-3-20-ghz.html I have spent another few hours today and haven't manage to get it working in Plex LXC. I am planning to try the following when I have a bit more time:
@osaether, could you confirm if you installed Plex LXC using tteck's script? I'd like to confirm the versions of linux LXC and PMS used by the script can work together to support hardware acceleration and root out a software compatibility problem. And do you mind also sharing your Proxmox VE version? |
Hi @relliky, I did not install Plex using this script. I did it manually. One thing to check are the access modes for the /dev/dri folder in the container. I did these commands, before installing plex in the container:
|
Hi @osaether, thanks for the information. I already tried the command below and it didn't enable the hardware acceleration before.
I don't think change The only thing I haven't tried was to install plex after doing it. So I just tried it and it didn't work unfortunately. I'd like to see if I can manually install Plex like what you did. When you have time, would it be okay for you to share the exact LXC you used and the versions you used and any reference to look for your installation if you happen to know? |
Hi @relliky I described the steps I did on the proxmox forum (link below). I have since I wrote that post reinstalled following my own recipe but I had to do a few additional steps. First, the LCX container must be privileged. Then in the container shell I installed the intel drivers from the intel repo: and installed plexmediaserver. Link to discussion on proxmox forum: |
Hi @osaether, thanks very much for the guide. I have managed to enable the hardware acceleration by using your installation method. FYI, @zawias, you may want to know that I have verified this installation method and you may use it as a workaround now. @tteck, thanks for all the support and I really appreciated! I am suspecting the debian version and PMS version in your script had a compatibility issue when enabling hardware acceleration. I used @osaether's version and get it working on Ubuntu 20.04 and PMS repo. I am afraid that I don't think I am capable enough now to modify your script and send a pull request. But feel free to let me know if you need my help to verify your script when you are available to update the script. |
As you can see in the script echo -e "${CHECKMARK} \e[1;92m Downloading Plex Media Server... \e[0m"
wget https://downloads.plex.tv/plex-media-server-new/1.25.3.5409-f11334058/debian/plexmediaserver_1.25.3.5409-f11334058_amd64.deb &>/dev/null
echo -e "${CHECKMARK} \e[1;92m Installing Plex Media Server... \e[0m"
sudo dpkg -i plexmediaserver_1.25.3.5409-f11334058_amd64.deb &>/dev/null
cat <<EOF > /etc/apt/sources.list.d/plexmediaserver.list
deb https://downloads.plex.tv/repo/deb/ public main
EOF
wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add - &>/dev/null It's pulling the exact same PMS info/repo |
@tteck , thanks for the clarification. Sure, that sounds a good starting point. I can help test it when you have the patch ready. |
I can create a seperate script to install the Intel drivers, but not in the PMS script, because not everyone is using Intel CPU's |
I checked it on other hardware with the i5-7500 CPU and it worked. I used the container from the script: |
@tteck I can confirm that I can enable the hardware acceleration using the latest script. Thanks for all the work to make beginners easier to use Proxmox. I tested it using the command @zawias used. So I didn't install intel driver in the LXC and only did in the host. I haven't tested if I need to install intel driver in the host though. But I remember that @zawias I think the latest script should work with your i7-4785T CPU as well. |
OK, here's where things stand 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/dri/renderD128 dev/renderD128 none bind,optional,create=file executes /bin/chgrp video /dev/dri
/bin/chmod 755 /dev/dri
/bin/chmod 660 /dev/dri/* before installing PMS |
If someone will test to make sure everything is ok and working, I think we can call this complete! :) |
@tteck, I think both zawias and I have tested it and it is working. Let me know if you are expecting to test with another sequence.
I think we may be able to remove a few lines of code here as some of them may not be required. Let me know if you prefers that, and I can try it out. But I can also understand the principle of "if it is working, don't change it" :) |
Yes, I installed them in the LXC container console. |
Thanks everyone! |
Hi, I'm struggling with hardware accel, it isn't working. I have an i5-7500T with onboard "gpu". But it is very slow encoding/decoding, also 100% cpu. so the gpu-passthrough isn't working. root@mushicenter:~# ls /dev/dri/ -la You mentioned:
But I couldn't find this file. |
Hi, tteck. Thanks for creating this awesome repo! It has greatly helped my experience with HA on PVE as a newbie to PVE. Coming from a HAOS background in a Raspberry Pi, it has been quite challenging for me to debug the PVE HA VM booting problem and your script just make this so easy. Thanks very much.
I am also trying your Plex LXC script and it works great. It would be great if you would like to update the Plex script with hardware acceleration support at some point when you are free. But I cannot ask for more given this repo is so great.
I have done a bit research on my own and find these as useful reference:
https://forums.plex.tv/t/plex-hw-acceleration-in-lxc-container-anyone-with-success/219289/117
https://herold.space/proxmox-lxc-intel-quick-sync-for-plex/
I am also trying to get it working at my end but still need to learn a lot about PVE, linux and LXC. Hopefully I can get it working and send a pull request to you :)
The text was updated successfully, but these errors were encountered: