You are not logged in.

#1 2022-10-18 14:11:16

Leonida12
Member
Registered: 2022-10-13
Posts: 15

browser hardware acceleration with nvidia gpu

Well sorry for posting too much in these days, but i would to set my main requirements to work. Also this is the first forum where i found real expert collaboration so I exploit it.

Coming to the problem, i would enable hardware acceleration video decoding (and encoding if possible) with my NVIDIA gpu. My system is a laptop (Dell G5590) with an Intel UHD Graphics 630 and a NVIDIA GeForce GTX 1660 Ti Mobile . I successfully configured the PRIME render offloading and i run my wanted-gpu application with prime-run as prefix.
I don't care which browser I've to use (i would prefer Firefox) but the hardware acceleration with dGPU must work because my iGPU performs bad and overheats the laptop.
I've read this: https://wiki.archlinux.org/title/Hardwa … celeration and i installed nvidia-utils as i'm using the NVIDIA proprietary driver.
Then i setted those two global variable (and i rebooted):

LIBVA_DRIVER_NAME=nvidia
VDPAU_DRIVER=nvidia

vainfo:

vaInitialize failed with error code -1 (unknown libva error),exit

vdpauinfo:

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

sudo journalctl -b --grep='vdpau | dri driver' :

ott 18 13:12:12 MARKVII /usr/lib/gdm-x-session[863]: (II) modeset(0): [DRI2]   DRI driver: iris
ott 18 13:12:12 MARKVII /usr/lib/gdm-x-session[863]: (II) modeset(0): [DRI2]   VDPAU driver: va_gl
ott 18 13:12:12 MARKVII /usr/lib/gdm-x-session[863]: (II) NVIDIA(G0): [DRI2]   VDPAU driver: nvidia
ott 18 16:04:28 MARKVII dbus-daemon[753]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-o>
ott 18 16:04:32 MARKVII sudo[15506]: leonida12 : TTY=pts/0 ; PWD=/home/leonida12 ; USER=root ; COMMAND=/usr/bin/journalctl ->
lines 1-5/5 (END)

I guess the vainfo output is correct, as the NVIDIA closed source driver doesn't support VA-API natively. However this driver supports VDPAU, NVDECODE and NVENCODE (the latter requires the nvidia_uvm module and an udev rule) and the vdpauinfo command should work correctly.

Then i tried both libva-vdpau-driver and libva-nvidia-driver traslation layers following the instruction provided for Firefox but it still use the iGPU. The vainfo with libva-nvidia-driver is correctly showed, instead with libva-vdpau-driver vainfo gives a floating point error.

Thanks in advance.

Last edited by Leonida12 (2022-10-18 14:15:22)

Offline

#2 2022-10-18 20:49:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: browser hardware acceleration with nvidia gpu

Then i set those two global variable

Don't. It collides w/

i run my wanted-gpu application with prime-run as prefix

prime-run is a bash script that sets some environment variables.

Try

LIBVA_DRIVER_NAME=nvidia VDPAU_DRIVER=nvidia DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia vainfo
LIBVA_DRIVER_NAME=nvidia VDPAU_DRIVER=nvidia DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia vdpauinfo

Offline

#3 2022-10-19 12:10:04

Leonida12
Member
Registered: 2022-10-13
Posts: 15

Re: browser hardware acceleration with nvidia gpu

I removed the global variables and I've rebooted but i got the same errors:

LIBVA_DRIVER_NAME=nvidia VDPAU_DRIVER=nvidia DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia vainfo

vaInitialize failed with error code -1 (unknown libva error),exit

LIBVA_DRIVER_NAME=nvidia VDPAU_DRIVER=nvidia DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia vdpauinfo

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

I've also checked that bot the variables are empty.
Also i know that prime-run is a script that sets some variables, but it should not set LIBVA_DRIVER_NAME and VDPAU_DRIVER right?

Last edited by Leonida12 (2022-10-19 12:12:10)

Offline

#4 2022-10-19 12:29:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: browser hardware acceleration with nvidia gpu

It doesn't.

Please post your xorg log, https://wiki.archlinux.org/title/Xorg#General and the output of "prime-run glxinfo -B"

Do you https://wiki.archlinux.org/title/NVIDIA … de_setting ?

Offline

#5 2022-10-19 15:06:30

Leonida12
Member
Registered: 2022-10-13
Posts: 15

Re: browser hardware acceleration with nvidia gpu

Xorg.0.log: https://pastebin.com/raw/1kP8PWRJ
Xorg.1.log: https://pastebin.com/raw/JdExm0B2

prime-run glxinfo -B: https://pastebin.com/raw/Fnse53ER

Of course I set the drm kernel parameter:
cat /proc/cmdline

rw quiet bgrt_disable cryptdevice=UUID=eb86bdea-161b-4388-ba2a-f5efc4a85963:cryptlvm root=/dev/MyVolGroup/root nvidia_drm.modeset=1

I've to precise that I've no libva translation layer installed at the moment.


PS: I don't know why I have two Xorg log, I've only the laptop monitor xD.

Offline

#6 2022-10-19 15:44:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: browser hardware acceleration with nvidia gpu

export VDPAU_TRACE=2
export VDPAU_NVIDIA_DEBUG=3
export VDPAU_TRACE_FILE=vdpau.log
export VDPAU_DRIVER=nvidia
export DRI_PRIME=1
prime-run vdpauinfo

and check the vdpau.log

Offline

#7 2022-10-19 15:51:42

Leonida12
Member
Registered: 2022-10-13
Posts: 15

Re: browser hardware acceleration with nvidia gpu

vdpauinfo

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

cat vdpau.log

VDPAU capture: Enabled
vdp_imp_device_create_x11(0x565332789f40, 0, -, -)
    -> 1

Offline

#8 2022-10-19 16:11:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: browser hardware acceleration with nvidia gpu

Does it worl if you ring the X11 server on the nvidia GPU?
Edit: https://wiki.archlinux.org/title/NVIDIA … phics_only

Last edited by seth (2022-10-19 16:11:46)

Offline

#9 2022-10-19 17:02:19

Leonida12
Member
Registered: 2022-10-13
Posts: 15

Re: browser hardware acceleration with nvidia gpu

I'll try the NVIDIA Graphics only configuration. However it's not well suitable for a laptop... is it not better to try to enable the CUDA NVDECODE based backend for VA-API with the libva-nvidia-driver?

Offline

#10 2022-10-19 20:14:09

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: browser hardware acceleration with nvidia gpu

If you're running the browser on the nvidia chip anyway, how much time would the GPU actually be powered down?
The most battery conserving way would likely be to deactivate the IGP in the BIOS (if possible)

afaiu vaapi didn't work either?

Offline

#11 2022-10-19 23:01:43

Leonida12
Member
Registered: 2022-10-13
Posts: 15

Re: browser hardware acceleration with nvidia gpu

Well i would run the browser with the dGPU only when I've to watch series or films.
With NVIDIA Graphics only:
vainfo: https://pastebin.com/raw/DtnzAtvD
vdpauinfo: https://pastebin.com/raw/M8KbsgwK

However, my temps are noticeably higher, and I can't run the laptop in this mode all day. Moreover, I checked that I can't disable the iGPU in the BIOS so i I'll be back to PRIME Offloading.

Offline

#12 2022-10-20 06:06:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,461

Re: browser hardware acceleration with nvidia gpu

Are you sure the IGP is used at all when "watch series or films" and you're not decoding in software?
eg. if the video is AV1, because that's not supported by the nvidia decoder, maybe post vainfo and vdpauinfo for the IGP and nb. that just because HW acceleration works, that doesn't mean at all that your browser is using it.

Try to play a video w/ mpv and see what impact that has in comparism.

Offline

#13 2022-10-20 11:48:10

Leonida12
Member
Registered: 2022-10-13
Posts: 15

Re: browser hardware acceleration with nvidia gpu

Few days ago I succesfully enabled VA-API for iGPU and I checked that It works in video larger than 720p with both intel_gpu_top and developer tools. Then i disabled It because the iGPU just can't hold high quality videos (the videos play well but with frequent stutters).
I'll try to do some checks with mpv.

Offline

#14 2022-10-21 14:51:41

Leonida12
Member
Registered: 2022-10-13
Posts: 15

Re: browser hardware acceleration with nvidia gpu

After some tests i can confirm that the NVIDIA vdpau library works with both mpv and vlc  (prepending prime-run). However i still can't get it to work with Firefox. I tried all the translations layers but none of those work with Firefox. I don't know if they work with Chromium but I'm using Firefox also on mobile so I stay with this.
I just configured VA-API for iGPU and so Firefox, and VDPAU/NVDEC with dGPU for all the rest of applications.

I don't know if I should consider this post solved...

Offline

Board footer

Powered by FluxBB