Drivers downloaded for amdgpu missing libzstd.so

Server Version#: 1.32.6.7468
Player Version#: 4.108.0

Sep 11, 2023 21:31:46.262 [140065406950200] ERROR - [Req#72e/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Sep 11, 2023 21:31:46.295 [140065406950200] ERROR - [Req#72e/Transcode] [FFMPEG] - libva: dlopen of /data/plex/Library/Caches/PlexMediaServer/va-dri-linux-x86_64/radeonsi_drv_video.so failed: Error loading shared library libzstd.so.1: No such file or directory (needed by /data/plex/Library/Caches/PlexMediaServer/va-dri-linux-x86_64/radeonsi_drv_video.so)

As seen above, radeonsi_drv_video.so (downloaded by the server from some mysterious source and not packaged, which I find absolutely unacceptable, but I digress) needs libzstd.so.1, which is not provided by either the download or the libraries from the distribution (using .deb).

And why did Plex switch to musl libc, for crying out loud? Are you actively trying to prevent users from fixing your mess ourselves? FYI AMD has been making graphics cards for quite a while, nor is Linux some weird esoteric platform…

Which distro is this?

FYI. This is the first I’ve seen this message from anyone.

Are you trying to use HDR tone mapping on the AMD?

I need more than 2 lines of information to go on

It is Gentoo, but that hardly matters as Plex carries its own operating system^W^W libraries :slight_smile:
It is spat out to log whenever transcoding using amdgpu is attempted, in my case Radeon RX 7600S, I can’t try HDR tonemapping when the support is just broken, just getting any transcoding would be a good start :slight_smile: I see no point in any logs because:

Looking at rsv-21-linux-x86_64/dri/radeonsi_drv_video.so:

ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2’s complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x0
Start of program headers: 64 (bytes into file)
Start of section headers: 49510272 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 11
Size of section headers: 64 (bytes)
Number of section headers: 25
Section header string table index: 24

Dynamic section at offset 0x2f330e0 contains 29 entries:
Tag Type Name/Value
0x000000000000001d (RUNPATH) Library runpath: [/data/jenkins/plex-toolchain/unpacked/15.0.7+440e7d8cc/bin/…/targets/x86_64-plex-linux-musl/lib:/data/jenkins/ple
x-toolchain/unpacked/15.0.7+440e7d8cc/bin/…/lib/x86_64-plex-linux-musl:/data/jenkins/conan_build/1113001575/conan/.conan/data/libpciaccess/0.17-1/plex/stable/package/001da6
61858003f22240ef7b423977aac7ce25c4/lib:/data/jenkins/conan_build/1113001575/conan/.conan/data/libdrm/2.4.115-2/plex/stable/package/90adcf42a54aebf84fb235c693b42cab740f3898/l
ib:/data/jenkins/conan_build/1113001575/conan/.conan/data/libva/2.18.0-2/plex/stable/package/071d839c1de305486215d5ef90e1e88554957f82/lib:/data/jenkins/conan_build/111300157
5/conan/.conan/data/libpthread-stubs/0.4-35/plex/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/lib:/data/jenkins/conan_build/1113001575/conan/.conan/data/zlib/1.2.
11-32/plex/stable/package/3657df0fb8418322c0d0e70c61c2a8e673a57092/lib:/data/jenkins/conan_build/1113001575/conan/.conan/data/expat/2.2.5-35/plex/stable/package/3657df0fb841
8322c0d0e70c61c2a8e673a57092/lib:/data/jenkins/conan_build/1113001575/conan/.conan/data/libelf/git-8d54602-1/plex/stable/package/b7e036f5eb2dd71f13ff592aad15275dcb57dc56/lib
]
0x0000000000000001 (NEEDED) Shared library: [libgcompat.so.0]
0x0000000000000001 (NEEDED) Shared library: [libdrm.so.2]
0x0000000000000001 (NEEDED) Shared library: [libzstd.so.1]
0x0000000000000001 (NEEDED) Shared library: [libdrm_radeon.so.1]
0x0000000000000001 (NEEDED) Shared library: [libdrm_amdgpu.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc++.so.2]
0x0000000000000001 (NEEDED) Shared library: [libc.so]
0x000000000000000e (SONAME) Library soname: [libgallium_drv_video.so]
0x0000000000000007 (RELA) 0x7c00
0x0000000000000008 (RELASZ) 2805408 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffff9 (RELACOUNT) 114362
0x0000000000000017 (JMPREL) 0x2b4aa0
0x0000000000000002 (PLTRELSZ) 9720 (bytes)
0x0000000000000003 (PLTGOT) 0x2f399e0
0x0000000000000014 (PLTREL) RELA
0x0000000000000006 (SYMTAB) 0x2d0
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000005 (STRTAB) 0x2e4c
0x000000000000000a (STRSZ) 19892 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x2e20
0x0000000000000019 (INIT_ARRAY) 0x2d065a0
0x000000000000001b (INIT_ARRAYSZ) 2592 (bytes)
0x000000000000001a (FINI_ARRAY) 0x2d06fc0
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000000000000c (INIT) 0x155e894
0x000000000000000d (FINI) 0x155e897
0x0000000000000000 (NULL) 0x0

While some libraries seem to be in place in /usr/lib/plexmediaserver/lib, libzstd.so.1 is not, nor can I find it in the .deb package (in case ebuild didn’t install it for some reason), nor is it downloaded on demand along with the radeonsi_drv_video.so file. I imagine it will be asking for libgallium_drv_video.so next (which is also not there) so please package that as well next time.

Sorry for being slightly annoyed - last time I tried HW transcoding with amdgpu I failed but at least I could try (the problem was in my broken IOMMU/motherboard and stuff), now I finally get a non-broken hardware and discover that Plex has crippled it by switching to musl (which most people don’t run, so no copying of current libraries from the OS like we used to be able to do). I have no idea why Plex packages don’t simply depend on ffmpeg/libdrm/whatever from the distribution where support for new hardware or codecs can simply be plugged or patched in but rather make it a blackbox with crippled functionality. If I had to guess then someone strategically decided “let’s make containers because it’s supposed to be cool now”.

Gentoo is not a supported distro.

It’s the one distro folks compile themselves and often don’t enable everything they should or put things in standard locations.

I’m sorry but I can’t support this use case.

If you put PMS on just about ANY other distro, it works out of the box.
(there are a few exceptions)

I don’t want you to support my distro. I want you to support your software.
Those libraries and their dependencies have nothing to do with the distro, except for kernel (so feel free to tell me how my kernel tricked your musl libc into thinking it needs libzstd).

Are you telling me that you don’t see libstd.so as a dependency for rsv-21-linux-x86_64/dri/radeonsi_drv_video.so?

Anyway, either you can use the OS and its libraries and then you are free to claim “we don’t support distro XY” because you don’t test that combination, OR you can decide to carry half the OS and libraries with you, thus decoupling it from OS and making it work the same everywhere (within reason), which is what you did. Because by doing that, you took the responsibility of having that stack working, which you clearly don’t. And even if this case was somehow my (distro’s) fault the simple fact that we had to rely on hacks and cobbled-together docker containers to have an actually working HW transcoding on amdgpu and similiar is still on you.

But I actually have to thank you in a way. I decided to take the time, check one little box in Jellyfin and hardware transcoding works there just fine, HDR and all. What a surprise!

the problem with that, which I fought for but didn’t get.

  1. The NAS boxes have vastly outdated GLIBC and required libraries. I wanted to have GLIBC built and included , along with other libs, just as you suggest. Engineering overruled. I still hold out hope to change that.

  2. Plex’s configuration premise is to provide everything needed and be independent of the host OS (almost like AppImage).

  3. What most don’t realize, while the installed package is tiny, there’s a lot more which gets downloaded on first-run (codecs and GPU drivers are an example).
    Metadata and posters are the obvious big hitters here.

  1. As a very unhappy owner of a QNAP NAS, I understand the point here somewhat, though I doubt using a more lightweight libc has any benefits besides “it’s betterer”
  2. Right, I get that
  3. I actually didn’t even know about the possibility of something getting downloaded until I hit this bug, I even looked up this in docs and was quite surprised that this was possible and desired https://support.plex.tv/articles/203088737-dynamically-updated-server-components/
    In this case, the “driver” download is broken, the radeon driver is linked against libzstd which is not downloaded nor included in the .deb package, so the build environment for those two things is not consistent (I guess the Jenkins build for the Radeon driver has libzstd installed and mesa in that environment wasn’t built --without-zstd). Please pass this along to engineering. It IS broken.
    Or, if you at least want to help me, then get me libzstd.so from your build environment and I will “fix” it myself.