Ubuntu 24.04 & HW transcoding

Oh no… Use the official plexinc docker image. Not whatever garbage that is, who knows what some random goon tampered with.

22.04, kernal 6.8, and PMS latest:
image: plexinc/pms-docker:latest

My full compose:

version: '3.2'
services:
  plexmedia_BUGS:
    container_name: plexmedia_BUGS
    hostname: plexmedia_BUGS
    #image: plexinc/pms-docker:1.40.2.8395-c67dce28e
    image: plexinc/pms-docker:latest
    restart: unless-stopped
    devices:
      - /dev/dri:/dev/dri
    ports:
      - 32400:32400/tcp
#      - 8324:8324/tcp      #Plex for Roku
#      - 32469:32469/tcp    #DLNA Server
#      - 1900:1900/udp      #DLNA Server
      - 32410:32410/udp     #GDM network discovery
      - 32412:32412/udp     #GDM network discovery
      - 32413:32413/udp     #GDM network discovery
      - 32414:32414/udp     #GDM network discovery
    environment:
      - TZ=America/New_York
#      - PLEX_CLAIM=<claimtoken>     #copied in
      - ADVERTISE_IP=https://192.168.10.22:32400/
      - PLEX_UID=1000
      - PLEX_GID=1000
      - ALLOWED_NETWORKS=192.168.0.0/16,172.16.0.0/16
    hostname: bugs
    tmpfs:
      - /transcode
    volumes:
      - ./config:/config
      - /home/plex/Videos:/home/plex/Videos
      - /mnt/sataAB:/mnt/sata0:ro
      - /mnt/sataCD:/mnt/sata1:ro
      - /mnt/sataEF:/mnt/sata2:ro
      - /mnt/sataG:/mnt/sata3:ro

@ChuckPa Sorry, troubleshooting went late into the night and i passed out while it was installing. I’m happy to report that natively it wokrs as epxected, i’m transcoding a 4k stream with it barely affecting my CPU. So thats great! I would like to get it going in Docker eventually but I think i might take a break after bashing my head against this all weekend. Thanks so much for your help!

@Menel Taking a look at your compose, here is mine:

  plex:
    container_name: plex
    image: ghcr.io/hotio/plex
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-file: ${DOCKERLOGGING_MAXFILE}
        max-size: ${DOCKERLOGGING_MAXSIZE}
    labels:
      - org.hotio.pullio.update=${PULLIO_UPDATE}
      - org.hotio.pullio.notify=${PULLIO_NOTIFY}
      - org.hotio.pullio.discord.webhook=${PULLIO_DISCORD_WEBHOOK}
    ports:
      - 32400:32400
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - UMASK=002
      - PLEX_CLAIM_TOKEN=${PLEX_CLAIM_TOKEN}
      - PLEX_ADVERTISE_URL=${PLEX_ADVERTISE_URL}
      - PLEX_NO_AUTH_NETWORKS=
      - PLEX_BETA_INSTALL=${PLEX_BETA_INSTALL}
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DOCKERCONFDIR}/plex:/config:rw
      - ${DOCKERSTORAGEDIR}/media:/data/media:rw
    devices:
      - /dev/dri:/dev/dri 

If i’m understanding correctly, i just need to change this image: ghcr.io/hotio/plex to this image: plexinc/pms-docker:latest, correct?

I have it working perfectly fine with the same machine you have using hotio’s image.

services:
  # Plex
  plex:
    container_name: plex
    image: ghcr.io/hotio/plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=002
      - TZ=Europe/XXX
      - PLEX_CLAIM_TOKEN=XXX
      - PLEX_NO_AUTH_NETWORKS
      - PLEX_BETA_INSTALL=false
      - PLEX_PURGE_CODECS=true
    volumes:
      - /data/dockerdata/plex:/config
      - /dev/shm:/tmp
      - /nfs/plex/data/media:/data/media
    devices:
      - /dev/dri:/dev/dri
    restart: unless-stopped

Setting network mode to host will vastly simplify remote connecting to the Plex server. If you’re on a standard Ubuntu install this compose should even automatically set to transcode on RAM as it should be.

Just change your paths for the /config and the actual media folders. Also obviously change your TZ to yours, and add the Claim token (and change PUID and PGID if you’ve a different user setup in Ubuntu)

@AGoonyGooGoo

I’m up to my :eye: :eye: today.

  1. network stack reconfiguration failed to survive a reboot (UNKNOWN cause)
  2. 2 HDDs of my media array failed (fortunately it is RAID 6)
    – confirming my image backup now (110 TB)

… when it :cloud_with_rain: lol

These guys will help you. ( I’ve trained them well. :rofl: )

1 Like

OK, so for me, PLEX transcode still does not work, no matter if in docker or directly on system, plex have rights to access /dev/dri, system recognizes GPU correctly

