Ubuntu 22.04 Packaging - development & preview

@Haderak

From that log:

Processor=12th Gen Intel(R) Core(TM) i9-12900K
CPUSKU=12900
NeedOpenCL=0
NeedBeignet=0
NeedIntelCompute=1
HaveIntelGmmlib=1
HaveIntelIGCCore=1
HaveIntelIGCOpenCL=1
HaveIntelOpenCL=0
HaveIntelCompute=0
HaveBeignet=0
HaveOpenCL=1
VersionIntelGmmlib="21.3.3"
VersionIntelIGCCore="1.0.9441"
VersionIntelIGCOpenCL="1.0.9441"
VersionIntelOpenCL="Not Installed"

This is telling me,

  1. Ubuntu 22.04
  2. i9-12900 CPU
  3. Need Intel Compute
  4. Have 3 of the 4 required packages
  5. Package intel-opencl is still missing (from ICR release 21.49.21786)
  6. You do have the older OpenCL (ocl-icd-libopencl1) package installed

Does this match ?

It also told you which package to install and gave you the direct link to that download.

@claymen

The contents of plexinstaller.log are what it shows you in the report here.

  1. Preinstall knows which versions of the individual packages are needed
  2. Preinstall queries your system to get which package is installed.

What it’s clearly showing is you have major release 22.14 of ICR when 21.49 is what’s needed.

It matches except that Intel Compute and intel-opencl are installed.

tom@Media:~$ sudo apt list --installed | grep intel

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

intel-gmmlib/now 21.3.3 amd64 [installed,local]
intel-gpu-tools/jammy,now 1.26-2 amd64 [installed]
intel-igc-core/now 1.0.9441 amd64 [installed,local]
intel-igc-opencl/now 1.0.9441 amd64 [installed,local]
intel-level-zero-gpu/now 1.2.21786 amd64 [installed,local]
intel-media-va-driver-non-free/jammy,now 22.3.1+ds1-1 amd64 [installed]
intel-microcode/jammy,now 3.20210608.2ubuntu1 amd64 [installed,automatic]
intel-opencl-icd/now 21.49.21786 amd64 [installed,upgradable to: 22.14.22890-1]
libdrm-intel1/jammy,now 2.4.110-1ubuntu1 amd64 [installed,automatic]
xserver-xorg-video-intel/jammy,now 2:2.99.917+git20210115-1 amd64 [installed,automatic]

tom@Media:~$ sudo apt list --installed | grep libig

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libigdgmm12/jammy,now 22.1.2+ds1-1 amd64 [installed,automatic]
tom@Media:~$

Also that was from the test script, not the installer. I skipped the installer since I am in a later version then what you packaged and don’t want to revert right now.

@Haderak

Not quite… You have the ICD (which is not needed)

From the code:

    # ICR Packages (currently external version 21.49.21786)
    VersionIntelGmmlib="$(GetVersion intel-gmmlib)"        ; [ "$VersionIntelGmmlib"    = "$RequiredIntelGmmlib" ]    && HaveIntelGmmlib=1
    VersionIntelIGCCore="$(GetVersion intel-igc-core)"     ; [ "$VersionIntelIGCCore"   = "$RequiredIntelIGCCore" ]   && HaveIntelIGCCore=1
    VersionIntelIGCOpenCL="$(GetVersion intel-igc-opencl)" ; [ "$VersionIntelIGCOpenCL" = "$RequiredIntelIGCOpenCL" ] && HaveIntelIGCOpenCL=1
    VersionIntelOpenCL="$(GetVersion intel-opencl)"        ; [ "$VersionIntelOpenCL"    = "$RequiredIntelOpenCL" ]    && HaveIntelOpenCL=1

Intel has made a huge mess of this.

Might need some tweaking here to be more precise but my qpkg query has been ok in all my testing.

If you look at

GetVersion() {

  local Version

  Version="$(dpkg -l | grep ^ii | grep $1 | awk '{print $3}' | sed -e 's/-.*//')"
  [ "$Version" = "" ] && Version="Not Installed"
  echo "$Version"
}

My query does need refinement to be 100% exact but works as it currently is.

[chuck@lizum neo.2013]$ dpkg -l | grep intel-opencl
ii  intel-opencl-icd                                            21.49.21786                         amd64        Intel graphics compute runtime for OpenCL
[chuck@lizum neo.2014]$ GetVersion() {
> 
>   local Version
> 
>   Version="$(dpkg -l | grep ^ii | grep $1 | awk '{print $3}' | sed -e 's/-.*//')"
>   [ "$Version" = "" ] && Version="Not Installed"
>   echo "$Version"
> }
[chuck@lizum neo.2015]$ GetVersion intel-opencl
21.49.21786
[chuck@lizum neo.2016]$
[chuck@lizum neo.2013]$ dpkg -l | grep intel-opencl
ii  intel-opencl-icd                                            21.49.21786                         amd64        Intel graphics compute runtime for OpenCL
[chuck@lizum neo.2014]$

Is your package showing ii status or rc status ?

Well following their release page is useless then, as I installed the packages from here:

