Player Version#: 1.76.2.3951-15712eae
On Fedora (but I don’t think the distro matters), Plex Desktop installed as Flatpak. When playing 4K HDR HEVC files, it is very noticeable that it’s using software decoding because the fans are on full spin. intel_gpu_top
confirms this (the Video engine is not running). The same file can be played with hardware decoding with MPV also installed as Flatpak on the same system (intel_gpu_top
shows that the Video engine is running).
I have tried having hwdec=auto
and vo=gpu
in ~/.var/app/tv.plex.PlexDesktop/data/plex/mpv.conf
, but the debug log shows [MPVEngine/mpv] vd: Could not create device.
Debug log is attached. Although here I’m trying to play a 1080p H.264 file, but it serves the purpose of demonstrating the problem.
Plex.log (199.1 KB)
The errors indicate that it ties to initialize vaapi and fails to do so. Is there a device missing inside the flatpak? FWIW, I use HW acceleration all the time on a Linux box but I use a snap because the box runs Ubuntu.
vo=gpu
will break the layering of the video and UI. We use vo=libmpv
which does allow for video acceleration but allows the app to control the painting of the framebuffer to layer the video and UI together.
It has been granted permission for all devices (device=all
). The only difference in permission between Plex Desktop and MPV is socket=wayland
, but if I enable that for Plex Desktop, it will not start.
I haven’t seen any issues with it yet, but I guess I could remove it and use the default instead.
I just installed snapd
and plex-desktop
for snap, it also did not work. The error in the log looks different though:
Aug 16, 2023 21:58:47.932 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Container reported FPS: 23.976024
Aug 16, 2023 21:58:47.932 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Codec list:
Aug 16, 2023 21:58:47.932 [140611910883072] DEBUG - [MPVEngine/mpv] vd: h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Aug 16, 2023 21:58:47.932 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Opening decoder h264
Aug 16, 2023 21:58:47.934 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec h264-vaapi...
Aug 16, 2023 21:58:47.934 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Could not create device.
Aug 16, 2023 21:58:47.934 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec h264-vaapi-copy...
Aug 16, 2023 21:58:49.383 [140611910883072] DEBUG - [MPVEngine/mpv] vaapi: Initialized VAAPI: version 1.18
Aug 16, 2023 21:58:49.383 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Trying hardware decoding via h264-vaapi-copy.
Aug 16, 2023 21:58:49.384 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Pixel formats supported by decoder: vaapi yuv420p
Aug 16, 2023 21:58:49.384 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Codec profile: High (0x64)
Aug 16, 2023 21:58:49.384 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Requesting pixfmt 'vaapi' from decoder.
Aug 16, 2023 21:58:49.384 [140611910883072] ERROR - [MPVEngine/mpv] ffmpeg/video: h264: No support for codec h264 profile 100.
Aug 16, 2023 21:58:49.384 [140611910883072] ERROR - [MPVEngine/mpv] ffmpeg/video: h264: Failed setup for format vaapi: hwaccel initialisation returned error.
Aug 16, 2023 21:58:49.384 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Pixel formats supported by decoder: yuv420p yuv420p
Aug 16, 2023 21:58:49.384 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Codec profile: High (0x64)
Aug 16, 2023 21:58:49.384 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Requesting pixfmt 'yuv420p' from decoder.
Aug 16, 2023 21:58:49.388 [140611910883072] DEBUG - [MPVEngine/mpv] vd: Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
Aug 16, 2023 21:58:49.388 [140611910883072] DEBUG - [MPVEngine/mpv] vf: User filter list:
Aug 16, 2023 21:58:49.388 [140611910883072] DEBUG - [MPVEngine/mpv] vf: (empty)
Aug 16, 2023 21:58:49.388 [140611910883072] DEBUG - [MPVEngine/mpv] ad: Codec list:
Aug 16, 2023 21:58:49.388 [140611910883072] DEBUG - [MPVEngine/mpv] ad: dca (dts) - DCA (DTS Coherent Acoustics)
Aug 16, 2023 21:58:49.388 [140611910883072] DEBUG - [MPVEngine/mpv] ad: Opening decoder dca
Aug 16, 2023 21:58:49.388 [140611910883072] DEBUG - [MPVEngine/mpv] ad: Requesting 1 threads for decoding.
Aug 16, 2023 21:58:49.389 [140611910883072] DEBUG - [MPVEngine/mpv] ad: Selected codec: dca (DCA (DTS Coherent Acoustics))
Aug 16, 2023 21:58:49.389 [140611910883072] DEBUG - [MPVEngine/mpv] af: User filter list:
Aug 16, 2023 21:58:49.389 [140611910883072] DEBUG - [MPVEngine/mpv] af: (empty)
Aug 16, 2023 21:58:49.389 [140611910883072] DEBUG - [MPVEngine/mpv] cplayer: Starting playback...
So I just installed Ubuntu on another partition on my laptop, installed Snap and Flatpak versions of Plex Desktop, and guess what, hardware acceleration worked on Ubuntu out of the box.
I assumption that distro doesn’t matter was wrong. But I think it’s just incompatibility between Plex (Snap and Flatpak) and Fedora.
I think I found the solution.
One difference that I found out between my Fedora and Ubuntu installation is that I did not install the proprietary Nvidia drivers on the Fedora, but on the Ubuntu installation I have it installed. So I went ahead and install the drivers on Fedora. I thought it did not matter because it’s the Intel iGPU that is supposed to be running the acceleration. But when installing the Nvidia drivers, other than the driver packages, two packages get installed along: egl-gbm
and egl-wayland
, and that stood out to me because when researching for this issue, I’ve read some issue with the Plex HTPC and hardware acceleration, and it’s related to EGL.
After the installation of the driver packages and the two EGL packages, restarted, I ran flatpak update
and updated everything, and started the Flatpak version of Plex Desktop. Lo and behold, it worked. intel_gpu_top
shows that the video engine is running when playing on Plex Desktop.
TL;DR: Install egl-gbm
and egl-wayland
Interesting. Thanks for continuing the investigation and finding a solution. Are you using an NVIDIA card for your display or is this a case where installing those drivers had the byproduct of installing the two packages that really fixed your issue?
I do have a NVIDIA card in my laptop, but the video decoding is done on the Intel iGPU. intel_gpu_top
and nvidia-smi
both show that Plex Desktop is using the iGPU and not the NVIDIA card. So I’m quite sure that the NVIDIA driver is not required, it just happens that the two required packages are installed together when I install the driver.
I spoke too soon. I uninstalled the NVIDIA drivers, installed egl-gbm
and egl-wayland
without the NVIDIA drivers, and it’s not working again.
So I reinstalled the NVIDIA drivers, restarted, and made sure it works with the NVIDIA driver installed, disabled the NVIDIA GPU with a udev rule from here, and restarted again, made sure NVIDIA card is disabled with lspci
(the output does not show the NVIDIA card), and with this configuration (NVIDIA drivers installed, but NVIDIA card disabled with udev rule) it works.
I think there’s something with the NVIDIA drivers itself that made it work, not just the two egl-gbm
and egl-wayland
packages (as I wrongly assumed earlier).
Upon further testing, I found that I don’t need the NVIDIA drivers to be installed if I disable the GPU with udev rules to get hardware acceleration working on the iGPU.
To sum it up:
System: Intel i7-9750H and NVIDIA GTX 1650, tested on Fedora and Ubuntu, Plex Desktop Flatpak and Snap
Variables |
NVIDIA Driver*1 |
GPU Card status*2 |
Working?*3 |
Case A |
installed |
enabled |
yes |
Case B |
installed |
disabled |
yes |
Case C |
uninstalled |
enabled |
no |
Case D |
uninstalled |
disabled |
yes |
*1 NVIDIA Driver includes packages egl-gbm
and egl-wayland
*2 Disabled GPU card means using the udev
rule according to here, enabled means the absence of the udev
rule
*3 Checked via intel_gpu_top
I wonder if this is a case where some piece sees the presence of the NVIDIA GPU, no drivers for it, and then disables a piece that you need for acceleration to work.
That seems to be a reasonable deduction. It doesn’t happen with MPV itself though, even though Plex Desktop seems to also be using libmpv as the player.
That’s because MPV has several output mechanisms but we are limited to the libmpv renderer API due to the lack of a system compositor in Linux which can composite multiple windows. So we are left having to do this in GL.
I have the same issue. It looks like running Plex from Flatpak & Snap doesn’t work with the Intel GPU. It doesn’t use the hardware acceleration. This is what I get when I run plex.
flatpak run tv.plex.PlexDesktop
Note that the directories
‘/var/lib/flatpak/exports/share’
‘/home/user/.local/share/flatpak/exports/share’
are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.
MESA: warning: Driver does not support the 0xa7a8 PCI ID.
libGL error: failed to create dri screen
libGL error: failed to load driver: iris
MESA: warning: Driver does not support the 0xa7a8 PCI ID.
libGL error: failed to create dri screen
libGL error: failed to load driver: iris
qt.scenegraph.general: Using QRhi with backend OpenGL
Graphics API debug/validation layers: 0
QRhi profiling and debug markers: 0
Shader/pipeline cache collection: 0
qt.scenegraph.general: Using QRhi with backend OpenGL
Graphics API debug/validation layers: 0
QRhi profiling and debug markers: 0
Shader/pipeline cache collection: 0
Cannot load libcuda.so.1
Hi I have the same issue after upgrading my notebook from a gen 6 intel to a gen13 one. Apparently the drivers bundled in the flatpak/snap do not have support for it. In my case just starting the application pegs all my CPUs to 100%
Thank you. That would explain it as I just bought a new laptop with 13th Gen Intel CPU as well. Looking at some of the issues on here, there OpenGL is out of date. Plex needs to update them in the Flatpak/Snap.
I do not mind software decoding but right now all CPUs are getting pegged once I start a video so not really usable.
I’ve been running into this exact same issue. Is there a way to manually update the 13th gen / Raptor Lake / RPL-P drivers that come in the snap?
Hello,
I had a closer look at this today. At least for me hardware encoding is indeed being used for playing files I used intel_gpu_top to check BUT the GUI itself without anything playing results in a very high cpu load. In my case right now two to three cpus were fully pegged by just opening the login screen where you enter your pin, with nothing else running
I have the same problem with an all AMD System (Ryzen 7700X / RX 7900 XT). Can’t watch 1080p HEVC files without stutters.
Playback of the same files is no problem with VLC etc. but Plex and mainly Plex HTPC (tested snap and flatpak) have a really high CPU usage even during login and navigation which ramps up to ~95% on all cores during playback.
(I just changed from Windows to a fresh Ubuntu Cinnamon 23.10 (no changes made on my second install after nuking Plex startup with oibaf mesa drivers the first time around), so I’m too much of a noob to know where to find logs or anything, but wanted to make sure AMD is not forgotten
)