You are not logged in.

#1 2024-06-24 15:37:19

rokendha
Member
Registered: 2024-06-24
Posts: 12

[SOLVED] VA-API/VDPAU problems

Hello.
I have a problem. I was installing hardware video acceleration according to this official instruction.
I have installed the libva-nvidia-driver. I followed all the instructions carefully and decided to check vdpauinfo. It wasn't working.

The output:

display: :0.0   screen: 0
Error creating VDPAU device: 1

vainfo works without errors BUT after leaving the hibernation errors appear:

Trying display: wayland
Trying display: x11
libva error: /usr/lib/dri/nvidia_drv_video.so init failed
vaInitialize failed with error code 1 (operation failed),exit

lspci -k | grep -A 2 -E "(VGA|3D)" output:

00:02.0 VGA compatible controller: Intel Corporation CometLake-H GT2 [UHD Graphics] (rev 05)
	Subsystem: Lenovo Device 3fbc
	Kernel driver in use: i915
--
01:00.0 VGA compatible controller: NVIDIA Corporation TU116M [GeForce GTX 1660 Ti Mobile] (rev a1)
	Subsystem: Lenovo Device 3fbc
	Kernel driver in use: nvidia

pacman -Q | grep vdpau output:

libvdpau 1.5-2
libvdpau-va-gl 0.4.2-3
vdpauinfo 1.5-1

uname -r:

6.6.35-2-lts

Environment variable settings:

BROWSER=firefox
EDITOR=nano
LC_ALL=en_US.UTF-8
LIBVA_DRIVER_NAME=nvidia
VDPAU_DRIVER=nvidia
NVD_BACKEND=direct
MOZ_DISABLE_RDD_SANDBOX=1
__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json

Thanks.
P.S. Tell me please where can I read/learn more about VA-API, VDPAU, NVDEC/NVENC? There is very little information on the Internet regarding this.

Last edited by rokendha (2024-06-27 16:06:36)

Offline

#2 2024-06-25 13:05:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,167

Re: [SOLVED] VA-API/VDPAU problems

