Moonlight running on Arch can't open VDPAU backend; possible radeonsi and FLATPAK issue. Using 5700XT

Getting Moonlight to work using FLATPAK

I have been adventuring into the world of Arch Linux and flatpaks lately. One of my items that I want to get working is using Moonlight to connect from my Linux box to my gaming system which is connected to my TV.

The issue

I am having an issue with getting hardware decoding to work on Moonlight utilizing the flatpak install. Any assistance in getting this to work would be much appreciated.

When I run moonlight I get the following error.

image

Failed to open VDPAU backend libvdpau_radeonsi.so: cannot open shared object file: No such file or directory
00:00:00 - FFmpeg: [AVHWDeviceContext @ 0x561eb44b4640] VDPAU device creation on X11 display :99.0 failed.
00:00:00 - SDL Error (0): Failed to create VDPAU context: -1313558101

FLATPAK installed software

user:~ $ flatpak list
Name                           Application ID                              Version        Branch      Installation
Moonlight                      com.moonlight_stream.Moonlight              1.2.0          stable      user
Steam                          com.valvesoftware.Steam                     1.0.0.61       stable      user
Freedesktop Platform           org.freedesktop.Platform                    19.08.9        19.08       user
i386                           org.freedesktop.Platform.Compat.i386                       19.08       user
default                        org.freedesktop.Platform.GL.default                        19.08       user
default                        org.freedesktop.Platform.GL32.default                      19.08       user
openh264                       org.freedesktop.Platform.openh264                          2.0         user
Breeze Gtk theme               org.gtk.Gtk3theme.Breeze                                   3.22        user
KDE Application Platform       org.kde.Platform                                           5.13        user

Troubleshooting

I have tried to run the flatpak with and without setting the LD_LIBRARY_PATH but get the same results. My current theory is that the flatpak does not have permissions or simply doesn’t know the location of the radeonsi library.

The full log output is below:

user:~ $ flatpak run --env=LD_LIBRARY_PATH=/usr/lib/vdpau com.moonlight_stream.Moonlight 
00:00:00 - SDL Info (0): Compiled with SDL 2.0.12
00:00:00 - SDL Info (0): Running with SDL 2.0.12
00:00:00 - Qt Info: Found "gamecontrollerdb.txt" at ":/data/gamecontrollerdb.txt"
00:00:00 - SDL Info (0): Loaded 74 new gamepad mappings
00:00:00 - SDL Info (0): V-sync enabled
libva info: VA-API version 1.5.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/GL/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_5
libva info: va_openDriver() returns 0
00:00:00 - SDL Info (0): Initialized VAAPI 1.5
00:00:00 - SDL Info (0): Driver: Mesa Gallium driver 20.0.1 for AMD NAVI10 (DRM 3.36.0, 5.5.11-arch1-1, LLVM 9.0.0)
00:00:00 - SDL Warn (0): Avoiding VAAPI on AMD driver
Failed to open VDPAU backend libvdpau_radeonsi.so: cannot open shared object file: No such file or directory
00:00:00 - FFmpeg: [AVHWDeviceContext @ 0x561eb44b4640] VDPAU device creation on X11 display :99.0 failed.
00:00:00 - SDL Error (0): Failed to create VDPAU context: -1313558101
00:00:00 - FFmpeg: [AVHWDeviceContext @ 0x561eb4579040] Cannot load libcuda.so.1
00:00:00 - FFmpeg: [AVHWDeviceContext @ 0x561eb4579040] Could not dynamically load CUDA
00:00:00 - SDL Error (0): av_hwdevice_ctx_create(CUDA) failed: -1313558101
00:00:00 - Qt Info: Found "ModeSeven.ttf" at ":/data/ModeSeven.ttf"
mesa: for the   --simplifycfg-sink-common option: may only occur zero or one times!
mesa: for the   --global-isel-abort option: may only occur zero or one times!
00:00:00 - SDL Info (0): Using SDL renderer

The drivers are loaded and other software is able to use them with no issues. I even installed moonlight using the embedded-git and the program was able to hardware decode the stream without issues. It looked fantastic but I had issues with the mouse input. This may be the long-term solution. Below is the output of vainfo and vdpauinfo.

user:~ $ vainfo
vainfo: VA-API version: 1.6 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 19.3.4 for AMD NAVI10 (DRM 3.36.0, 5.5.11-arch1-1, LLVM 9.0.1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
user:~ $ vdpauinfo 
display: :0   screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name   width height types
-------------------------------------------
420    16384 16384  NV12 YV12 
422    16384 16384  UYVY YUYV 
444    16384 16384  Y8U8V8A8 V8U8Y8A8 

System Info

Operating System: Arch Linux 
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1
Kernel Version: 5.5.11-arch1-1
OS Type: 64-bit
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 62.8 GiB of RAM
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT]  driver: amdgpu v: kernel Display: x11 server: X.org 1.20.7 driver: amdgpu unloaded: modesetting resolution: <xdpyinfo missing>  OpenGL: renderer: AMD NAVI10 (DRM 3.36.0 5.5.11-arch1-1 LLVM 9.0.1) v: 4.5 Mesa 19.3.4