bckp@friday:/$ ls -l /dev/dri/
total 0
drwxr-xr-x 2 root root         80 Aug 31 21:59 by-path
crw-rw---- 1 root render 226,   0 Sep  2 19:08 card0
crw-rw---- 1 root render 226, 128 Sep  2 19:08 renderD128
bckp@friday:/$ cat /etc/group | grep render
render:x:993:plex

Ubuntu 24.04.1 and kernel 6.10.7

VaInfo show this about GPU

libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.1.0 ()
and a lot of profiles

and here is LSPCI

bckp@friday:/$ lspci
00:00.0 Host bridge: Intel Corporation Device a71b (rev 01)
00:02.0 VGA compatible controller: Intel Corporation Raptor Lake-U [Intel Graphics] (rev 04)
00:04.0 Signal processing controller: Intel Corporation Raptor Lake Dynamic Platform and Thermal Framework Processor Participant (rev 01)
00:06.0 PCI bridge: Intel Corporation Raptor Lake PCIe 4.0 Graphics Port (rev 01)
00:06.2 PCI bridge: Intel Corporation Device a73d (rev 01)
00:07.0 PCI bridge: Intel Corporation Raptor Lake-P Thunderbolt 4 PCI Express Root Port #0 (rev 01)
00:07.2 PCI bridge: Intel Corporation Raptor Lake-P Thunderbolt 4 PCI Express Root Port #2 (rev 01)
00:08.0 System peripheral: Intel Corporation GNA Scoring Accelerator module (rev 01)
00:0a.0 Signal processing controller: Intel Corporation Raptor Lake Crashlog and Telemetry (rev 01)
00:0d.0 USB controller: Intel Corporation Raptor Lake-P Thunderbolt 4 USB Controller (rev 01)
00:0d.2 USB controller: Intel Corporation Raptor Lake-P Thunderbolt 4 NHI #0 (rev 01)
00:0d.3 USB controller: Intel Corporation Raptor Lake-P Thunderbolt 4 NHI #1 (rev 01)
00:12.0 Serial controller: Intel Corporation Alder Lake-P Integrated Sensor Hub (rev 01)
00:14.0 USB controller: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller (rev 01)
00:14.2 RAM memory: Intel Corporation Alder Lake PCH Shared SRAM (rev 01)
00:16.0 Communication controller: Intel Corporation Alder Lake PCH HECI Controller (rev 01)
00:17.0 SATA controller: Intel Corporation Alder Lake-P SATA AHCI Controller (rev 01)
00:1d.0 PCI bridge: Intel Corporation Alder Lake PCI Express Root Port #9 (rev 01)
00:1f.0 ISA bridge: Intel Corporation Raptor Lake LPC/eSPI Controller (rev 01)
00:1f.3 Multimedia audio controller: Intel Corporation Raptor Lake-P/U/H cAVS (rev 01)
00:1f.4 SMBus: Intel Corporation Alder Lake PCH-P SMBus Host Controller (rev 01)
00:1f.5 Serial bus controller: Intel Corporation Alder Lake-P PCH SPI Controller (rev 01)
02:00.0 Non-Volatile memory controller: Phison Electronics Corporation PS5013-E13 PCIe3 NVMe Controller (DRAM-less) (rev 01)
57:00.0 Ethernet controller: Intel Corporation Ethernet Controller I226-V (rev 04)

Interesting is, Jellyfin in docker succesfully engage HW transcoder (seen in gputop)

Folks:

Jellyfin is using FFMPEG 6.1

We are still using FFMPEG 4.4 (from previous team)

We are, with the current team, upgrading FFMPEG to 6.1

I know you’re all anxious. We’re making what we have work the best it can.
This is a big upgrade. FFMPEG is one thing, All the Plex additives to FFMPEG are what take time.

@bckp

When I finish with today’s site emergency, I will set that up and show you
I don’t have any difficulties so there must be something trivial different.

Today’s emergencies -

  1. network stack corrupted via update
  2. RAID array HDD connector wasn’t 100% solid and became disconnected… knocking two drives out of the array (it’s rebuilding… 23 hours to sync remaining)
4 Likes

You are my hero man!

It was more informative, we spoke here 24.04.1 will solve some issues, so just inform it did not :frowning: i did not know about ffmpeg versions, good to know, i will wait, no rush needed.

Plex is awesome, only thing is, my kids time to time hit download button and that make my nas hurts, it has passive cooled ryzen 1600, it hits 80 degs instantly :frowning:

RAID resync is always fun, last time i have faulty WD drive, replaced it with another one, run resync for 33 hours, and when it finished, another WD drive failed…

@bckp

