You are not logged in.

#1 2024-02-18 07:53:57

pointyjayhawk
Member
From: India
Registered: 2021-03-25
Posts: 20

Hardware acceleration not working on nvidia [intel+nvidia laptop]

So my laptop is from 2016 with these specs:
Make: Asus Vivobook X556UQK
CPU: Intel Core i5 7200U
GPU: Intel HD graphics 620 and Nvidia Geforce 940MX 2GB
Nvidia driver: nvidia-lts 1:545.29.06-20

I used to run fedora before this Archlinux, i had working Hardware Acceleration using Nvidia without any problem, and mpv respected the config to use hwdec=nvidia or nvdec, now from sometime the HW acceleration doesn't seem to work at all on arch, I use this to determine whether it's working or not

mpv --hwdec=all --hwdec-codecs=all video.mp4

and i get bunch of errors like:

[ffmpeg/video] h264: Hardware is lacking required capabilities
[ffmpeg/video] h264: Failed setup for format cuda: hwaccel initialisation returned error.
[vaapi] libva: vaGetDriverNames() failed with unknown libva error
[ffmpeg/video] h264: Hardware is lacking required capabilities
[ffmpeg/video] h264: Failed setup for format cuda: hwaccel initialisation returned error.
[ffmpeg/video] h264: No support for codec h264 profile 77.
[ffmpeg/video] h264: Failed setup for format vaapi: hwaccel initialisation returned error.

I know that my laptop is using nvidia gpu only as below command returns is:

glxinfo | grep -E "OpenGL vendor|OpenGL renderer"

output: 
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce 940MX/PCIe/SSE2

First thing i did is to verify which wiki says to run vainfo, which gives me:

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

then i did what archwiki says to set env variables in /etc/environment but it didn't worked!

and running this command gives:

grep -iE 'vdpau | dri driver' /var/log/Xorg.0.log

output:
[    48.644] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia
[    49.141] (II) modeset(G0): [DRI2]   DRI driver: iris
[    49.141] (II) modeset(G0): [DRI2]   VDPAU driver: va_gl

I use mpv a lot on this old laptop & using only nvidia gpu is a necessity for me, and HW Acceleration can make the video playback so smooth for me because currently any video which is bigger than 2GB lags a lot, can anyone point me into right direction?

Offline

#2 2024-02-18 17:49:05

yochananmarqos
Member
Registered: 2020-02-05
Posts: 222

Re: Hardware acceleration not working on nvidia [intel+nvidia laptop]

pointyjayhawk wrote:

i did what archwiki says to set env variables in /etc/environment but it didn't worked!

What didn't work? Did you try setting LIBVA_DRIVER_NAME=nvidia?

Offline

#3 2024-02-18 20:53:35

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

Re: Hardware acceleration not working on nvidia [intel+nvidia laptop]

mpv --hwdec=vdpau video.mp4

For VA you'll need a https://wiki.archlinux.org/title/Hardwa … ion_layers

Offline

#4 2024-02-19 00:01:43

pointyjayhawk
Member
From: India
Registered: 2021-03-25
Posts: 20

Re: Hardware acceleration not working on nvidia [intel+nvidia laptop]

yochananmarqos wrote:
pointyjayhawk wrote:

i did what archwiki says to set env variables in /etc/environment but it didn't worked!

What didn't work? Did you try setting LIBVA_DRIVER_NAME=nvidia?

Yes as I told, I read and tried whatever variables needed to be set like "LIBVA_DRIVER_NAME=nvidia", "VDPAU_DRIVER=nvidia" and "DRI_PRIME=1" in /etc/environment file and VA didn't worked.

Offline

#5 2024-02-19 00:07:39

pointyjayhawk
Member
From: India
Registered: 2021-03-25
Posts: 20

Re: Hardware acceleration not working on nvidia [intel+nvidia laptop]

seth wrote:
mpv --hwdec=vdpau video.mp4

For VA you'll need a https://wiki.archlinux.org/title/Hardwa … ion_layers

Yes as i use nvidia as a primary gpu so "libva-nvidia-driver" is installed, if i try to install "libva-vdpau-driver" then these 2 are in conflict.

Offline

#6 2024-02-19 08:10:02

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

Re: Hardware acceleration not working on nvidia [intel+nvidia laptop]

Yes, you'd need *one* vdpau => vaapi mapper, have you tried to use vdpau?
As long as vainfo doesn't work, using vaapi for mpv won't either.

I read and tried whatever variables needed to be set like "LIBVA_DRIVER_NAME=nvidia", "VDPAU_DRIVER=nvidia" and "DRI_PRIME=1" in /etc/environment file
printenv | grep nvidia

Offline

Board footer

Powered by FluxBB