HDR -> SDR Tone Mapping on Ubuntu 22.04 LTS

So I am a bit bleeding edge here, I know. I’m on Ubuntu Server 22.04 which apparently does not support quicksync HDR → SDR tone mapping in Plex (yet). I’m running a newer Alder-Lake processor (i5-12400) and really don’t want to go to 20.04 due to a multitude of reasons (Alder-Lake isn’t even 100% yet in 22.04 with newer kernel features being backported to the LTS kernel).

Normal hardware transcoding is working great, but I can’t get HDR → SDR tone mapping to work. I believe I read somewhere that this was not yet supported.

Since this is a LTS release, I assume support will be coming soon?

Something that I’d like to point out is, at least by default, 22.04 doesn’t have the ‘beignet-opencl-icd’ package. Apparently ‘intel-opencl-icd’ is the replacement? I have installed ‘ocl-icd-libopencl1’ and ‘intel-opencl-icd’ and the software transcoder is being used for H.265 tone mapping.

HDR → SDR tone mapping does work in 22.04.

The specifics are that all KabyLake and above CPUs must use Intel Compute Runtime 21.49.

For your machine, all CPUs CometLake or higher have always needed ICR.

I am working on the updated packaging which will be OS Distro, Release Version, and CPU sensitive . It will know what to have installed.

I have a developer’s package for 1.26.1.5772 available.

It’s the same 1.26.1.5772 except that it has my new packaging code with it.

It looks at the CPU, OS, and Version as part of the “Verification” process (preinstall).

It will report if you don’t have the proper versions installed. It does not report what you do have (yet / maybe not ever – not yet decided if I can do that well).

It gives you specific links to the binaries you need for Intel Compute Runtime (your AlderLake).

As you install them, do not be surprised if Ubuntu cautions about downgrading those modules. (Ubuntu 22.04 does include a higher version of GMMLIB than expected).

If you use this, please share the console output from the installation (so I can see what it printed) as well as /tmp/plexinstaller.log

Installed. I have not downloaded any of the listed packages yet. Here is the output you requested after running : dpkg -i plexmediaserver_1.26.1.5772-872b93b91_amd64.deb

(Reading database … 86338 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.26.1.5772-872b93b91_amd64.deb …
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.26.1.5772-872b93b91) over (1.26.0.5715-8cf78dab3) …
Setting up plexmediaserver (1.26.1.5772-872b93b91) …
PlexMediaServer install: PlexMediaServer-1.26.1.5772-872b93b91 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: Update
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: render
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /dev/shm (set in Preferences.xml)
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Intel i915 Hardware: Found
PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: OpenCL: Installed
PlexMediaServer install: Intel Gmmlib: Not Installed
PlexMediaServer install: Intel IGC Core: Not Installed
PlexMediaServer install: Intel IGC OpenCL: Not Installed
PlexMediaServer install: Intel OpenCL: Not Installed
PlexMediaServer install:
PlexMediaServer install: WARNING: The Intel GMM library, required for Intel Compute Runtime support, is missing.
PlexMediaServer install: Please install package: ‘intel-gmmlib’ from https://github.com/intel/compute-runtime/releases/download/21.49.21786/intel-gmmlib_21.3.3_amd64.deb
PlexMediaServer install:
PlexMediaServer install: WARNING: The Intel IGC Core, required for Intel Compute Runtime support, is missing.
PlexMediaServer install: Please install package: ‘intel-igc-core’ from https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9441/intel-igc-core_1.0.9441_amd64.deb
PlexMediaServer install:
PlexMediaServer install: WARNING: The Intel IGC OpenCL library, required for Intel Compute Runtime support, is missing.
PlexMediaServer install: Please install package: ‘intel-igc-opencl’ from https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9441/intel-igc-opencl_1.0.9441_amd64.deb
PlexMediaServer install:
PlexMediaServer install: WARNING: The Intel OpenCL library, required for Intel Compute Runtime support, is missing.
PlexMediaServer install: Please install package: ‘intel-opencl’ from https://github.com/intel/compute-runtime/releases/download/21.49.21786/intel-opencl-icd_21.49.21786_amd64.deb
PlexMediaServer install: Intel Compute Runtime packages are available from: Releases · intel/compute-runtime · GitHub
PlexMediaServer install: Please be certain to install them in the listed order.
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: PlexMediaServer-1.26.1.5772-872b93b91 - Installation successful. Errors: 0, Warnings: 4

And here is the installer log file you requested:

# Plex Media Server installation configuration info: Mon May 9 03:26:24 PM CDT 2022
Init=0
Systemd=1
Custom=0
LinuxContainer=0
NewInstall=0
HaveOverride=0
OverrideFile=“”
PlexUser=“plex”
PlexGroup=“plex”
VideoGroup=“render”
AppSuppDir=“/var/lib/plexmediaserver/Library/Application Support”
PlexTempDir=“/dev/shm”
LangEncoding=“en_US.UTF-8”
ExistingVersion=12600
HaveHardware=1
HaveTranscoderPref=1
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
Running=0
Errors=0
Warnings=0
HaveIntel=1
HaveIntelCore=1
HaveIntelXeon=0
Havei915=1
HaveNvidia=0
Processor=12th Gen Intel(R) Core™ i5-12400
CPUSKU=12400
NeedOpenCL=1
NeedBeignet=0
NeedIntelCompute=1
HaveIntelGmmlib=0
HaveIntelIGCCore=0
HaveIntelIGCOpenCL=0
HaveIntelOpenCL=0
HaveIntelCompute=0
HaveBeignet=0
HaveOpenCL=1
Platform=“Z690 PG Riptide”
Processor=“12th Gen Intel(R) Core™ i5-12400”
Distro=“Ubuntu 22.04 LTS”
Kernel=“Linux wd40 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux”
Memory=“31859 495 29370”

I have installed the listed packages and I do have hardware transcoded HDR → SDR, but the output is all blocky with green blocks and all garbled.

When I query apt, I see if wants to over-ride my intel-opencl-icd:

intel-opencl-icd/jammy 22.14.22890-1 amd64 [upgradable from: 21.49.21786]

I re-installed the same version of plex just to check output:

(Reading database … 86356 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.26.1.5772-872b93b91_amd64.deb …
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.26.1.5772-872b93b91) over (1.26.1.5772-872b93b91) …
Setting up plexmediaserver (1.26.1.5772-872b93b91) …
PlexMediaServer install: PlexMediaServer-1.26.1.5772-872b93b91 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: Update
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: render
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /dev/shm (set in Preferences.xml)
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Intel i915 Hardware: Found
PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: OpenCL: Installed
PlexMediaServer install: Intel Gmmlib: Installed
PlexMediaServer install: Intel IGC Core: Installed
PlexMediaServer install: Intel IGC OpenCL: Installed
PlexMediaServer install: Intel OpenCL: Installed
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.26.1.5772-872b93b91 - Installation successful. Errors: 0, Warnings: 0

And here is the tmp log:

# Plex Media Server installation configuration info: Mon May 9 03:46:36 PM CDT 2022
Init=0
Systemd=1
Custom=0
LinuxContainer=0
NewInstall=0
HaveOverride=0
OverrideFile=“”
PlexUser=“plex”
PlexGroup=“plex”
VideoGroup=“render”
AppSuppDir=“/var/lib/plexmediaserver/Library/Application Support”
PlexTempDir=“/dev/shm”
LangEncoding=“en_US.UTF-8”
ExistingVersion=12601
HaveHardware=1
HaveTranscoderPref=1
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
Running=1
Errors=0
Warnings=0
HaveIntel=1
HaveIntelCore=1
HaveIntelXeon=0
Havei915=1
HaveNvidia=0
Processor=12th Gen Intel(R) Core™ i5-12400
CPUSKU=12400
NeedOpenCL=1
NeedBeignet=0
NeedIntelCompute=1
HaveIntelGmmlib=1
HaveIntelIGCCore=1
HaveIntelIGCOpenCL=1
HaveIntelOpenCL=1
HaveIntelCompute=1
HaveBeignet=0
HaveOpenCL=1
Platform=“Z690 PG Riptide”
Processor=“12th Gen Intel(R) Core™ i5-12400”
Distro=“Ubuntu 22.04 LTS”
Kernel=“Linux wd40 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux”
Memory=“31859 498 29033”

Upgrading intel-opencl-icd to the newer version makes HDR → SDR not work again in hardware (as likely expected).

That being said, I didn’t revert back to the older version, as the processor is powerful enough to handle a single transcode in software (barely). Doing that and obtaining a correct image is better than using hardware and getting a garbled output.

It’s hard to explain, but for the garbled image, the video blocks appear all out of order and shifted, as well as some being green.

Happy to try anything else here. Actually seeing it say it was using hardware transcoding is certainly a step in the right direction for me.

Thanks for the feedback.
As you can see here, This should be NeedOpenCL=0 because it’s KabyLake and above on Ubuntu 22.04.

That will throw off the rest of the logic. I’ll work on that now.

I am confused on this reply. Doesn’t ICR include OpenCL?

By the way, I posted this in another thread, but this is how the video output looks when hardware tone mapping is being used. Software tone mapping produces a correct image (but takes all my CPU)

There are two. ocl-icd-libopencl1 and intel-opencl-icd