So I went through the entire process from start to finish.

Here are the results of the install.

dpkg: warning: downgrading plexmediaserver from 1.26.2.5797-5bd057d2b to 1.26.1.5772-872b93b91
(Reading database ... 215318 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.2.5797-5bd057d2b) ...
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:      /tmp
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:        Need: 21.49.21786, Have: Not Installed
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:  https://github.com/intel/compute-runtime/releases
PlexMediaServer install: Please be certain to install them in the listed order.
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: 2
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) ...

Verifying my intel-opencl

sudo apt list --installed | grep intel-opencl

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

intel-opencl-icd/now 21.49.21786 amd64 [installed,upgradable to: 22.14.22890-1]

Download from the link in your installer, which is the same link in the release, which does have ICD in the package name.

tom@Media:~$ wget https://github.com/intel/compute-runtime/releases/download/21.49.21786/intel-opencl-icd_21.49.21786_amd64.deb
--2022-05-24 17:07:42--  https://github.com/intel/compute-runtime/releases/download/21.49.21786/intel-opencl-icd_21.49.21786_amd64.deb
Resolving github.com (github.com)... 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/105299354/0512fcd5-686e-430a-b32a-fa359896d32a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220524T220742Z&X-Amz-Expires=300&X-Amz-Signature=6e9bc765a81d7290efaef331143120ceced9bb3c3d0bcd03b0702423f9a25975&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=105299354&response-content-disposition=attachment%3B%20filename%3Dintel-opencl-icd_21.49.21786_amd64.deb&response-content-type=application%2Foctet-stream [following]
--2022-05-24 17:07:42--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/105299354/0512fcd5-686e-430a-b32a-fa359896d32a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220524%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220524T220742Z&X-Amz-Expires=300&X-Amz-Signature=6e9bc765a81d7290efaef331143120ceced9bb3c3d0bcd03b0702423f9a25975&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=105299354&response-content-disposition=attachment%3B%20filename%3Dintel-opencl-icd_21.49.21786_amd64.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1489972 (1.4M) [application/octet-stream]
Saving to: ‘intel-opencl-icd_21.49.21786_amd64.deb’

intel-opencl-icd_21.49.21786_amd64.deb     100%[========================================================================================>]   1.42M  --.-KB/s    in 0.1s

2022-05-24 17:07:42 (13.3 MB/s) - ‘intel-opencl-icd_21.49.21786_amd64.deb’ saved [1489972/1489972]

Install the intel-opencl package

tom@Media:~$ sudo chmod 555 intel-opencl-icd_21.49.21786_amd64.deb
tom@Media:~$ sudo dpkg -i intel-opencl-icd_21.49.21786_amd64.deb
(Reading database ... 215211 files and directories currently installed.)
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-opencl-icd (21.49.21786) ...
tom@Media:~$ sudo apt list --installed | grep intel-opencl

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

intel-opencl-icd/now 21.49.21786 amd64 [installed,upgradable to: 22.14.22890-1]

You can see from the install, that I already had it installed, and it just reinstalled it. I reran your installer and it detected it this time and said everything was fine.

I compared the installed packages from before to now, and they are the same. But the installer gave two different results.

So to double check, I just ran the installer a third time and now get.

PlexMediaServer install:   OpenCL:              Installed
PlexMediaServer install:   Intel Gmmlib:        Need: 21.3.3, Have: Not Installed
PlexMediaServer install:   Intel IGC Core:      Need: 1.0.9441, Have: Not Installed
PlexMediaServer install:   Intel IGC OpenCL:    Need: 1.0.9441, Have: Not Installed
PlexMediaServer install:   Intel OpenCL:        Need: 21.49.21786, Have: Not Installed

So fun stuff.

I am just going to remove all the intel packages and reinstall them and try again, even though apt says they are installed and the correct versions.

Reinstall them with DPKG and not APT please

dpkg -l | grep <name>

So back to where I was.

I uninstalled the intel packages.

I downloaded them all and installed them with a ‘sudo dpkg -i *’ command from the folder they downloaded to.

Reinstalled your test Plex, and ended back where I was, which is:

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:        Need: 21.49.21786, Have: Not Installed

Could it be that your parsing has an error with me having that package held?

Yeah that is it.

I just removed the apt hold on the package, reran your installer and it detected it.

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

So it is failing to handle this

intel-opencl-icd/now 21.49.21786 amd64 [installed,upgradable to: 22.14.22890-1]

Probably because there are no spaces between the installed,upgradable in how it is listed.

Bingo… Thank you. GOOD catch!

[chuck@lizum neo.2021]$ dpkg -l | grep intel-igc-opencl
hi  intel-igc-opencl                                            1.0.9441                            amd64        Intel(R) Graphics Compiler for OpenCL(TM)
[chuck@lizum neo.2022]$ 

I’ll fix that right now

For your reference, here is what the packages look like from dpkg view instead of apt view.

