You are not logged in.

#1 2024-02-07 21:02:54

Mizho
Member
Registered: 2021-06-23
Posts: 14

libva Configuration for hybrid Intel/NVIDIA: conflicting chrome/vainfo

I am currently using an older laptop from around 2015 equipped with an Intel i7-6700 CPU and an NVIDIA 960M GPU. Due to issues with mpv/video playback using the Intel driver, I switched to primarily using the NVIDIA driver and configured the modsetting nvidia-drm in grub. My i3wm is functioning well in this setup.

However, I'm encountering a conflicting issue with vainfo and google-chrome. The following code segment reflects the current configuration, which I have set in the /etc/environment:

>  cat /etc/environment
export VDPAU_DRIVER=nvidia
export LIBVA_DRIVER_NAME=vdpau

With the above variables set, google-chrome does work, but vainfo doesn't start. If I unset LIBVA_DRIVER_NAME, then Chrome will start, but vainfo begins giving an error:

Trying display: wayland
Trying display: x11
libva error: vaGetDriverNames() failed with unknown libva error
vaInitialize failed with error code -1 (unknown libva error),exit

I have found this setting that at least allows me to launch Google Chrome:

export VDPAU_DRIVER=nvidia
export LIBVA_DRIVER_NAME=nvidia

Though even in this case google-chrome still spits

libva error: /usr/lib/dri/nvidia_drv_video.so init failed`

.

With such a setting, vainfo also works, though it initially complains about libva:

Trying display: wayland
Trying display: x11
libva error: vaGetDriverNames() failed with unknown libva error
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: VA-API NVDEC driver [egl backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD

I'm not sure what is going on and how to fix this so that both vainfo and google-chrome work with libva!


Here is supporting info:

>> yay -Qs nvidia

local/cuda 12.3.1-2
    NVIDIA's GPU programming toolkit
local/cuda-tools 12.3.1-2
    NVIDIA's GPU programming toolkit (extra tools: nvvp, nsight)
local/cudnn 8.9.7.29-1
    NVIDIA CUDA Deep Neural Network library
local/egl-wayland 2:1.1.13-1
    EGLStream-based Wayland external platform
local/lib32-nvidia-utils 545.29.06-1
    NVIDIA drivers utilities (32-bit)
local/libva-nvidia-driver 0.0.11-1
    VA-API implementation that uses NVDEC as a backend
local/libvdpau 1.5-2
    Nvidia VDPAU library
local/libxnvctrl 545.29.06-1
    NVIDIA NV-CONTROL X extension
local/nvidia-dkms 545.29.06-3
    NVIDIA drivers - module sources
local/nvidia-prime 1.0-4
    NVIDIA Prime Render Offload configuration and utilities
local/nvidia-settings 545.29.06-1
    Tool for configuring the NVIDIA graphics driver
local/nvidia-utils 545.29.06-3
    NVIDIA drivers utilities
local/nvidia-xrun-pm-git 0.3.2.r23.g270b6c0-1
    Alternative version of nvidia-xrun, that relies on kernel PM instead of bbswitch
local/nvtop 3.0.2-1
    GPUs process monitoring for AMD, Intel and NVIDIA
local/opencl-nvidia 545.29.06-3
    OpenCL implemention for NVIDIA

~  yay -Qs libva

local/libva 2.20.0-1
    Video Acceleration (VA) API for Linux
local/libva-mesa-driver 1:23.3.5-1
    VA-API drivers
local/libva-nvidia-driver 0.0.11-1
    VA-API implementation that uses NVDEC as a backend
local/libva-utils 2.20.1-1
    Intel VA-API Media Applications and Scripts for libva

yay -Qs vdpau

local/libvdpau 1.5-2
    Nvidia VDPAU library
local/libvdpau-va-gl 0.4.2-3
    VDPAU driver with OpenGL/VAAPI backend
local/vdpauinfo 1.5-1
    Command line utility for querying the capabilities of a VDPAU device

/etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

cat /etc/environment

VDPAU_DRIVER=nvidia
#LIBVA_DRIVER_NAME=vdpau
LIBVA_DRIVER_NAME=nvidia

Last edited by Mizho (2024-02-09 04:12:42)

Offline

#2 2024-02-08 09:34:29

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: libva Configuration for hybrid Intel/NVIDIA: conflicting chrome/vainfo

local/libva-mesa-driver 1:23.3.5-1
    VA-API drivers

That driver is for for amd cards, try removing it.

Your intel integrated graphics needs intel-media-driver , is that installed ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2024-02-08 11:53:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,660

Re: libva Configuration for hybrid Intel/NVIDIA: conflicting chrome/vainfo

And generally speaking. This only makes real and true sense if you're using it with the intel card (doing it on nvidia loses all the benefits of hardware video acceleration because you have to copy the entire image accross the bus again, something you'd want to avoid). So I'd say instead of focusing on this hodgepodge what display issues were you having on the intel card?

FWIW while vainfo throws that error in the second invocation method it seems to work regardless, do you have a problem other than wondering why vaGetDriverNames fails?

Last edited by V1del (2024-02-08 11:53:40)

Offline

#4 2024-02-09 04:14:33

Mizho
Member
Registered: 2021-06-23
Posts: 14

Re: libva Configuration for hybrid Intel/NVIDIA: conflicting chrome/vainfo

Lone_Wolf wrote:

local/libva-mesa-driver 1:23.3.5-1
    VA-API drivers

That driver is for for amd cards, try removing it.

Your intel integrated graphics needs intel-media-driver , is that installed ?

Got it, Thanks!
I just remove that. Regarding the intel-media-driver it's installed.

Offline

#5 2024-02-09 04:29:42

Mizho
Member
Registered: 2021-06-23
Posts: 14

Re: libva Configuration for hybrid Intel/NVIDIA: conflicting chrome/vainfo

V1del wrote:

And generally speaking. This only makes real and true sense if you're using it with the intel card (doing it on nvidia loses all the benefits of hardware video acceleration because you have to copy the entire image accross the bus again, something you'd want to avoid). So I'd say instead of focusing on this hodgepodge what display issues were you having on the intel card?

FWIW while vainfo throws that error in the second invocation method it seems to work regardless, do you have a problem other than wondering why vaGetDriverNames fails?

Thanks, I actually had that setup months ago as it makes more sense, as you pointed out. However, probably due to an old CPU, I faced issues playing high-res video content, with both Chrome and mpv experiencing difficulties. Additionally, I encountered OS freezes due to high I/O wait (often while playing some video). I switched to a scenario where I rely solely on the NVIDIA, and those problems, at least for playing videos, disappeared. So far, I haven't noticed high I/O wait causing any issues.

V1del wrote:

FWIW while vainfo throws that error in the second invocation method it seems to work regardless, do you have a problem other than wondering why vaGetDriverNames fails?

With the current setup (in /etc/environment both set into nvidia) I don't see a problem yet other than chrome complaignging in termial:

libva error: /usr/lib/dri/nvidia_drv_video.so init failed`

haven't notice a apparant tearing or failing at playing videos.

Offline

Board footer

Powered by FluxBB