Root cause: 1 connector not properly seated at build time got jiggled. Another got pulled out while trying to reseat cables with it live :man_facepalming:

      
md3 : active raid6 sdk[13] sdm[2] sdi[4] sdj[10] sds[8] sdn[5] sdp[14] sdt[7] sdr[0] sdo[1] sdq[11] sdl[12]
      117187532800 blocks super 1.2 level 6, 1024k chunk, algorithm 2 [12/10] [UUU_UU_UUUUU]
      [=>...................]  recovery =  9.1% (1071107616/11718753280) finish=1148.0min speed=154571K/sec
      

:rofl:

I will message you PM so we can fix this thing once & for all.

2 Likes

You will need to change PUID & PGID to PLEX_UID & PLEX_GID respectively if using the official Plex Docker image.

You also won’t need to specify PLEX_ADVERTISE_URL, PLEX_NO_AUTH_NETWORKS or PLEX_BETA_INSTALL.

HW based tone mapping working fine for me on fresh install 24.04.1 and N100 device using current pms 1.40.5.

1 Like

How to find out whether HW transcoding is working or not for me its says hw for video but nothing for audio.

I’m on Coffelake 8100T with 24.04.01.

Is checking intel_gpu_top only way ?

@dinj3

If using the iGPU then yes, intel-gpu-top package provides the tool to confirm you’re getting HW transcoding.

PMS will show you what it’s doing but intel_gpu_top will give you a real-time display of the workload as it’s happening

Blockquote
intel-gpu-top: Intel Coffeelake (Gen9) @ /dev/dri/card0 - 1050/1052 MHz; 0% RC6; 9.58/19.83 W; 1147 irqs/s

  IMC reads:     8210 MiB/s
 IMC writes:     3500 MiB/s

     ENGINES     BUSY                                                                                                                                                                      MI_SEMA MI_WAIT
   Render/3D   81.11% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ                              |     13%      0%
     Blitter    0.00% |                                                                                                                                                                  |      0%      0%
       Video   83.48% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž                          |      1%      0%
VideoEnhance    0.00% |                                                                                                                                                                  |      0%      0%

PID Render/3D Blitter Video VideoEnhance NAME
589107 |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰ || ||β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ || | Plex Transcoder

After a while the load average keeps going higher. I’m running on docker and have passed correct user and group as well igpu as display driver.

image

I’m rebuilding my main nas right now (8 hours remaining).
I’m spinning up my backup NAS so I can test.

It does fluctuate (3-75%)

Same movie as you

I belive fluctuation is becouse it prebuffers and when the buffer is full, it will slow down…

1 Like

it will also fluctuate based on video load at that part (the contents) of the video stream. More CGI in the video means more sharp edges which cause more abrupt color changes.

I am experiencing the same issue with passing though a UHD 630 iGPU to Ubuntu. 22.04 is fine but with 24.04 intel_gpu_top just shows 100% usage while nothing seems to be getting done. I see the same dmesg messages as you too.

1 Like

I’m not seeing any usage in intel_gpu_top under 24.04.1. When I do a clean install of 24.04.1 it works, but not when I execute a do-release-upgrade from 22.04.4 to 24.04.1. I don’t really want to start from scratch with my Ubuntu VM.

I tried a clean install and same issue. I’m running in a VM with the GPU passed though. (XCP-NG) Jellyfin also has the same issue so i’m thinking its something specific with 24.04. 22.04 is totally fine with both however.

1 Like

I’ve been reading some of the advice here for a while and decided to rebuild my head server to remove an excess layer of virtualization by switching from Ubuntu 24.04.1 VM β†’ docker to just a dedicated LXC for Plex built from tteck’s script.

Unfortunately, Plex is not doing any HW transcoding for me :frowning: I’m on a Beelink SEI12 running an Intel i5-12450H with Proxmox 8.2.4. I’m running the current PlexPass version 1.41.0.8930 and the LXC container is running on 22.04.4 LTS. I did a test run lowering the quality and saw the following errors:

Sep 04, 2024 18:11:53.252 [130009897380664] Debug β€” [Req#10330/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Sep 04, 2024 18:11:53.253 [130009897380664] Debug β€” [Req#10330/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (Alder Lake-P GT1 [UHD Graphics])
Sep 04, 2024 18:11:53.253 [130009897380664] Error β€” [Req#10330/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).

Sep 04, 2024 18:11:53.253 [130009897380664] Debug β€” [Req#10330/Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Sep 04, 2024 18:11:53.253 [130009897380664] Debug β€” [Req#10330/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (Alder Lake-P GT1 [UHD Graphics])
Sep 04, 2024 18:11:53.253 [130009897380664] Error β€” [Req#10330/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).

I’m a bit stumped now. Any thoughts to what I might be missing?

Edit: uploaded log files
Plex Media Server Logs_2024-09-04_18-32-55.zip (865.8 KB)