Plex-desktop: No GPU Hardware Decoding with NVidia Driver (snap error)

Server Version#: 1.28.1.6104
Player Version#: 1.52.1 2022-08-17
Snap Version#: 2.56.2
Snapd Version#: 2.56.2
Series #: 16
Debian Version#: Debian GNU/Linux bookworm/sid
Kernel Version#: 5.18.0-4-amd64
NVRM version #: NVIDIA UNIX x86_64 Kernel Module 470.141.03 Thu Jun 30 18:45:31 UTC 2022

I have installed the current Linux Plex desktop version of SnapStore: Plex-Desktop and get the following error in the console when starting:

$ plex-desktop
Cannot load libcuda.so.1
[31719:31729:0819/135103.908337:ERROR:command_buffer_proxy_impl.cc(141)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[31655:31711:0819/135104.404719:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[31655:31711:0819/135104.415910:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted

As a result, no media is executed with the GPU hardware decoding and my CPU does not manage to display any smoothly. Only the sound is correct.
I have already tried all forums and search engines to find a possible solution. Since no direct contact person for the SNAP file can be found, I’ll try it here in the forum

Does anyone else have this problem or has someone already solved it?

PS:
In case one of the distributors of the SNAP File is reading along here. There is also another problem with apparmor that I was able to solve. In case anyone wants to know, here are the missing lines in the file /var/lib/snapd/apparmor/profiles/snap.plex-desktop.plex-desktop:

@{PROC}/[0-9]*/cmdline r,
owner @{PROC}/@{pid}/setgroups rw,
owner @{HOME}/ r,
# eg. /home/USER/.config/kdedefaults/kdeglobals
owner @{HOME}/** r,

Anyone an idea or a wire to the plex desktop packager?

Player Version#: 1.54.1 2022-09-15

Immer noch aktuell

Does anyone here know how to send suggestions for improvement to the developers?
It’s all well and good that there is a forum, but you can’t pass everything on to the community. If I’m going to solve my problems with the software, then at least I want to share it in a way that it can be taken into the mainstream.

The issue is due to the missing libcuda.so.1 (as stated in your cli output). The last time I had a look at what is shipped with the .snap I could only find libs for AMD and Intel (and some nouveau stuff…) hw acceleration.

To clarify this a bit more, maybe you can post a plex htpc log, while the problem occurs?

If possible try to create an mpv.conf and add log-file=path-to-mpv.output.txt and play a video. Maybe we can get some information through this log file. (Why it’s not using vdpau instead of nvdec?)

Hello Mitzsch

First of all, thanks for the answer. After I was able to test again on my PC, I first had to realize that the versions have changed marginally in the meantime.

It currently looks like this:

Server Version#: 1.29.0.6244
Player Version#: 1.55.0 2022-09-30 (20)
Snap Version#: 2.57.2
Snapd Version#: 2.57.2
Series #: 16
Debian Version#: Debian GNU/Linux bookworm/sid
Kernel Version#: 5.19.0-2-amd64
NVRM version #: 470.141.03

Unfortunately, more apparmor bugs were added as a result. It all looks like this now.

$ plex-desktop 
chmod: changing permissions of '/home/bkreuzer/snap/plex-desktop/20/.config': Permission denied
/snap/plex-desktop/20/snap/command-chain/desktop-launch: line 255: /home/bkreuzer/snap/plex-desktop/20/.config/user-dirs.dirs: Permission denied
/snap/plex-desktop/20/snap/command-chain/desktop-launch: line 256: /home/bkreuzer/snap/plex-desktop/20/.config/user-dirs.dirs.md5sum: Permission denied
rm: cannot remove '/home/bkreuzer/snap/plex-desktop/20/.local/share/themes': Permission denied
/snap/plex-desktop/20/snap/command-chain/desktop-launch: line 394: /home/bkreuzer/snap/plex-desktop/20/.config/fontconfig/fonts.conf: Permission denied
ln: failed to create symbolic link '/home/bkreuzer/snap/plex-desktop/20/.local/share/themes': Permission denied
ln: failed to create symbolic link '/home/bkreuzer/snap/plex-desktop/20/.themes': Permission denied
rm: cannot remove '/home/bkreuzer/snap/plex-desktop/20/.local/share/icons': Permission denied
rm: cannot remove '/home/bkreuzer/snap/plex-desktop/20/.local/share/glib-2.0/schemas': Permission denied
ln: failed to create symbolic link '/home/bkreuzer/snap/plex-desktop/20/.config/ibus/bus': Permission denied
/snap/plex-desktop/20/snap/command-chain/desktop-launch: line 573: /home/bkreuzer/snap/plex-desktop/20/.last_revision: Permission denied
/snap/plex-desktop/20/bin/desktop-launch: line 247: /home/bkreuzer/snap/plex-desktop/20/.config/user-dirs.dirs: Permission denied
/snap/plex-desktop/20/bin/desktop-launch: line 248: /home/bkreuzer/snap/plex-desktop/20/.config/user-dirs.dirs.md5sum: Permission denied
rm: cannot remove '/home/bkreuzer/snap/plex-desktop/20/.local/share/themes': Permission denied
/snap/plex-desktop/20/bin/desktop-launch: line 392: /home/bkreuzer/snap/plex-desktop/20/.config/fontconfig/fonts.conf: Permission denied
ln: failed to create symbolic link '/home/bkreuzer/snap/plex-desktop/20/.local/share/themes': Permission denied
ln: failed to create symbolic link '/home/bkreuzer/snap/plex-desktop/20/.themes': Permission denied
cp: cannot stat '/snap/plex-desktop/20/usr/share/mime': No such file or directory
rm: cannot remove '/home/bkreuzer/snap/plex-desktop/20/.local/share/icons': Permission denied
ln: failed to create symbolic link '/home/bkreuzer/snap/plex-desktop/20/.config/ibus/bus': Permission denied
/snap/plex-desktop/20/bin/desktop-launch: line 542: /home/bkreuzer/snap/plex-desktop/20/.last_revision: Permission denied
Directory '/home/bkreuzer/snap/plex-desktop/20/.local/share/mime/packages' does not exist!
ERROR: update-mime-database /home/bkreuzer/snap/plex-desktop/20/.local/share/mime exited abnormally with status 1
[5242:5298:1002/105906.714122:ERROR:disk_cache.cc(184)] Unable to create cache
[5242:5298:1002/105906.714220:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
Cannot load libcuda.so.1
[5322:5334:1002/105908.117172:ERROR:command_buffer_proxy_impl.cc(141)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[5242:5298:1002/105908.727344:ERROR:disk_cache.cc(184)] Unable to create cache
[5242:5298:1002/105908.727439:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
[5242:5307:1002/105908.733560:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[5242:5307:1002/105908.741504:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[5313:5317:1002/105916.384629:ERROR:database.cc(1696)] Cookie sqlite error 8, errno 0: attempt to write a readonly database, sql: DELETE FROM cookies WHERE is_persistent != 1
[5313:5315:1002/105916.650673:ERROR:nss_util.cc(166)] Error initializing NSS with a persistent database (sql:/home/bkreuzer/snap/plex-desktop/20/.pki/nssdb): NSS error code: -8126

As far as your suggestion with the mpv.conf is concerned, I created one under ~/snap/plex-desktop/common, but it didn’t do anything.
But I still found what I was looking for under ~/snap/plex-desktop/common/Logs.
Plex.log (164,1 KB)

I guess the apparmor “errors” have to be eliminated first.
Are the data sufficient for further analysis?

Yes, the log file is sufficient and resolves the question of why vdpau is not being used. The answer is simple the mpv lib wasn´t built with vdpau support.

Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'vaapi-egl'
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi-egl: VAAPI hwdec only works with OpenGL or Vulkan backends.
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'cuda-nvdec'
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render/cuda-nvdec: Failed to load CUDA symbols
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'drmprime-drm'
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render/drmprime-drm: Failed to retrieve DRM fd from native display.
Oct 02, 2022 11:55:23.794 [0x7fee75e6a700] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.

Well, the hope to get hw decoding with your gpu is quite low, even if you could resolve the AppArmor problems (have you tried reinstalling plex desktop?) as the necessary lib needs to be shipped with the appimage. Snaps also won’t use variables like LD_LIBRARY_PATH which could help getting it to work somehow.

If you have much time to spend, you could try to unpack the appimage change the mpv lib with a self-compiled static build (with vdpau support), and repack it. (if it then works for you I don´t know)
Launching it in an unzipped state never worked on my side - well, because the libs plex needed were not at the path where they should be, and manually copying all the libs to their location is quite tedious. However, for arch users, there is a PKGBUILD that does this for you. => https://aur.archlinux.org/packages/plex-htpc
Note that this is for plex htpc but plex desktop shouldn´t be too different.

Thanks for the analysis. So now I have a few starting points where I can look for the solution to my problem. Too bad there isn’t a “Plex Player Only” package to install yourself, but the best I can probably expect is if my work wasn’t completely useless and went into the original package. Then I’ll read the SNAP admin manual…

One thing I want to add is, you could also try to copy the libcuda.so.1 from your systems file location to the snap image and repack it. Copying libs to a different system location is normally not a good thing / not a recommended step as it can introduce many weird things but sometimes it works surprisingly well. Maybe worth a try when already looking at repacking a snap. :wink:

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