Hardware transcoding not working on AMD/Docker

Server Version#: 1.32.7.7484 (TrueNAS App → Docker image)
Player Version#: iOS 8.25

I have a TrueNAS server, running Plex via the TrueNAS-provided “app”, which is a wrapper around the Plex Docker image at Docker

I have integrated AMD graphics, configured to pass through into the container, correctly detected by the server:

Sep 15, 2023 09:47:24.862 [140540243983160] DEBUG - [GPU] Got device: Cezanne [Radeon Vega Series / Radeon Vega Mobile Series], amd@unknown, default true, best true, ID 1002:1638:1002:1636@0000:30:00.0, DevID [1002:1638:1002:1636], flags 0x30065
Sep 15, 2023 09:47:24.862 [140540243983160] INFO - Preemptively preparing driver rsv for GPU Cezanne [Radeon Vega Series / Radeon Vega Mobile Series]
Sep 15, 2023 09:47:24.862 [140540243983160] DEBUG - [DriverDL/rsv] Skipping download; already exists

However, when it comes to actually using it, VAAPI fails to initialize, due to a symbols issue in the Plex-downloaded radeonsi_drv_video.so:

Sep 15, 2023 11:49:36.451 [140540127030072] DEBUG - [Req#d1d/Transcode] Codecs: testing h264_vaapi (encoder)
Sep 15, 2023 11:49:36.454 [140540127030072] DEBUG - [Req#d1d/Transcode] Codecs: hardware transcoding: testing API vaapi for device '/dev/dri/renderD128' (Cezanne [Radeon Vega Series / Radeon Vega Mobile Series])
Sep 15, 2023 11:49:36.458 [140540127030072] ERROR - [Req#d1d/Transcode] [FFMPEG] - libva: dlopen of /config/Library/Application Support/Plex Media Server/Cache/va-dri-linux-x86_64/radeonsi_drv_video.so failed: Error relocating /config/Library/Application Support/Plex Media Server/Cache/va-dri-linux-x86_64/radeonsi_drv_video.so: _ZTTNSt3__219basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE: symbol not found
Sep 15, 2023 11:49:36.458 [140540127030072] ERROR - [Req#d1d/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Sep 15, 2023 11:49:36.458 [140540127030072] DEBUG - [Req#d1d/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Sep 15, 2023 11:49:36.458 [140540127030072] DEBUG - [Req#d1d/Transcode] Could not create hardware context for h264_vaapi

This matches up with my own experiments - I don’t see any symbol resembling std::__1::basic_istringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > exported by the libc++.so.2 bundled with Plex (which I assume is some version of LLVM libc++):

$ readelf -Ws --dyn-syms libc++.so.2 | grep istringstream
$

Whereas an appropriate symbol is found on my local desktop’s libc++.so.1:

$ readelf -Ws --dyn-syms /usr/lib/x86_64-linux-gnu/libc++.so.1 | grep istringstream
   632: 00000000000ceabf    70 OBJECT  WEAK   DEFAULT   15 _ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
  1162: 00000000000effa8    24 OBJECT  WEAK   DEFAULT   21 _ZTINSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
  1334: 00000000000efee8    80 OBJECT  WEAK   DEFAULT   21 _ZTVNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
  1611: 00000000000eff58    80 OBJECT  WEAK   DEFAULT   21 _ZTCNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
  1933: 00000000000eff38    32 OBJECT  WEAK   DEFAULT   21 _ZTTNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
  1981: 0000000000068e90   150 FUNC    WEAK   DEFAULT   13 _ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_

There’s no .comment section in the radeonsi_drv_video.so binary, but with a cursory examination, it seems to have been built with a radically different version of Clang to libc++ or Plex itself (both of which say Clang 11.0.1)? Perhaps some flavour of 16.0.1, linked against libc++ 16.0.1, but shipped against 11.0.1?

I don’t think it’s a tone mapping problem, it’s not HDR content specific

HW transcoding is also affected.

Plex pulled 1.32.6 & 1.32.7 from distribution.

Suggest you roll back.

Monitor the thread linked above for updates. Scroll to the bottom, change Normal to Watching, to be notified of new posts.

It looks like an updated driver was pushed out around a week ago, the new radeonsi_drv_video.so is no longer looking for symbols not found in libc++ 11, and HW transcoding is functional.

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