Ubuntu 24.04 & HW transcoding

Jun 28, 2024 23:52:57.266 [137964678032184] INFO - Plex Media Server v1.40.3.8555-fef15d30c - Docker Docker Container (LinuxServer.io) x86_64 - build: linux-x86_64 debian - GMT 01:00
Jun 28, 2024 23:52:57.267 [137964678032184] INFO - Linux version: 6.8.0-35-generic, language: en-US
Jun 28, 2024 23:52:57.267 [137964678032184] INFO - Processor: 6-core Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz
Jun 28, 2024 23:52:57.267 [137964678032184] INFO - Compiler is - Clang 11.0.1 (https://plex.tv 9b997da8e5b47bdb4a9425b3a3b290be393b4b1f)
Jun 28, 2024 23:52:57.267 [137964678032184] INFO - /usr/lib/plexmediaserver/Plex Media Server
epir@homelab:~$ ls -la /dev/dri
total 0
drwxr-xr-x   3 root root        100 Jun 21 17:48 .
drwxr-xr-x  21 root root       4320 Jun 21 18:03 ..
drwxr-xr-x   2 root root         80 Jun 21 17:48 by-path
crw-rw----+  1 root video  226,   1 Jun 21 18:48 card1
crw-rw----+  1 root render 226, 128 Jun 21 17:48 renderD128
epir@homelab:~$ groups epir
epir : epir adm cdrom sudo dip plugdev lxd

so it looks like only the root user has access to this directory which i’m guessing is the issue. do i just need to add my user to the β€œvideo” and β€œrender” groups? or do i need to change the PGID in the compose file?

this is how plex is set up in my compose, with β€œ1000” being my user and group:

  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - VERSION=docker
    devices:
      - /dev/dri:/dev/dri
    volumes:
      - /docker/appdata/plex:/config
      - /mnt:/mnt
      - /mnt2:/mnt2
    restart: unless-stopped

what confuses me is that this all worked fine on my synology nas, i never had to mess with permissions or anything, maybe the synology somehow automatically gives plex access to /dev/dri? also if plex doesn’t have access to /dev/dri, how come it’s able to detect my iGPU in the transcoder settings?

image

EDIT: also checked the docs of Linuxserver (whose image i am using) and it says that as long I’ve added the /dev/dri to the container, it will automatically assign permissions:

You have got a mess there and I don’t know how to solve it.

The definition order is: card0/renderD128, card1/renderD129
(the difference is bit 7 in the inode minor number)

To answer your question: The user you use must be a member of both groups.

In the native DEB file installer, I add both groups

ah strange, i haven’t done anything myself. did a completely clean install of ubuntu server and i believe the /dev/dri directory was automatically created and assigned permissions to root by the system

interestingly the container logs suggest the perms are fine:

───────────────────────────────────────
      β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ•‘     β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
      β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
**** Server already claimed ****
**** permissions for /dev/dri/card1 are good ****
**** permissions for /dev/dri/renderD128 are good ****
Docker is used for versioning skip update check
[custom-init] No custom files found, skipping...
Starting Plex Media Server. . . (you can ignore the libusb_init error)
[ls.io-init] done.
Critical: libusb_init failed

i’ll try add my user to the video group anyway and see if that fixes it

The container relies on the host. There is no guarantee what it prints there.

The container is showing UID/GID 1000, which is your desktop user

do a groups <your_username> and see what you get. Confirm video and render are in the list

example:

[chuck@lizum ~.2006]$ groups chuck
chuck : chuck adm cdrom sudo dip video plugdev render lpadmin lxd
[chuck@lizum ~.2007]$

thanks, i removed the plex container, added my user to those groups, recreated the container but it’s still not using hardware transcoding unfortunately :c

epir@homelab:/docker$ groups epir
epir : epir adm cdrom sudo dip video plugdev render lxd
epir@homelab:/docker$
Jun 29, 2024 19:16:18.678 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 29, 2024 19:16:18.694 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 29, 2024 19:16:18.694 [134661858667320] Debug β€” [Req#d62/Transcode] Could not create hardware context for h264_vaapi
Jun 29, 2024 19:16:18.696 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 29, 2024 19:16:18.703 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 29, 2024 19:16:18.703 [134661858667320] Debug β€” [Req#d62/Transcode] Could not create hardware context for h264
Jun 29, 2024 19:16:18.706 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 29, 2024 19:16:18.722 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 29, 2024 19:16:18.722 [134661858667320] Debug β€” [Req#d62/Transcode] Could not create hardware context for h264
Jun 29, 2024 19:16:18.723 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 29, 2024 19:16:18.724 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 29, 2024 19:16:18.724 [134661858667320] Debug β€” [Req#d62/Transcode] Could not create hardware context for h264
Jun 29, 2024 19:16:18.725 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 29, 2024 19:16:18.725 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 29, 2024 19:16:18.725 [134661858667320] Debug β€” [Req#d62/Transcode] Could not create hardware context for h264
Jun 29, 2024 19:16:18.726 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 29, 2024 19:16:18.726 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 29, 2024 19:16:18.726 [134661858667320] Debug β€” [Req#d62/Transcode] Could not create hardware context for h264
Jun 29, 2024 19:16:18.727 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (CoffeeLake-S GT2 [UHD Graphics 630])
Jun 29, 2024 19:16:18.728 [134661858667320] Debug β€” [Req#d62/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Jun 29, 2024 19:16:18.728 [134661858667320] Debug β€” [Req#d62/Transcode] Could not create hardware context for h264
Jun 29, 2024 19:16:19.023 [134661732838200] Debug β€” [Req#d3b/Transcode] TPU: hardware transcoding: enabled, but no hardware decode accelerator found
Jun 29, 2024 19:16:19.023 [134661732838200] Debug β€” [Req#d3b/Transcode] TPU: hardware transcoding: final decoder: , final encoder: 
Jun 29, 2024 19:16:46.773 [134661871250232] Debug β€” [Req#f75/Transcode] TPU: hardware transcoding: enabled, but no hardware decode accelerator found
Jun 29, 2024 19:16:46.773 [134661871250232] Debug β€” [Req#f75/Transcode] TPU: hardware transcoding: final decoder: , final encoder: 

Did you sign out and back in? It won’t apply until after that.

ALSO,

May I please have the DEBUG logs ZIP file which includes PMS startup?

I need to see more than you’re showing me.

sure will grab that, also sorry dumb question i know but do you mean sign out of plex? or my actual server?

actual server.

I have a question.

Given so much more is done for you on Ubuntu by the installer, and you have the ability to customize where the metadata is stored, why are you using docker ?
You aren’t gaining any functionality.

i did some research before setting it all up and everyone recommended to run the software stack in docker compose as it’s easier to manage and migrate

i can try the native install but it’s weird how it worked fine through docker on my synology nas

unfortunately signing out and back in didn’t fix it, what was the full name of the log file you needed please? can’t find one with debugs in its name

Myself, and most people recommend:

  1. 22.04LTS with 6.2 or 6.5 kernel, and
  2. the official plexinc docker: GitHub - plexinc/pms-docker: Plex Media Server Docker repo, for all your PMS docker needs.

But your use of a fresh release, basically experimental OS, and some third party who knows what they’ve done, clearly broken jank docker image… is none of the above.

Settings - Server - Troubleshooting - Download Logs.

It will give you a ZIP

This is the ZIP file I would like to see.

As stated by Menel, 22.04 LTS is preferred.
24.04 is full of problems. It does not have any bug-fix updates (24.04.1).
The root cause is the 6.8 kernel and it’s support libraries (hence bug fixes)

The β€˜bleeding edge’ hurts sometimes. This is one of them

Supplemental:

With the older CPUs: Coffee Lake / KabyLake, you can use the 5.15 kernel (no HWE) with complete success. This is what I use on my NUC8-i7-HVK

i used the linuxserver image as it’s widely used and supported, it worked perfectly on my Synology

it sounds like the issue is specifically with ubuntu 24.04 due to the 6.8 kernel, i thought the latest plex update fixed that issue but i probably misunderstood

i will just bite the bullet and install 22.04, thanks for your help and sorry to waste your time

We got a lot of the 6.8 issues resolved but, as I’ve stated elsewhere, not all of them.

OpenCL continues to remain a problem with the 6.8 kernel and the Intel Compute Runtime library.

The 6.5 or lower kernel – OR – Ubuntu 22.04 (both of which I’ve also recommended) are the better choice until after Ubuntu 24.04 gets its bug fixes (24.04.1) and we have chance to resolve the issue (We are working with Intel)

didn’t think about downgrading the kernel, might do that instead as it will probably be less hassle than clean installing 22.04 and starting from scratch

IF you’re using the hwe packages, simply uninstalling them will take you back to the 5.15 default kernel.

This works perfectly for all but the newest AlderLake/RaptorLake/MeteorLake (P-E core machines)

not sure what a hwe package is but that probably means i don’t have it

dpkg -l | grep hwe

It’s also the β€œHardware Enablement” packages

1 Like

so as a last ditch effort to avoid having to downgrade the kernel/ubuntu, i tried googling and finally found the answer on reddit: Reddit - Dive into anything

tl;dr:

it wasn’t an issue with ubuntu 24.04, linux kernel 6.8 or the linuxserver container itself. i didn’t even need to give my user access to /dev/dri or manually install any drivers (as it’s all handled by the specific container above)

as i copied over the configs from synology to linux, i simply needed to update the vaapidriver entry in preferences.xml from β€œi965” to β€œihd” and it’s working perfectly now

sorry to waste everyones time, especially @ChuckPa but hopefully this helps someone in the future with the same issue that i had

:man_facepalming:

It is best to COMPLETELY REMOVE VaapiDriver="value" when moving from Synology. Synology uses a 4.x Linux kernel.

Sorry for missing that.

1 Like

no worries, it was a bit of an oddball

that’s good to know thanks, i’ll remove it