Plex Server Ubuntu 24.04 HEVC main 10 hardware decode issue + Apparmor

Server Version#: 1.40.2.8395
Player Version#: 1.93.0.144-9b2f4a13

2 small issues with PMS as a snap on Ubuntu 24.04 server

1st - I’m having a little bit of a problem with PMS - I can HW decode H.264 just fine, but even tho my CPU is capable of H.265, it seems to resort to software decoding and pushes the CPU to 100%. The CPU is an i5-7500 which according to intel’s sheets, does support HEVC 10 bit. I don’t know if I’m just missing some additional tools to be installed or something is misconfigured (I am a lifetime subscriber) - I had read on another post from about 4 years ago about switching from the snap to the .deb file and was wondering if that might resolve the issue - and if so, is there a way to export my DB to import into the deb version? I’m attaching my debug log

2 - which may be related to #1 - I’m getting a weird apparmor message that I noticed while trying to figure out why my HEVC video wasn’t using hardware decoding from the server - so if anyone has any tips on if this is related and possibly how to fix it…
audit: type=1400 audit(1716923599.976:478): apparmor="DENIED" operation="mknod" class="file" profile="snap.plexmediaserver.plexmediaserver" name="/etc/igfx_user_feature_next.txt" pid=36061 comm=504D532052657148616E646C6572 requested_mask="c" denied_mask="c" fsuid=0 ouid=0

Any thoughts on these would be appreciated!
Plex Media Server Logs_2024-05-28_14-14-22.zip (54.3 KB)

Note - looks like my issue is related to Ubuntu 24.04 & HW transcoding - #59 by peterkocic - unfortunately this was a fresh setup server so I had used Ubuntu server 24.04… I’d really hate to reset it to 22.04, but I may have to as a lot of my newer 4K content is HDR

You only have to downgrade the kernel to 6.5, nothing else.

Download the kernel packs from mainline:

wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.5/amd64/linux-headers-6.5.0-060500-generic_6.5.0-060500.202308271831_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.5/amd64/linux-headers-6.5.0-060500_6.5.0-060500.202308271831_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.5/amd64/linux-image-unsigned-6.5.0-060500-generic_6.5.0-060500.202308271831_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.5/amd64/linux-modules-6.5.0-060500-generic_6.5.0-060500.202308271831_amd64.deb

Install the kernel packs by running:

sudo dpkg -i linux-headers-6.5.0-060500-generic_6.5.0-060500.202308271831_amd64.deb \
               linux-headers-6.5.0-060500_6.5.0-060500.202308271831_all.deb \
               linux-image-unsigned-6.5.0-060500-generic_6.5.0-060500.202308271831_amd64.deb \
               linux-modules-6.5.0-060500-generic_6.5.0-060500.202308271831_amd64.deb

Now edit the GRUB:

sudo nano /etc/default/grub

GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.5.0-060500-generic"
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0

sudo update-grub

If your install was fresh your 6.5 will most likely end up as default number 3, if not - use this to list kernels and find which number, count from top

grep menuentry /boot/grub/grub.cfg

Restart into 6.5 and hw transode now works

sudo reboot

1 Like

Hmm, so downgrading the kernel is really all that’s needed? Thank you for the detailed response. I’ll try it out today and see what happens. I was thinking maybe I should also hold back kernel updates, but then again, I guess I can always just let apt do its thing and if a later updated kernel doesn’t work just revert back again.

6.8 is still there, and you can change the grub if you suddenly want it back. I know i fickled a bit before i got it to default into 6.5.

But yes…that’s all that’s needed and it’s been working fine for me running all my stuff.

Fickled a little might be an underestimation rofl - I’ve not been able to get it to cooperate to boot to 6.5 yet. I checked my boot order and kernels offered, I even went the old route of specifying the kernel from the submenu to boot from but for some reason it’s insisting on booting 6.8.

Apologies - i remember in the post-fickle i went with:

GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.5.0-060500-generic"

remember, after

sudo update-grub

…i will update my post

Haha, no worries at all - I managed to bork my system trying to get it to boot a different kernel and had to boot a live usb to recover - right now I have grub set to save the boot option based on last selected kernel. Since I had to hook up a screen to fix my previous issue after trying to get a kernel other than 3, I manually selected the kernel from the boot list and it’s now booting to that by default. I may change to the default listing you have and take out the boot timeout I put in so I could get to the menu.