tom@Media:~$ dpkg -l | grep intel
hi  intel-gmmlib                               21.3.3                                  amd64        Intel(R) Graphics Memory Management Library Package
ii  intel-gpu-tools                            1.26-2                                  amd64        tools for debugging the Intel graphics driver
hi  intel-igc-core                             1.0.9441                                amd64        Intel(R) Graphics Compiler for OpenCL(TM)
hi  intel-igc-opencl                           1.0.9441                                amd64        Intel(R) Graphics Compiler for OpenCL(TM)
ii  intel-level-zero-gpu                       1.2.21786                               amd64        Intel(R) Graphics Compute Runtime for oneAPI Level Zero.
ii  intel-media-va-driver-non-free:amd64       22.3.1+ds1-1                            amd64        VAAPI driver for the Intel GEN8+ Graphics family
ii  intel-microcode                            3.20210608.2ubuntu1                     amd64        Processor microcode firmware for Intel CPUs
hi  intel-opencl-icd                           21.49.21786                             amd64        Intel graphics compute runtime for OpenCL
ii  libdrm-intel1:amd64                        2.4.110-1ubuntu1                        amd64        Userspace interface to intel-specific kernel DRM services -- runtime
ii  xserver-xorg-video-intel                   2:2.99.917+git20210115-1                amd64        X.Org X server -- Intel i8xx, i9xx display driver

So based on you query, I think you simply need to add it to also include hi in the check.

@Haderak

Yes, I added grep -E '^hi|^ii' instead of the usual grep.

I’ve also cleaned up the intel-opencl in favor of intel-opencl-icd in search and reporting text.

Updated package now available in post #1

Looks good. Here are the results.

PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.26.1.5772-872b93b91) over (1.26.2.5797-5bd057d2b) ...
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:      /tmp
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 ICD:    Installed
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: INFO: Please be advised, Intel Compute Runtime packages for version 21.49.21786 have been marked with 'hold' status.
PlexMediaServer install:       This will preserve PMS operation by preventing normal 'apt' updates from overwriting them.
PlexMediaServer install:       PMS will automatically manage (un)hold status for you.   To manage manually,  see 'man apt-mark'.
PlexMediaServer install: PlexMediaServer-1.26.1.5772-872b93b91 - Installation successful.  Errors: 0, Warnings: 0

now that looks like a package :muscle: LOL

Thank you for taking the time to help.

ALL:

The package file to be (re)tested is posted in post #1 , with ‘fix’ notes included.

From another thread; can I suggest using dpkg-query:

GetVersion() {
  local Version
  Version="$(dpkg-query -f '${Version}\n' -W "$1" 2>/dev/null)"
  [ "$Version" = "" ] && Version="Not Installed"
  echo "$Version"
}

to get the currently-installed version of a specific package rather than relying on parsing the output of dpkg -l - this is a bit more robust and removes the need for egrepping for hi|ii etc.

Otherwise, I’m very happy to see the direction this thread has taken - it’ll resolve some long-running issues I’ve had with managing the Intel IGC packages on PMS systems.

@colmbuckley

Can you confirm qpkg-query runs without lock (like qpkg -l does) safely while dpkg itself has the lock asserted?

Yes, this looks good - checked a few different things:

  • running dpkg-query while an install is happening in another shell (works fine)
  • examining the output of strace dpkg-query for the dpkg lock files; it does not attempt to access or lock them

So I think this is a safe replacement for the dpkg -l | grep structure.

Using your GetVersion without modification yields:

[chuck@glockner ~.2007]$ GetVersion libnvidia-common-510-server
510.73.05-0ubuntu0.20.04.1
[chuck@glockner ~.2008]$ 

Trimming the distro build tagging string yields the pure version

[chuck@glockner ~.2009]$ GetVersion() {
>   local Version
>   Version="$(dpkg-query -f '${Version}\n' -W "$1" 2>/dev/null | sed -e 's/-.*//')"
>   [ "$Version" = "" ] && Version="Not Installed"
>   echo "$Version" 
> }
[chuck@glockner ~.2010]$ GetVersion libnvidia-common-510-server
510.73.05
[chuck@glockner ~.2011]$ 

This is what I need returned (distro-agnostic)

That still sufficiently robust ?

This can be done directly in dpkg-query:

GetVersion() {
  local Version
  Version="$(dpkg-query -f '${source:Upstream-Version}\n' -W "$1" 2>/dev/null)"
  [ "$Version" = "" ] && Version="Not Installed"
  echo "$Version"
}

The “Upstream Version” is the basic version of the package from which the Debian/Ubuntu installable is created; it should contain the info you need. Can you try that on all the packages you care about to make sure it’s returning the right thing?

In general, it’s important to be somewhat careful with Debian/Ubuntu version strings - they have a very specific format and are carefully constructed to follow certain rules. See the man page for deb-version (in the dpkg-dev package) and/or the relevant section of the Debian Policy Manual.

Hope this is helpful!

As you point out, use of dpkg -l , for as low-level as it is, is common to both and yields a result I can work with where you’ve pointed out variations between Ubuntu and Debian.

Given the differences between Ubuntu & Debian, now I must be Devil’s Advocate and ask – What about all the variations from the other DEB-based distros?

What’s the lowest common denominator ?