Hardware Video Acceleration on Browsers with Nvidia Proprietary Driver?

Is it possible to get hardware acceleration on firefox or chrome with a nvidia gpu and nvidia proprietary drivers? I can not enable va-api.

Yes it is. You need to have nvidia-utils package according to the arch wiki. What is the output of vainfo and vdpauinfo?

yes I have nvidia-utils. vainfo returns error -1.

vdpauinfo                                            127 ✘  24s  
display: :1   screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library  495.46  Wed Oct 27 16:20:01 UTC 2021

Video surface:

name   width height types
-------------------------------------------
420     8192  8192  NV12 YV12 
422     8192  8192  UYVY YUYV 
444     8192  8192  NV24 YV24 
420_16  8192  8192  P010 P016 
422_16  8192  8192  UYVY YUYV 
444_16  8192  8192  Y_U_V_444_16 

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                           0 65536  4096  4096
MPEG2_SIMPLE                    3 65536  4096  4096
MPEG2_MAIN                      3 65536  4096  4096
H264_BASELINE                  51 65536  4096  4096
H264_MAIN                      51 65536  4096  4096
H264_HIGH                      51 65536  4096  4096
VC1_SIMPLE                      1  8190  2048  2048
VC1_MAIN                        2  8190  2048  2048
VC1_ADVANCED                    4  8190  2048  2048
MPEG4_PART2_SP                  3  8192  2048  2048
MPEG4_PART2_ASP                 5  8192  2048  2048
DIVX4_QMOBILE                   0  8192  2048  2048
DIVX4_MOBILE                    0  8192  2048  2048
DIVX4_HOME_THEATER              0  8192  2048  2048
DIVX4_HD_1080P                  0  8192  2048  2048
DIVX5_QMOBILE                   0  8192  2048  2048
DIVX5_MOBILE                    0  8192  2048  2048
DIVX5_HOME_THEATER              0  8192  2048  2048
DIVX5_HD_1080P                  0  8192  2048  2048
H264_CONSTRAINED_BASELINE      51 65536  4096  4096
H264_EXTENDED                  51 65536  4096  4096
H264_PROGRESSIVE_HIGH          51 65536  4096  4096
H264_CONSTRAINED_HIGH          51 65536  4096  4096
H264_HIGH_444_PREDICTIVE       51 65536  4096  4096
VP9_PROFILE_0                   1 262144  8192  8192
VP9_PROFILE_1                  --- not supported ---
VP9_PROFILE_2                   1 262144  8192  8192
VP9_PROFILE_3                  --- not supported ---
HEVC_MAIN                      153 262144  8192  8192
HEVC_MAIN_10                   153 262144  8192  8192
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   153 262144  8192  8192
HEVC_MAIN_444                  --- not supported ---
HEVC_MAIN_444_10               --- not supported ---
HEVC_MAIN_444_12               --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8         32768 32768    y  Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8 
R10G10B10A2      32768 32768    y  Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8 

Bitmap surface:

name              width height
------------------------------
B8G8R8A8         32768 32768
R8G8B8A8         32768 32768
R10G10B10A2      32768 32768
B10G10R10A2      32768 32768
A8               32768 32768

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             y
DEINTERLACE_TEMPORAL_SPATIAL     y
INVERSE_TELECINE                 y
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                         y
HIGH QUALITY SCALING - L1        y
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y         1     8192
VIDEO_SURFACE_HEIGHT             y         1     8192
CHROMA_TYPE                      y  
LAYERS                           y         0        4

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 y  
CSC_MATRIX                       y  
NOISE_REDUCTION_LEVEL            y      0.00     1.00
SHARPNESS_LEVEL                  y     -1.00     1.00
LUMA_KEY_MIN_LUMA                y  
LUMA_KEY_MAX_LUMA                y

Run these commands and share full output:

export VDPAU_DRIVER=nvidia
vainfo
 export VDPAU_DRIVER=nvidia                                       ✔ 
    ~  vainfo                                                           ✔ 
vaInitialize failed with error code -1 (unknown libva error),exit
export LIBVA_DRIVER_NAME=vdpau
vainfo

See this if it doesn’t work:

https://wiki.archlinux.org/title/Hardware_video_acceleration#Configuring_VA-API

same error
i have tried LIBVA_DRIVER_NAME=vdpau in /etc/environment & tried LIBVA_DRIVERS_PATH=/usr/lib/dri/nouveau_dri.so

not working
@Mirdarthos any idea?

None, whatsoever.

Edit:

It seems vainfo is part of the libva-utils package:

$ vainfo
zsh: correct 'vainfo' to 'aainfo' [nyae]? n
find-the-command: "vainfo" is not found locally, searching in repositories...

"vainfo" may be found in package "community/libva-utils"

What would you like to do?
1) install               2) info                  3) list files            4) list files (paged)
Action (0 to abort): 0

So check that it’s installed:

$ pamac search libva-utils
[...]
libva-utils                                                                                                                                                                                                   2.13.0-1                            community
Intel VA-API Media Applications and Scripts for libva

And if not, install it with:

pamac install libva-utils

And see if that helps. I honestly don’t know.

:man_shrugging:

I’m out of my dept and guessing at this point.

Yes I already have that installed.

What report the settings of Firefox itself ?

Compositing is set to WebRender. Now I have to enable va-api

what is the output of inxi -G?

Do you use X11 or Wayland ?

inxi -G                                                          ✔ 
Graphics:
  Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] driver: nvidia v: 495.46
  Device-2: Logitech Webcam C310 type: USB driver: snd-usb-audio,uvcvideo
  Display: x11 server: X.org 1.21.1.3 driver: loaded: nvidia
    resolution: <missing: xdpyinfo>
  Message: Unable to show advanced data. Required tool glxinfo missing.

Using x11

First of all: Firefox doesn’t support VAAPI-VDPAU driver as this one is really old and doesn’t support technologies requested by FF.

There’s new driver that’s written for Firefox and maps VAAPI to NVDEC.

Just install AUR (en) - nvidia-vaapi-driver-git and set all things that are listed on GitHub page. Only 470 series drivers and above are supported.

2 Likes

It says, “It’s currently in early development, so don’t expect it to work well”. So I will use this later.

Is this also the case with Google Chrome regarding hardware acceleration?

Well you don’t have any alternatives for Firefox atm, only software or this. I’m using it fine for two weeks already without any major problems.

I don’t know much about how Chrome does this but I think for Chrome you should stick to VDPAU driver, this one doesn’t support it though the author is considering adding it’s support in future.

1 Like

Wow… I’ll give it a try then