Plex Desktop on Linux (Flatpak) is not doing hardware acceleration

Just a small update from my side. The snap and flatpak now updated to the latest 1.80.2 version. Playing a file I have now around 1000% cpu usage BUT according to the log now hardware acceleration. So 10 corse are full pegged now for playing content, which makes it really unusable. For the moment I switched to VLC/mpv for watching videos but I really miss the GUI. :slight_smile:

Just updated to the latest version and it still is not using the HW.

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
[5:73:1029/101701.789772:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[5:73:1029/101701.792287:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[5:73:1029/101702.112134:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[5:77:1029/101703.079280:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -202
Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.

I wonder if it is because I am on wayland and it is still using X11?

Bumping for AMD support.
Life without acceleration is unpleasant :frowning_face:

The Flatpak version has had its runtime dependency updated, independently of Plex. (see here; HTPC was updated too btw!)

This resolved a compatibility issue with recent AMD GPUs; I’d bet it’d help with newer Intel processors as well. I’m direct streaming 4K 10-bit HEVC/H.265 now, which is fantastic.

This didn’t require a new version of Plex, so when the dependencies were updated Flathub auto-built and published it. I re-installed to ensure it picked it up, but a simple update might get it; not sure if Flatpak will see that given the app version didn’t actually change.

I just updated my flatpak packages which also removed the 21.08 runtime. Since then, I don’t receive the warnings mentioned here. At a first glance, Plex seems to run as expected so I assume that a simple update is sufficient.

I am on the newest flatpak build and hardware decoding is still not working for me. Hardware decode works for me when watching plex in firefox but not in flatpak tv.plex.PlexDesktop

What hardware are you running?
The posts above make me want to reinstall Ubuntu instead of Windows, however if you are also running raptor lake and HW decoding is still not operational…

laptop with i5-1135G7 tiger lake. im on fedora 39

I can confirm that while the latest flatpak version fixed the high cpu load issues but hardware acceleration is also not working for me in the flatpak. I am running this with a 13th GEN intel cpu.
The snap version has been updated as well, but there I still see the opengl related error during startup.

It still behaves exactly like before as described in post 10 for me. The update on the runtime fixed AMD graphics issue, which is not the same as what is described in this thread. This thread is about the issue of hardware acceleration when both kernel modules i915 and nouveau (not the proprietary nvidia) are both loaded at the same time.

It is actually even worse now for Flatpak. Hardware accelerated decoding doesn’t even work anymore in Case A (NVIDIA Driver installed and NVIDIA GPU enabled). It used to work before. Snap, however, works as before in Case A.

Log from Flatpak:

Dec 31, 2023 09:22:44.743 [140249447515840] INFO - [MPVEngine/mpv] cplayer:  (+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
Dec 31, 2023 09:22:44.743 [140249447515840] INFO - [MPVEngine/mpv] cplayer:  (+) Audio --aid=1 --alang=eng (*) (ac3 6ch 48000Hz)
Dec 31, 2023 09:22:44.743 [140249447515840] INFO - [MPVEngine/mpv] cplayer:      Audio --aid=2 --alang=eng (aac 2ch 48000Hz)
Dec 31, 2023 09:22:44.743 [140249447515840] INFO - [MPVEngine/mpv] cplayer:      Subs  --sid=1 (*) (eia_608)
Dec 31, 2023 09:22:44.743 [140249447515840] INFO - [MPVEngine/mpv] cplayer:  (+) Subs  --sid=2 '6629882?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&encoding=utf-8' (subrip) (external)
Dec 31, 2023 09:22:44.743 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Container reported FPS: 23.976000
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Codec list:
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd:     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Opening decoder h264
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec h264-vaapi...
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Could not create device.
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec h264-vaapi-copy...
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Could not create device.
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: No hardware decoding available for this codec.
Dec 31, 2023 09:22:44.744 [140249447515840] DEBUG - [MPVEngine/mpv] vd: Using software decoding.

Log from Snap:

Dec 31, 2023 09:10:34.640 [140184578422528] INFO - [MPVEngine/mpv] cplayer:  (+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
Dec 31, 2023 09:10:34.640 [140184578422528] INFO - [MPVEngine/mpv] cplayer:  (+) Audio --aid=1 --alang=eng (*) (ac3 6ch 48000Hz)
Dec 31, 2023 09:10:34.640 [140184578422528] INFO - [MPVEngine/mpv] cplayer:      Audio --aid=2 --alang=eng (aac 2ch 48000Hz)
Dec 31, 2023 09:10:34.640 [140184578422528] INFO - [MPVEngine/mpv] cplayer:      Subs  --sid=1 (*) (eia_608)
Dec 31, 2023 09:10:34.640 [140184578422528] INFO - [MPVEngine/mpv] cplayer:  (+) Subs  --sid=2 '6629882?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&encoding=utf-8' (subrip) (external)
Dec 31, 2023 09:10:34.640 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Container reported FPS: 23.976000
Dec 31, 2023 09:10:34.640 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Codec list:
Dec 31, 2023 09:10:34.640 [140184578422528] DEBUG - [MPVEngine/mpv] vd:     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Dec 31, 2023 09:10:34.640 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Opening decoder h264
Dec 31, 2023 09:10:34.640 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec h264-vaapi...
Dec 31, 2023 09:10:34.640 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Could not create device.
Dec 31, 2023 09:10:34.640 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec h264-vaapi-copy...
Dec 31, 2023 09:10:34.644 [140184578422528] DEBUG - [MPVEngine/mpv] vaapi: Initialized VAAPI: version 1.18
Dec 31, 2023 09:10:34.644 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Trying hardware decoding via h264-vaapi-copy.
Dec 31, 2023 09:10:34.645 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Pixel formats supported by decoder: vaapi yuv420p
Dec 31, 2023 09:10:34.645 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Codec profile: High (0x64)
Dec 31, 2023 09:10:34.645 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Requesting pixfmt 'vaapi' from decoder.
Dec 31, 2023 09:10:34.648 [140184578422528] DEBUG - [MPVEngine/mpv] vd: Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)

After analysing the logs, the difference I found suspicious is the different Mesa versions:
Flatpak:

Dec 31, 2023 09:44:48.475 [140479882569408] DEBUG - OpenGL VENDOR: Intel RENDERER: Mesa Intel(R) UHD Graphics 630 (CFL GT2) VERSION: 4.6 (Compatibility Profile) Mesa 23.3.1 (git-6cdc2
b044d)
Dec 31, 2023 09:44:48.476 [140479882569408] DEBUG - MSAA sample count for the swapchain is 1. Alpha channel requested = no.
Dec 31, 2023 09:44:48.476 [140479882569408] DEBUG - rhi texture atlas dimensions: 2048x1024
Dec 31, 2023 09:44:48.476 [140482164270784] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VERSION='4.6 (Compatibility Profile) Mesa 23.3.1 (git-6cdc2b044d)'
Dec 31, 2023 09:44:48.476 [140482164270784] DEBUG - [MPVEngine/mpv] libmpv_render: Detected desktop OpenGL 4.6.
Dec 31, 2023 09:44:48.476 [140482164270784] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VENDOR='Intel'
Dec 31, 2023 09:44:48.476 [140482164270784] DEBUG - [MPVEngine/mpv] libmpv_render: GL_RENDERER='Mesa Intel(R) UHD Graphics 630 (CFL GT2)'
Dec 31, 2023 09:44:48.476 [140482164270784] DEBUG - [MPVEngine/mpv] libmpv_render: GL_SHADING_LANGUAGE_VERSION='4.60'

Snap:

Dec 31, 2023 09:10:19.425 [140182590301952] DEBUG - OpenGL VENDOR: Intel RENDERER: Mesa Intel(R) UHD Graphics 630 (CFL GT2) VERSION: 4.6 (Compatibility Profile) Mesa 21.2.6
Dec 31, 2023 09:10:19.427 [140182590301952] DEBUG - MSAA sample count for the swapchain is 1. Alpha channel requested = no.
Dec 31, 2023 09:10:19.427 [140182590301952] DEBUG - rhi texture atlas dimensions: 2048x1024
Dec 31, 2023 09:10:19.427 [140184578422528] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VERSION='4.6 (Compatibility Profile) Mesa 21.2.6'
Dec 31, 2023 09:10:19.427 [140184578422528] DEBUG - [MPVEngine/mpv] libmpv_render: Detected desktop OpenGL 4.6.
Dec 31, 2023 09:10:19.427 [140184578422528] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VENDOR='Intel'
Dec 31, 2023 09:10:19.427 [140184578422528] DEBUG - [MPVEngine/mpv] libmpv_render: GL_RENDERER='Mesa Intel(R) UHD Graphics 630 (CFL GT2)'
Dec 31, 2023 09:10:19.427 [140184578422528] DEBUG - [MPVEngine/mpv] libmpv_render: GL_SHADING_LANGUAGE_VERSION='4.60'

Also worth mentioning is that although in the Snap version the decoding is done in the iGPU, the NVIDIA GPU is kept at D0 state when plex-desktop is running, instead of letting it get down to D3cold to save power. Same goes to the Flatpak version, when hardware decoding is not even working at all, NVIDIA GPU stays at D0 indefinitely until Plex Desktop is closed. Although this might be a whole other issue. MPV on the other hand, Snap’s mpv works fine, with hardware decoding working as expected and NVIDIA GPU going into D3cold, but Flatpak’s io.mpv.Mpv keeps NVIDIA GPU at D0 when decoding is done on iGPU.

1 Like

I am seeing the same behavior with the flatpak version of the app - no hardware acceleration - on both a 12th Gen Intel iGPU on my laptop and on my desktop with an AMD 7900 XTX. Hardware acceleration works with the Snap app, but I’m not a fan of Snap and would prefer to have the flatpak version of the app working correctly.

All of my other flatpak applications (Firefox, Chromium, VLC, Moonlight, Chiaki, Steam, mpv itself) are leveraging VAAPI properly and I have all of the VAAPI and ffmpeg flatpak components installed, so it does seem like an issue with Plex itself not leveraging the VAAPI components that are installed properly.

I just tried it now with the latest update of the Flatpak and it used the OpenGL 23.08. I can confirm the HDR + 4K work for me now.

The Issue still remains
Are their any news about this?
Not having hardware acceleration and keeping my Nvidia GPU awake makes the Flatpak unusable for me.

1 Like

Keeping this thread alive. Hardware acceleration is still not working in the Flatpak version of the app, neither running as an XWayland window or native Wayland. I’ve tried various options in the mpv.conf file to no avail. I see above in the thread some MPV logs, would someone be kind enough to share how I can generate/find and share those logs? Setting debug to on or verbose in the Plex Desktop app doesn’t seem to show any of the MPV specific logs.

And, to reiterate, all of the other Flatpak applications that leverage VAAPI that I am running work properly. It’s JUST the Plex Desktop app that doesn’t leverage VAAPI (well, and Chromium on my AMD GPU, but that’s a known Chromium bug and not Flatpak related).

1 Like

Yeah mine is also not working. My CPU load is constantly at 100% and sudo intel_gpu_top shows barely anything. (trying to direct play 4k HVEC) The drivers are all installed and HW acceleration works fine for other apps, tought not through Flatpak. I only use Flatpak for the plex desktop client.

I’ve been tinkering around with this myself to get this working on NVIDIA (proprietary with libva-nvidia-driver) working with vaapi.

From what I can tell it looks like the Plex Desktop app does not run Qt under EGL in X11 (and also has no native Wayland support), which causes mpv to think that it is not running under an OpenGL or Vulkan environment so it skips setting up vaapi.

Setting the environment variable QT_XCB_GL_INTEGRATION=xcb_egl in the Flatpak settings does allow the environment to be detected as an OpenGL but presents two new issues: the entire Plex Player is a blank screen and vaapi still fails to initialise as it can’t find an X11 session.

Apr 21, 2024 19:48:05.275 [126075474544320] DEBUG - Created OpenGL context QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QColorSpace(), profile  QSurfaceFormat::CompatibilityProfile)
Apr 21, 2024 19:48:05.309 [126075474544320] DEBUG - OpenGL VENDOR: NVIDIA Corporation RENDERER: NVIDIA GeForce RTX 3080/PCIe/SSE2 VERSION: 4.6.0 NVIDIA 550.76
Apr 21, 2024 19:48:05.310 [126075474544320] DEBUG - MSAA sample count for the swapchain is 1. Alpha channel requested = no.
Apr 21, 2024 19:48:05.310 [126075474544320] DEBUG - rhi texture atlas dimensions: 2048x1024
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VERSION='4.6.0 NVIDIA 550.76'
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Detected desktop OpenGL 4.6.
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VENDOR='NVIDIA Corporation'
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: GL_RENDERER='NVIDIA GeForce RTX 3080/PCIe/SSE2'
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: GL_SHADING_LANGUAGE_VERSION='4.60 NVIDIA'
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_KHR_debug.
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: GL_*_swap_control extension missing.
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Testing FBO format rgba16f
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Using FBO format rgba16f.
Apr 21, 2024 19:48:05.310 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: No advanced processing required. Enabling dumb mode.
Apr 21, 2024 19:48:05.311 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'vaapi-egl'
Apr 21, 2024 19:48:05.311 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi-egl: using VAAPI EGL interop
Apr 21, 2024 19:48:05.311 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi-egl: Trying to open a x11 VA display...
Apr 21, 2024 19:48:05.311 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.
Apr 21, 2024 19:48:05.311 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'cuda-nvdec'
Apr 21, 2024 19:48:05.402 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.
Apr 21, 2024 19:48:05.402 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'drmprime-drm'
Apr 21, 2024 19:48:05.402 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render/drmprime-drm: Failed to retrieve DRM fd from native display.
Apr 21, 2024 19:48:05.402 [126075958986432] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.

Some of this may only be an NVIDIA related issue (such is life on team green and Linux), so AMD users might find setting QT_XCB_GL_INTEGRATION=xcb_egl works for them.

Interestingly mpv does appear to try and load cuda-nvdec, but always fails.

1 Like

Brand new Beelink S12 running Ubuntu and get pretty much the same thing. CPU cranks up to near 400% and the video stutters. Even just sitting on the interface it sits at around 100%

Same issue here on n100. Want to move from win11 to Ubuntu but unable to as the one app not working is Plex snap.

Ubuntu 24.04, x265 direct play.