Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Question about vaapi, vdpau and friends on nvidia
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 953
Location: Romania

PostPosted: Mon Feb 17, 2025 2:53 pm    Post subject: [SOLVED] Question about vaapi, vdpau and friends on nvidia Reply with quote

I recently decided to emerge librewolf and firefox, as palemoon is having some problems.
After installing firefox, I saw this message, which seems to have been added in this commit:
Code:

   if use hwaccel && has_version "x11-drivers/nvidia-drivers"; then
      optfeature "hardware acceleration with NVIDIA cards" media-libs/nvidia-vaapi-driver
   fi

I was always under the impression that x11-drivers/nvidia-drivers implements all the hw accel in needs, but, at least according to this, it seems to no longer be the case.
After emerging media-libs/nvidia-vaapi-driver, I also took a look at the wiki: https://wiki.gentoo.org/wiki/VAAPI.
On that page, vdpau is also mentioned, so I took a look at that too: https://wiki.gentoo.org/wiki/VDPAU.

So, I started to look into it.
I enabled CONFIG_DRM and friends in the kernel: https://0x0.st/8NCV.txt
I rebuilt the kernel, and nvidia-drivers.
I added nvidia_drm.modeset=1 to the newly generated grub config.
I toggled some stuff in /etc/modprobe.d/nvidia.conf: https://bpa.st/DNUA
I emerged mesa for libgbm.
I reemerged Xorg without USE=minimal
I then did a:
Code:

USE="drm vaapi vdpau nvenc dri egl glx" doas emerge --deep --update --newuse --verbose --ask --keep-going --autounmask-write --with-bdeps=y -X sys-kernel/gentoo-sources @world

And then I emerged libva, libvdpau, vainfo, vdpauinfo, nvidia-vaapi-driver.
And then rebooted.

This is what happens if I try to run vainfo:
Code:

$ vainfo
Trying display: x11
libva info: VA-API version 1.22.0
libva error: vaGetDriverNames() failed with unknown libva error
vaInitialize failed with error code -1 (unknown libva error),exit

vdpauinfo does work: https://bpa.st/DODA

I tried to modprobe nvidia_drm, which wasn't automatically loaded, but vainfo still didn't work.

So, what's this about?
have things changed, and nvidia now needs external help with hw accel?
Am I doing something wrong with enabling vaapi?
_________________
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"


Last edited by stefan11111 on Mon Feb 17, 2025 11:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 199

PostPosted: Mon Feb 17, 2025 4:45 pm    Post subject: Reply with quote

Firefox's hwaccel USE flag description points to Mozilla bug 594876, last comment on that page is 4 years old, brings the status "wontfix", and makes me believe the hwaccel flag isn't useful at all nowadays.
_________________
Dragon Princess Music Games Heroes and villains
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 478

PostPosted: Mon Feb 17, 2025 8:40 pm    Post subject: Reply with quote

Consider using the nvidia-vaapi-driver, a "VA-API implemention using NVIDIA's NVDEC":

https://github.com/elFarto/nvidia-vaapi-driver

I have used it for some time.
Code:
Trying display: wayland
libva info: VA-API version 1.22.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /usr/lib64/va/drivers/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_12         : VAEntrypointVLD


It is only going to help with certain types of video when using Firefox. You can try setting "media.hardware-video-decoding.force-enabled" to true in about:config. You can then verify that it is enabled in about:support.
To be honest, I have not noticed any difference in performance or playback, but it might give some users peace of mind knowing their GPU is taking some of the stress off of their CPU.
Back to top
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 953
Location: Romania

PostPosted: Mon Feb 17, 2025 11:36 pm    Post subject: Reply with quote

With the help of tdr and Plakkis on irc, I was able to figure this out.
Turns out that I had to update nvidia-drivers, enable CONFIG_DRM_TTM_HELPER and make an init script that runs 'modprobe nvidia-drm'.
CONFIG_DRM_TTM_HELPER cannot be directly selected, so it has to be selected by something else.
I used CONFIG_DRM_QXL.
_________________
My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum