You are not logged in.

#1 2021-08-29 19:53:42

shrvtv
Member
Registered: 2021-07-25
Posts: 18

Troubles enabling VA-API and VDPAU

I have a laptop with hybrid graphics: AMD CPU with integrated graphics and NVIDIA GPU. I am currently using "hybrid" option with optimus-manager, it works fine. I decided to enable hardware video acceleration, using VA-API and VDPAU. However I have problems enabling them.
Installed packages:

local/nvidia-utils 470.63.01-1
    NVIDIA drivers utilities
local/libva 2.12.0-1
    Video Acceleration (VA) API for Linux
local/libva-utils 2.12.0-1
    Intel VA-API Media Applications and Scripts for libva
local/libva-vdpau-driver 0.7.4-5
    VDPAU backend for VA API
local/libvdpau 1.4-1
    Nvidia VDPAU library
local/vdpauinfo 1.4-1
    Command line utility for querying the capabilities of a VDPAU device

I did not install libva-mesa-driver and mesa-vdpau since I don't have any AMD GPU. Does the processor's integrated graphics need these packages?
I ran vainfo and vdpauinfo without modifying the environment variables and they didn't work. Then I changed the /etc/environvment to this and rebooted:

# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
LIBVA_DRIVER_NAME=vdpau
VDPAU_DRIVER=nvidia

And here's the output from vainfo and vdpauinfo after reboot:

computer% vainfo
zsh: floating point exception (core dumped)  vainfo
computer% vdpauinfo
display: :1   screen: 0
Error creating VDPAU device: 1
computer% sudo -i
[root@computer ~]# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
Floating point exception (core dumped)
[root@computer ~]# vdpauinfo
display: :1   screen: 0
Error creating VDPAU device: 1

What should I do in order to make hardware acceleration work?

Offline

#2 2021-08-29 20:06:47

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,223

Re: Troubles enabling VA-API and VDPAU

You need to install those packages you've identified if you want to HW accelerate on the AMD GPU. Which is probably going to be better for the purposes of what people usually use HW acceleration for. If you want to piggy back this on the nvidia card you start a lot of work that could be avoided if the formats are supported by the amd gpu directly.

Offline

#3 2021-08-29 20:19:50

shrvtv
Member
Registered: 2021-07-25
Posts: 18

Re: Troubles enabling VA-API and VDPAU

V1del wrote:

You need to install those packages you've identified if you want to HW accelerate on the AMD GPU. Which is probably going to be better for the purposes of what people usually use HW acceleration for. If you want to piggy back this on the nvidia card you start a lot of work that could be avoided if the formats are supported by the amd gpu directly.

How worse will that be compared to using the dedicated graphics? I mean, if I have nvidia ready to work, that would be a crime not to use it

Offline

#4 2021-08-29 20:32:17

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,223

Re: Troubles enabling VA-API and VDPAU

Well you need to talk to the nvidia card, so either switch to discrete mode completely or run vdpauinfo through prime-run though I do not know how well that works for the purpose of video accel.

People usually use HW accel to get load off the CPU and bypass some unnecessary screen copies because the HW can directly output the decoded frame to the screen. The latter of which is by definition impossible with the  normal dedicated card setup, so you are likely going to have generally better perf characteristics if you leave the acceleration to the integrated gpu.

Also which gpus exactly? There are certain models that do not have the video accleration HW: https://bbs.archlinux.org/viewtopic.php?id=269090

Offline

#5 2021-08-29 20:58:50

shrvtv
Member
Registered: 2021-07-25
Posts: 18

Re: Troubles enabling VA-API and VDPAU

V1del wrote:

Well you need to talk to the nvidia card, so either switch to discrete mode completely or run vdpauinfo through prime-run though I do not know how well that works for the purpose of video accel.

People usually use HW accel to get load off the CPU and bypass some unnecessary screen copies because the HW can directly output the decoded frame to the screen. The latter of which is by definition impossible with the  normal dedicated card setup, so you are likely going to have generally better perf characteristics if you leave the acceleration to the integrated gpu.

Also which gpus exactly? There are certain models that do not have the video accleration HW: https://bbs.archlinux.org/viewtopic.php?id=269090

GPU is GeForce 1660 ti, I am pretty sure it supports HW.
I have installed the packages for AMD and they work when I disable some environment variables. Here's more info:

The output looks like mess and I can't properly format it properly here, so I uploaded it to pastebin

No environment variables are present:                                                    https://pastebin.com/TTGNba9J
With just LIBVA_DRIVER_NAME=vdpau                                                https://pastebin.com/aBwEuQde
With just VDPAU_DRIVER=nvidia                                                          https://pastebin.com/8PgYQ7bB
With VDPAU_DRIVER=nvidia and LIBVA_DRIVER_NAME=vdpau       https://pastebin.com/ckEhsuyE

Last edited by shrvtv (2021-08-29 21:00:00)

Offline

#6 2021-08-30 09:11:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,223

Re: Troubles enabling VA-API and VDPAU

None of this surprises me. If this works in any shape or form which I'm not sure about, when using the hybrid mode of operation you need to run prime-run from the nvidia-prime package before the relevant vainfo/vdpau command, though I'm not sure whether the vdpau libs have been adjusted to account for this.

If that doesn't work it will work if you switch to dedicated mode, with the obvious power management caveats that will have.

Offline

#7 2021-08-30 09:37:54

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: Troubles enabling VA-API and VDPAU

prime-run should work I guess, but the performance is another question. Oh, libva-vdpau might still cause issues. It does even on normal setups.

With a hybrid intel/amd graphics, I need DRI_PRIME as well as LIBVA_DRIVER_NAME to decode on the dedicated gpu, but it works.

Last edited by progandy (2021-08-30 09:41:44)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB