You are not logged in.

#1 2024-10-03 11:51:04

AmmoniumX
Member
Registered: 2024-09-27
Posts: 6

[SOLVED] libva broken after system update (nvidia/wayland)

Let me start by saying that I *have* seen a very similar post made recently, https://bbs.archlinux.org/viewtopic.php?id=299566 , but the problem seems to be slightly different for them, their problem was specifically when running `mongodb-compass`, they were able to run `vainfo` and solved it by unsetting the `ELECTRON_OZONE_PLATFORM_HINT` env var, but I don't have that variable set and still have this issue.

I recently updated my system, and after fixing a problem with nvidia drivers due to the kernel update, I now have a non-functional krdpserver/libva setup. `vainfo` works if I specifically tell it to use my intel iGPU for it, but I had `krdpserver` set to use the nvidia mode before, and trying to force it to use intel doesn't work.

Has anyone run into a similar issue? Just to be clear: I have two different libva drivers for intel and nvidia, the intel one works with `vainfo` but nvidia's doesn't. Neither work on krdpserver.

Here's what it looks like trying to run if using the nvidia GPU, it just closes prematurely, and trying to connect to it just times out.

❯ LIBVA_DRIVER_NAME=nvidia krdpserver -u user -p password # starting with nvidia
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Listening for connections on QHostAddress(QHostAddress::Any) 3389
org.kde.krdp: Started Freedesktop Portal session
kpipewire_vaapi_logging: VAAPI: VA-API NVDEC driver [direct backend] in use for device "/dev/dri/renderD129"
org.kde.krdp: Closing Freedesktop Portal Session
^C

If I instead try to run it using intel's integrated graphics, it seems to still try to use the nvidia drivers, and also closes prematurely:

❯ LIBVA_DRIVER_NAME=iHD krdpserver -u user -p password # starting with intel
org.kde.krdp: Initializing Freedesktop Portal Session
org.kde.krdp: Listening for connections on QHostAddress(QHostAddress::Any) 3389
org.kde.krdp: Started Freedesktop Portal session
DRM_IOCTL_VERSION, unsupported drm device by media driver: nvid
DRM_IOCTL_VERSION, unsupported drm device by media driver: nvid
libva error: /usr/lib/dri/iHD_drv_video.so init failed
kpipewire_vaapi_logging: VAAPI: Failed to initialize display
kpipewire_vaapi_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.3.3 () in use for device "/dev/dri/renderD128"
org.kde.krdp: Closing Freedesktop Portal Session
^C

Here's everything that might be useful, particularly the failure when doing vainfo on nvidia drivers:

❯ pacman -Q nvidia krdp libva libva-intel-driver libva-nvidia-driver
nvidia 560.35.03-9
krdp 6.1.5-1
libva 2.22.0-1
libva-intel-driver 2.4.1-3
libva-nvidia-driver 0.0.12-1

❯ LIBVA_DRIVER_NAME=nvidia vainfo # using nvidia drivers
Trying display: wayland
libva error: /usr/lib/dri/nvidia_drv_video.so init failed
vaInitialize failed with error code 1 (operation failed),exit

❯ LIBVA_DRIVER_NAME=iHD vainfo | head -n 4 # using intel drivers
Trying display: wayland
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.3.3 ()
vainfo: Supported profile and entrypoints

❯ lspci -k | grep -EA3 'VGA|3D|Display'
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]
        DeviceName: Onboard - Video
        Subsystem: Dell Device 086f
        Kernel driver in use: i915
--
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
        Subsystem: Dell Device 086f
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia

Last edited by AmmoniumX (2024-10-15 17:59:27)

Offline

#2 2024-10-03 12:06:24

gromit
Package Maintainer (PM)
From: Germany
Registered: 2024-02-10
Posts: 784
Website

Re: [SOLVED] libva broken after system update (nvidia/wayland)

Do you have any external packages installed that might influence the System in that regard? Please post the output of "pacman -Qm" big_smile

Offline

#3 2024-10-03 12:14:09

AmmoniumX
Member
Registered: 2024-09-27
Posts: 6

Re: [SOLVED] libva broken after system update (nvidia/wayland)

gromit wrote:

Do you have any external packages installed that might influence the System in that regard? Please post the output of "pacman -Qm" big_smile

Sure! here it is

❯ pacman -Qm
dell-bios-fan-control-git r5.2700610-5
dell-bios-fan-control-git-debug r5.2700610-5
dellfan-git r4.4343995-1
dellfan-git-debug r4.4343995-1
git-credential-manager 2.5.1-1
kdeplasma-arch-update-notifier-git 6.3.2-3
lazydocker 0.23.3-1
lazydocker-debug 0.23.3-1
libpamac-aur 11.6.4-6
ngrok 3.16.0-1
optimus-manager-git 1:r770.595e920.python3.12-1
pamac-aur 11.7.1-4
pamac-tray-icon-plasma 0.1.4-1
pamac-tray-icon-plasma-debug 0.1.4-1
powerstat 0.04.03-1
powerstat-debug 0.04.03-1
python313-debug 3.13.0rc2-1
update-grub 0.0.1-8
visual-studio-code-bin 1.93.1-1
visual-studio-code-bin-debug 1.93.1-1
xorgxrdp-debug 0.10.2-3
xrdp-debug 0.10.1-1
yay 12.4.2-1
yay-debug 12.4.2-1

I don't think any of these would cause any issue, but you never know

Offline

#4 2024-10-03 15:24:03

AmmoniumX
Member
Registered: 2024-09-27
Posts: 6

Re: [SOLVED] libva broken after system update (nvidia/wayland)

Update: I have managed to obtain more information:

❯ NVD_LOG=1 NVD_BACKEND=direct LIBVA_DRIVER_NAME=nvidia vainfo
Trying display: wayland
       753.549504480 [3686-3686] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2188       __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 40
       753.549530513 [3686-3686] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2197       __vaDriverInit_1_0 Now have 0 (0 max) instances
       753.549542130 [3686-3686] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2223       __vaDriverInit_1_0 Selecting Direct backend
       753.639811815 [3686-3686] ../nvidia-vaapi-driver-0.0.12/src/backend-common.c:  31            isNvidiaDrmFd Invalid driver for DRM device: i915
       753.639848292 [3686-3686] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2248       __vaDriverInit_1_0 Exporter failed
libva error: /usr/lib/dri/nvidia_drv_video.so init failed
vaInitialize failed with error code 1 (operation failed),exit

It seems that even with LIBVA_DRIVER_NAME=nvidia, it still tries to use the intel iGPU for the DRM device. I have searched a bit and some claim setting NVD_BACKEND=direct can fix it, but it's not working for me.

Offline

#5 2024-10-03 20:44:51

AmmoniumX
Member
Registered: 2024-09-27
Posts: 6

Re: [SOLVED] libva broken after system update (nvidia/wayland)

Update 2: For some reason, it only happens when trying in `wayland`, x11 and drm work fine:

❯ NVD_LOG=1 LIBVA_DRIVER_NAME=nvidia vainfo --display wayland
Trying display: wayland
      1080.159804159 [13860-13860] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2188       __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 40
      1080.159833802 [13860-13860] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2197       __vaDriverInit_1_0 Now have 0 (0 max) instances
      1080.159845107 [13860-13860] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2223       __vaDriverInit_1_0 Selecting Direct backend
      1080.255231340 [13860-13860] ../nvidia-vaapi-driver-0.0.12/src/backend-common.c:  31            isNvidiaDrmFd Invalid driver for DRM device: i915
      1080.255268002 [13860-13860] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2248       __vaDriverInit_1_0 Exporter failed
