How can I enable VAAPI video acceleration for Nouveau?

I have a hybrid Intel + NVIDIA laptop. When I playback videos in Celluloid with hwdec enabled, I do get hardware decoding…but only on my Intel iGPU. I checked this with Resources; it’s at 100% GPU utilization when playing back a 4k video and it’s just not enough. My NVIDIA GPU, meanwhile, is at 0% GPU utilization.

I don’t want to use the proprietary NVIDIA drivers. I want to use Nouveau and Mesa. My understanding is Nouveau has VAAPI support. Am I wrong?

How do I enable VAAPI acceleration for Nouveau so I can utilize my NVIDIA GPU?

For the purposes of this question, I’m playing back VP9, but it shouldn’t matter what codec it is with the Flathub drivers anyway.

Nouveau supports VAAPI on certain Nvidia hardware. You should provide details of your hardware so others with similar hardware can comment on their experiences.

Have you installed nvidia-gpu-firmware.noarch?

Arch often has the best linux documentation: Hardware Video Acceleration.

:sob: We’re gonna get better with our Docs ! :muscle:t5: :fedora:

The most recently supported Nouveau / NVidia GPU for hardware Acceleration is GTX 750. Any newer cards would need to use the Nvidia Proprietary drivers for Hardware features.

GNOME Settings identifies my card as “NV166”; Resources identifies my card as NVIDIA RTX 2060 Mobile.

My understanding was everything after the 20xx series had been unlocked by the firmware, which brings me to…

I’m on Silverblue and don’t have any packages layered. Isn’t this installed by default in the base image? I thought Fedora made exceptions about proprietary software when it came to firmware blobs, and there doesn’t seem like any reason not to install it by default.

Result of rpm -qa nvidia-gpu-firmware gives me:

nvidia-gpu-firmware-20240513-1.fc40.noarch

So, probably!

I actually already visited the Arch documentation before posting this. I couldn’t figure out how to get it working, so I came here :slight_smile:

Also, I don’t think it matters whether I have the firmware installed because I’m using Flatpak Celluloid to play the video. I assume Flathub ships the firmware. Unless this isn’t userspace?

Oh. I had visited the Nouveau site but I was hoping that was inaccurate and wildly out of date. Hasn’t the recent progress with the GSP unlocking stuff made it so Nouveau developers could work on stuff that’s been blocked for a long time? Is this not one of those things?

Okay, okay, what about Vulkan Video? Does that help me any? mpv has support for it if I remember rightly.

I don’t think any of the open source material will work for what you are trying to achieve outside of not using Nvidia. rustcli and other things are not ready or have mixed results.

Here are some other things to try :

referencing using an Environment variable LIBVA_DRIVER_NAME=gallium which I assume would be (on Wayland) /etc/environment

Also :
The date of these articles coincide with the Generation of GTX cards I mentioned earlier.

Also Also, worth the shout is Zink Vulkan for the VA-API support.

https://www.reddit.com/r/linux_gaming/comments/qwq4j2/experimental_zink_on_nvidias_vulkan_driver/

https://gallium.readthedocs.io/en/latest/gallium/drivers/zink.html

1 Like

I tried:

flatpak run --env=LIBVA_DRIVER_NAME=gallium io.github.celluloid_player.Celluloid
flatpak run --env=LIBVA_DRIVER_NAME=nouveau io.github.celluloid_player.Celluloid

No dice, unfortunately.

I guess the next stable Freedesktop Runtime in August will have the new stable release of Mesa with NVK and Zink included and I can try it out again then!

1 Like

Could be more you can do, but building it yourself will be a big part of that. There are thread of people trying it out, it’s just outdated now.

BTW you tried using the Nvidia Open Kernel module or are you completely against using Nvidia ?

I was already trying to figure out how to contribute to the Celluloid Flatpak, so I might try loading the -git extension for Mesa. Eventually. Unfortunately the docs for Flatpak extensions don’t really…exist yet.

I use the proprietary drivers on my desktop. But I’d really like to avoid layering packages or relying on the proprietary drivers for my very simple needs for the Silverblue laptop (i.e. playback media at 60FPS and not much else).

The Open Kernel Modules aren’t compatible with Mesa; they only work with the proprietary userspace drivers. And hardware decoding is probably just fine there.

1 Like

Unfortunately this thought is problematic.
Nouveau is not capable of managing graphics rendering with hardware acceleration on most of the nvidia GPUs so without the proprietary drivers you would be stuck with the CPU performing the task normally done by the GPU and the entire system will likely slow down dramatically (as well as more heat generated by the CPU).

I said simple, not easy :slight_smile:

As long as the video isn’t 4K, I haven’t noticed any slowdowns. I don’t even have a 4K screen; it ends up getting downsampled to 2K.

I’d say I definitely noticed an impact on battery life, but this laptop has never lasted beyond 2 hours anyway and it’s mostly wall-bound.

Hopefully with the renewed interest in Nouveau (or even Nova), things will change. I just don’t know how long that will be.