Hi all! I’m currently unable to get hardware acceleration working properly for (H265) video playback using the Plex-HTPC linux snap app on my system. When starting up the snap via the terminal, it spits out an Mesa related error. Playing the same file with MPV works just fine and uses hardware decoding, which tells me that the system should be capable of hardware decoding video in ubuntu
About the system
My system is an NUC with a 13th gen Intel Core i5 1340P, running is Ubuntu 22.04.3 LTS, 32GB of RAM, and only using the integrated graphics.
What I’ve found
I’ve turned on logging via mpv.conf and attached the output below. I’ve tried starting plex-htpc with QT_XCB_GL_INTEGRATION=xcb_egl snap run plex-htpc, which resulted in the app erroring out as “non responsive” requiring a force quit. Pressing ctrl-shift-D shows Hardware Decoding: vaapi-copy (?)
Error when issuing the snap run plex-htpc command:
max@max-NUC13ANHi5:~$ snap run plex-htpc
MESA: warning: Driver does not support the 0xa7a0 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
[6959:7030:0804/170510.446962:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[6959:7030:0804/170510.451842:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
Errors I found in the mpv log
[ 0.254][v][libmpv_render] No advanced processing required. Enabling dumb mode.
[ 0.254][v][libmpv_render] Loading hwdec driver 'vaapi-egl'
[ 0.254][v][libmpv_render/vaapi-egl] VAAPI hwdec only works with OpenGL or Vulkan backends.
[ 0.254][v][libmpv_render] Loading failed.
[ 0.254][v][libmpv_render] Loading hwdec driver 'cuda-nvdec'
[ 0.254][v][libmpv_render/cuda-nvdec] Failed to load CUDA symbols
[ 0.254][v][libmpv_render] Loading failed.
[ 0.254][v][libmpv_render] Loading hwdec driver 'drmprime-drm'
[ 0.254][v][libmpv_render/drmprime-drm] Failed to retrieve DRM fd from native display.
[ 0.254][v][libmpv_render] Loading failed.
I’ve uploaded the complete log of mpv below: mpv_log.log (32.6 KB)
Are you using wayland? I’m not sure but I think the EGL no-copy for video doesn’t work with wayland. FWIW, I have an older NUC running 22.04 and I get vaapi-egl on video playback but I use X and not wayland (primarily because X supports refresh rate switching).
Also, the application logs include MPV’s logging as well as logs from the application.
I think I am indeed using Wayland. It’s the default when running 22.04 right? I used this guide to disable it, but this didn’t resolve my issues with hardware decoding…
Do you have any suggestions on how I can force plex-htpc to use hardware based OpenGL?
I’ve tried to install the official Intel drivers following these instructions, which did not change the errors I get when starting the app.
I’ve also tried passing other versions of LIBVA_DRIVER_NAME= (i965 and iHD) and set an alternative path to LIBVA_DRIVERS_PATH= to include the “official” drivers, which did not change the “libGL error: failed to load driver: iris” error