libva error: /usr/lib/dri/nvidia_drv_video.so init failed
vaInitialize failed with error code 1 (operation failed),exit

❯ NVD_LOG=1 LIBVA_DRIVER_NAME=nvidia vainfo --display x11
Trying display: x11
      1083.000119309 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2188       __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 10
      1083.000154076 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2197       __vaDriverInit_1_0 Now have 0 (0 max) instances
      1083.000170411 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2223       __vaDriverInit_1_0 Selecting Direct backend
      1083.096400239 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/direct/direct-export-buf.c:  68      direct_initExporter Searching for GPU: 0 0 128
      1083.096486713 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/direct/direct-export-buf.c:  90      direct_initExporter Found NVIDIA GPU 0 at /dev/dri/renderD128
      1083.096513724 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/direct/nv-driver.c: 267            init_nvdriver Initing nvdriver...
      1083.096686697 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/direct/nv-driver.c: 285            init_nvdriver NVIDIA kernel driver version: 560.35.03, major version: 560, minor version: 35
      1083.096718756 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/direct/nv-driver.c: 292            init_nvdriver Got dev info: 100 1 0 fe
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      1083.228265621 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2098              nvTerminate Terminating 0x6495febb5980
      1083.228400129 [13892-13892] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2112              nvTerminate Now have 0 (0 max) instances

❯ NVD_LOG=1 LIBVA_DRIVER_NAME=nvidia vainfo --display drm
Trying display: drm
      1085.218259496 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2188       __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 31
      1085.218292970 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2197       __vaDriverInit_1_0 Now have 0 (0 max) instances
      1085.218311841 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2223       __vaDriverInit_1_0 Selecting Direct backend
      1085.314105336 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/direct/nv-driver.c: 267            init_nvdriver Initing nvdriver...
      1085.314210774 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/direct/nv-driver.c: 285            init_nvdriver NVIDIA kernel driver version: 560.35.03, major version: 560, minor version: 35
      1085.314236794 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/direct/nv-driver.c: 292            init_nvdriver Got dev info: 100 1 0 fe
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      1085.431592634 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2098              nvTerminate Terminating 0x5e6a31003a30
      1085.431742010 [13926-13926] ../nvidia-vaapi-driver-0.0.12/src/vabackend.c:2112              nvTerminate Now have 0 (0 max) instances

Offline

#6 2024-10-15 17:58:49

AmmoniumX
Member
Registered: 2024-09-27
Posts: 6

Re: [SOLVED] libva broken after system update (nvidia/wayland)

SOLUTION:
I have currently gotten krdp to work again. I'll be honest, I don't know *what* exactly solved it, was it one specific change or all of them together, but I'll include everything I changed to get it to work:

1. Update linux kernel, nvidia drivers, libva, and krdp to the current latest versions:
krdp 6.2.0-1
lib32-nvidia-utils 560.35.03-1
libva-nvidia-driver 0.0.12-1
libvdpau 1.5-3
nvidia 560.35.03-13
nvidia-settings 560.35.03-1
nvidia-utils 560.35.03-14
linux 6.11.3.arch1-1

2. Make sure KDE Plasma is running with your nvidia GPU!:
Either run "sudo nvidia-xconfig" or add this manually to /etc/X11/xorg.conf.nvidia, but make sure you set the right device number for your Nvidia GPU, mine just happened to be device 0 but for other people it sets it to device 1:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
EndSection

After this, restart and run kinfo, make sure you see your nvidia GPU under "Graphics Processor"

3. Set these variables on your /etc/environment:
QT_QPA_PLATFORM=wayland
VDPAU_DRIVER=nvidia
LIBVA_DRIVER_NAME=nvidia
__NV_PRIME_RENDER_OFFLOAD=1
__GLX_VENDOR_LIBRARY_NAME=nvidia

After doing all of that, and restarting just to be sure, krdp was finally working again smile

Offline

Board footer

Powered by FluxBB