ocl-icd-libopencl1 is pre-Intel Compute Runtime and works with pre-CometLake CPUs in combination with beignet-opencl-icd

intel-opencl-icd is for use with Intel Compute Runtime.
It is required for all CometLake and above CPUs
As of Ubuntu 22.04, it is required for all Intel QSV-capable CPUs.

PMS expects Intel Compute Runtime version 21.49.21786, with all its support modules, to be installed for use with CometLake+ (Ubuntu 20.04) and all Intel QSV-capable CPUs (Ubuntu 21.04+)

Ubuntu 22.04 ships a newer version of Intel-gmmlib than 21.49.21786.
Care must be taken to apt-mark the package to prevent the file being overwritten again at the next update after downgrading it to 21.49.21786

This is easiest to verify by installing the 21.49.21786 files and verifying which are ‘downgraded’ .

I am working on getting the new package updates completed

If all continues to go as expected, the new installer will correctly detect the environment and versions then tell you which specific files to install or upgrade or downgrade if needed.

Ah, thanks for the detailed reply.

I went ahead and reverted my plex install to my previous hardware to keep my new rig open for testing and am keeping it in a state that should work with hardware tone mapping.

I went ahead and did a ‘apt-mark hold intel-opencl-icd’ and double checked my installed packages

root@wd40:/home/redshirt/plex-intel-pkgs# dpkg -i *
(Reading database … 116014 files and directories currently installed.)
Preparing to unpack intel-gmmlib_21.3.3_amd64.deb …
Unpacking intel-gmmlib (21.3.3) over (21.3.3) …
Preparing to unpack intel-igc-core_1.0.9441_amd64.deb …
Unpacking intel-igc-core (1.0.9441) over (1.0.9441) …
Preparing to unpack intel-igc-opencl_1.0.9441_amd64.deb …
Unpacking intel-igc-opencl (1.0.9441) over (1.0.9441) …
Preparing to unpack intel-opencl-icd_21.49.21786_amd64.deb …
Unpacking intel-opencl-icd (21.49.21786) over (21.49.21786) …
Setting up intel-gmmlib (21.3.3) …
Setting up intel-igc-core (1.0.9441) …
Setting up intel-igc-opencl (1.0.9441) …
Setting up intel-opencl-icd (21.49.21786) …
Processing triggers for libc-bin (2.35-0ubuntu3) …
root@wd40:/home/redshirt/plex-intel-pkgs#

Should I not be getting the garbled output as shown in my previous post? The ultimate question really is ‘Are there people with Alder Lake on Ubuntu 22.04 with these Intel packages installed where hardware HDR tone mapping is working correctly?’

There is limited success with AlderLake at this time in the 5.17 kernels.

The primary issue is the not-yet-mature CPU support in the kernel.

The 5.18 kernel is expected to have the required support.

On this CPU, it’s very much a ‘bleeding edge’ problem.

Ok. I am OK with this (I realized I was bleeding edge when I bought it).

I’m just wanting to be sure that what I am observing aligns with what other people see vs a unique issue that my hardware is experiencing. Since this is literally a brand new rig and I have nothing to compare to, just want to make sure my current experience is ‘expected’ with the current state of things.

Thanks for your help here.

i am also having issues with HDR->SDR tonemapping and just hardware acceleration for transcoding in general on 22.04 with a coffee lake GPU. could thi be related?

PlexMediaServer install: PlexMediaServer-1.27.0.5889-6a2ff9c39 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: Update
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: render
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /mnt/Joker/ (set in Preferences.xml)
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Intel i915 Hardware: Found
PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: OpenCL: Installed
PlexMediaServer install: Beignet: Not Installed
PlexMediaServer install:
PlexMediaServer install: WARNING: The Beignet-OpenCL library, required for hardware transcoding of HDR content, is missing.
PlexMediaServer install: Please install package: ‘beignet-opencl-icd’
PlexMediaServer install:
PlexMediaServer install: INFO: dpkg will install package ‘beignet-opencl-icd’ automatically
PlexMediaServer install: if available for your host upon successful installation of Plex Media Server.
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.27.0.5889-6a2ff9c39 - Installation successful. Errors: 0, Warnings: 1
Processing triggers for mailcap (3.70+nmu1ubuntu1) …
Processing triggers for gnome-menus (3.36.0-1ubuntu3) …
Processing triggers for desktop-file-utils (0.26-1ubuntu3) …

from what i know “beignet-opencl-icd” is not avaible in 22.04

Intel removed “Beignet” from Ubuntu 22.04

Now, all tone mapping must be performed using Intel Compute Runtime’s OpenCL method.

I have the preview thread here.

This work has been submitted to QA for Engineering release to public.

1 Like

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