In such a setup your screen is not actually connected to the nvidia card (unless you're on HDMI) and VDPAU might check for that. Does DRI_PRIME=1 vdpauinfo work?

As for the question, these all are different APIs for enabling hardware accelerated video decoding/encoding. VDPAU existed first, intel didn't agree wrote VAAPI and now which one works depends on your actual application. Generally speaking VAAPI seems to have gained favor especially in the browser implementations so likely can be looked at as the primary generic implementation you're likely to encounter. NVDEC/NVENC are newer nvidia specific variants, you'll likely to not often directly integrate with those unless using it for encoding video streams with ffmpeg and friends directly. For most "normal display acceleration" usecases you're likely to run into VAAPI which you bend to NVDEC via libva-nvidia-driver.

Also note that if this is really a system with hybrid graphics and your primary screen being the laptop screen connected to the intel GPU, you're likely to get generally better performance by doing vaapi and friends on the integrated rather than the nvidia GPU. Because by the way these systems work, you introduce an additional copy overhead copying the image the nvidia card renders over to the intel GPU for display, something which you'd normally want to avoid and being one of the reasons you'd want to use video acceleration in the first place.

Offline

#3 2024-06-25 14:41:07

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

No, command

DRI_PRIME=1

gives the same error:

display: :0.0   screen: 0
Error creating VDPAU device: 1

Moreover, when I use this environment variable, I got the next error:

glx: failed to create dri3 screen
failed to load driver: nouveau

But I use only proprietary drivers for Nvidia GPU, nouveau isn't installed at all.

Offline

#4 2024-06-25 15:35:09

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

One more question, how are OpenGL and Vulkan connected with using GPU and API's above?

Offline

#5 2024-06-26 10:28:56

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,439

Re: [SOLVED] VA-API/VDPAU problems

One more question, how are OpenGL and Vulkan connected with using GPU and API's above?

Not connected, vaapi /vdpau (try to) communicate directly with the hardware and don't use OpenGL or Vulkan .

LIBVA_DRIVER_NAME=nvidia
VDPAU_DRIVER=nvidia
NVD_BACKEND=direct
MOZ_DISABLE_RDD_SANDBOX=1
__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json

Do those come from documentation of other distro's ? Please remove them for now .

Your symptoms look like they may be caused by low level configuration errors in your graphics setup .

run (as root)

# journalctl -b | curl -F 'file=@-' 0x0.st

.
It will output a link, post that link .

X or wayland ?
WM/DE/wayland compositor ?


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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2024-06-26 16:03:19

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

Lone_Wolf wrote:

Do those come from documentation of other distro's ? Please remove them for now .

Done.

Lone_Wolf wrote:

It will output a link, post that link .

Link: https://0x0.st/XmcD.txt

Lone_Wolf wrote:

X or wayland ?
WM/DE/wayland compositor ?

X11. DE: xfce4, WM: xfwm4

Last edited by rokendha (2024-06-26 16:10:09)

Offline

#7 2024-06-26 19:00:28

seth
Member
Registered: 2012-09-03
Posts: 61,907

Re: [SOLVED] VA-API/VDPAU problems

Done.

And what is the impact of that (after a re-login)?

Offline

#8 2024-06-26 20:02:20

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

seth wrote:

And what is the impact of that (after a re-login)?

vainfo and vdpauinfo works but not Nvidia GPU, system uses integrated Intel GPU.

My goal was to configure hardware acceleration on Nvidia, but considering that many people advise using the integrated GPU of the processor, I think I will do so.

Last edited by rokendha (2024-06-26 20:04:31)

Offline

#9 2024-06-26 20:03:37

seth
Member
Registered: 2012-09-03
Posts: 61,907

Re: [SOLVED] VA-API/VDPAU problems

V1del wrote:

you're likely to get generally better performance by doing vaapi and friends on the integrated rather than the nvidia GPU. Because by the way these systems work, you introduce an additional copy overhead copying the image the nvidia card renders over to the intel GPU for display

What are you trying to achieve and why?

Offline

#10 2024-06-26 20:06:42

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

seth wrote:

What are you trying to achieve and why?

Excuse me, is it a question for me?

Last edited by rokendha (2024-06-26 20:07:33)

Offline

#11 2024-06-26 20:07:46

seth
Member
Registered: 2012-09-03
Posts: 61,907

Re: [SOLVED] VA-API/VDPAU problems

Yes. Did you read and understand V1del's comment? Do you disagree? Why?

Offline

#12 2024-06-26 20:15:47

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

I have read and understood the V1del's comment. I fully agree.
I'm just curious to know what caused the inability to configure hardware video acceleration for Nvidia. If any errors appear, then, of course, it is caused by something...

Last edited by rokendha (2024-06-26 20:16:16)

Offline

#13 2024-06-26 20:17:40

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

Otherwise, if the solution boils down to just using an integrated Intel GPU, then it seems possible to close this topic for discussion.

Offline

#14 2024-06-26 20:22:39

seth
Member
Registered: 2012-09-03
Posts: 61,907

Re: [SOLVED] VA-API/VDPAU problems

https://archlinux.org/packages/extra/any/nvidia-prime/

prime-run glxinfo -B # to check general function
VDPAU_DRIVER=nvidia prime-run vdpauinfo # check VDPAU

Edit: that's less of a solution to some problem but indeed the suggested, because likely superior, approach.

Last edited by seth (2024-06-26 20:23:55)

Offline

#15 2024-06-26 20:27:09

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

Unfortunately, it also doesn't work. Nevertheless, thank you for your help.
Error is the same as it was at the beginning:

VDPAU_DRIVER=nvidia prime-run vdpauinfo
display: :0.0   screen: 0
Error creating VDPAU device: 1

Offline

#16 2024-06-26 22:35:50

seth
Member
Registered: 2012-09-03
Posts: 61,907

Re: [SOLVED] VA-API/VDPAU problems

ls /dev/nvidia*
VDPAU_DRIVER=nvidia strace vdpauinfo |& curl -F 'file=@-' 0x0.st

Offline

#17 2024-06-27 04:31:47

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

/dev/nvidia0  /dev/nvidiactl  /dev/nvidia-modeset  /dev/nvidia-uvm  /dev/nvidia-uvm-tools
http://0x0.st/Xmu7.txt

Offline

#18 2024-06-27 06:49:53

seth
Member
Registered: 2012-09-03
Posts: 61,907

Re: [SOLVED] VA-API/VDPAU problems

That's not the problem - the situation shows up quite some in google results.

Jun 26 18:55:16 max-pax-halifax kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-2
Jun 26 18:55:16 max-pax-halifax systemd[1]: Started NVIDIA Persistence Daemon.
Jun 26 18:55:16 max-pax-halifax kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-2
Jun 26 18:55:16 max-pax-halifax kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1

Are there any outputs attached to the nvidia GPU?

Jun 26 18:55:14 max-pax-halifax systemd[1]: Starting Optimus Manager Commands Daemon...
Jun 26 18:55:14 max-pax-halifax python3[618]: [14] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
Jun 26 18:55:14 max-pax-halifax python3[618]: [14] INFO: Copying /etc/optimus-manager/optimus-manager.conf to /var/lib/optimus-manager/tmp/config_copy.conf
Jun 26 18:55:16 max-pax-halifax python3[651]: [1276] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
Jun 26 18:55:16 max-pax-halifax systemd[1]: Started Optimus Manager Commands Daemon.
Jun 26 18:55:17 max-pax-halifax lightdm[915]: [7] INFO: Running /etc/optimus-manager/xsetup-hybrid.sh

Get rid of optimus-manager.

Offline

#19 2024-06-27 11:19:56

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

seth wrote:

Get rid of optimus-manager.

Done.

seth wrote:

Are there any outputs attached to the nvidia GPU?

I think no. I use my laptop (with eDP-1 screen, by the way, not the DP-2 as it mentioned in the log). There aren't any external displays.

Offline

#20 2024-06-27 13:14:00

seth
Member
Registered: 2012-09-03
Posts: 61,907

Re: [SOLVED] VA-API/VDPAU problems

This might be a critical factor (if removing OM hasn't achieved anything)
You could try to attach one or explicitly redirect the nvidia output, https://wiki.archlinux.org/title/PRIME# … offloading but just as a quick reminder: the sane thing here is still to render the video on the IGP

Offline

#21 2024-06-27 14:07:38

rokendha
Member
Registered: 2024-06-24
Posts: 12

Re: [SOLVED] VA-API/VDPAU problems

Thank you for your help. Unfortunately, I haven't another displays and explicit redirecting the nvidia output doesn't work.
All in all, it will be really sane to use IGP. Let it be.

Offline

Board footer

Powered by FluxBB