That said, I think I’ll wait till this weekend to deal with that as if I make a mistake, unbreaking it before work kinda sucks lol.

I don’t know what fresh setup has to do with this. 22.04 is still supported and readily available at ubuntu.com. You’ll have much less headache with it until at least the .1 release.

Fresh setup basically means this was a new server install to retire my NAS which couldn’t handle the video files well any more. I had installed 24.04 - it’s fully setup, plex is installed and operating, the metadata is all there now. Moving to 22.04 is doable, but I really didn’t want to redo the system since I had it up and operating how I wanted. In all honesty - I haven’t had any issues aside from the HDR transcodes - I’m also not using the desktop LTS which has its own issues. Moving to kernel 6.5 resolved the HDR transcode issue so unless something really terrible happens with this install I’m going to leave it how it is now.

Also mentioned to clarify that I didn’t have an existing system I forced upgraded from 22.04 to 24.04.

If I may add here?

  1. I have no intention of updating to 24.04 at least until the .2 release.
    – The more bug fixes we can get ; the better.

  2. The delineation with all this is the CPU & kernel they paired with that kernel.

  3. In all the Linux machines I’ve built, I split the OS partition from the rest of the data. e.g.
    – 128 GB for root (can be trimmed back to 64 GB if needed). I can change the OS without impacting anything else.
    – 2/4/8 GB for swap
    – Remainder for /home partition ( mkdir /home/plex :smiling_imp: )

hope this gives an idea

#1 - Keep in mind - this wasn’t an updating to situation - if this server was running 22.04.x, I wouldn’t have changed it :slight_smile: - I may be a bit crazy and have not used Ubuntu for several years, but I’m not crazy enough to upgrade an operational system to a new full release until at least after the first point release. I probably should have just set it up with 22.04 but I really wanted to try out 24.04 and since most of the headaches I’ve seen with 24.04 have been with the desktop version I hoped for a fairly smooth situation (which for the most part it was)

#2 100% - if I had learned about the issue of 6.8.0 w/ HDR transcoding (at the very least with 7th gen CPUs), I never would have started the project with 24.04 and would have installed 22.04 instead.

And in #3 - in my case, this server is just for plex - there is just the plex server snap (and a few additional tools needed installed) - all of my actual media files are on separate drives (either on NAS or local) mounted so I don’t have to “re-transfer” all of the media itself if I did have to wipe and restart (except the metadata cache which I really don’t know where the snap stores off hand but I would have dug into that if I did have to redo the server)

FWIW: Regarding SNAP packages.

  • Installing PMS from the Ubuntu store will give you a SNAP package, not a real DEB (native) package.

  • SNAPs are isolated from the HW. You don’t get HW transcoding from them.

Snaps are ok to play around with or for things like browsers & other socket-based apps but fall short when you need to get to the hardware.

Well, that’s odd because the back end shows HW on the transcodes, and the CPU usage reinforces that… see the pics:


so although you’re saying the snaps won’t do hardware transcoding due to inability to access at hardware level, the lack of CPU usage on a 4K HDR10bit to 1080p shows it is. Before when it really was using CPU encoding, my CPU was at 55%-60% (when running kernel 6.8 it was pegged at 100% with HDR tonemapping enabled) for this same file and it couldn’t maintain a steady stream (pauses every few seconds). Not trying to argue - just not seeing how you’re describing the snap to be (which is how I have PMS installed).

You’re running that on a Fedora host?

THAT’S WILD!!!

It seems Fedora is doing what Ubuntu can’t

I stand corrected.

No no, that’s server dashboard showing my fedora client - I have fedora on my laptop - was playing Plex remote :slight_smile:

I apologize and happily stand corrected.

Somewhere along the way, which I missed, Engineering added the interface (doesn’t exist in the default snap sandbox)

    plugs:
      - home-all
      - network
      - network-bind
      - opengl
      - raw-usb
      - removable-media
      - system-observe

Today is a good day… :slight_smile:

Hopefully opengl won’t ever get accidentally shut off in a future update - that would be a bad day :rofl: - but at least if something like that happens in the future, the deb will hopefully always remain available!

This does work and work well for me.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.