Why is libva not working on Wayland?

I noticed that my hardware acceleration via libva is not working correctly. vainfo -a gives the following output.

❯ vainfo
Trying display: wayland
libva info: VA-API version 1.16.0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

And my GPU is as follows:

❯ lspci | grep VGA
09:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2070] (rev a1)

I am on Fedora 37 (GNOME + Wayland) with mesa-va-drivers installed. Currently, I am using the NVIDIA driver from RPMFusion.

❯ lspci -k | grep -EA3 'VGA|3D|Display'
09:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2070] (rev a1)
	Subsystem: Gigabyte Technology Co., Ltd Device 4011
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia

Which driver are you using for that nvidia GPU? Have you installed the nvidia driver from rpmfusion or not?

I am using the NVIDIA driver from RPMFusion.

❯ lspci -k | grep -EA3 'VGA|3D|Display'
09:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2070] (rev a1)
	Subsystem: Gigabyte Technology Co., Ltd Device 4011
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia

That was a repeat from your earlier post, but gives no detail.

Please post the output of dnf list installed *nvidia*

The file that seems not found is provided by

# dnf provides /usr/lib64/dri/nvidia_drv_video.so
Last metadata expiration check: 0:55:48 ago on Sat 19 Nov 2022 06:31:34 PM CST.
libva-vdpau-driver-0.7.4-111.fc36.x86_64 : HW video decode support for VDPAU platforms
Repo        : @System
Matched from:
Filename    : /usr/lib64/dri/nvidia_drv_video.so

Is that package installed?

I found out that I was missing a VA API driver for my NVIDIA GPU. Upgrading to Fedora 37 that ships the nvidia-vaapi-driver package worked for me. I installed the package after upgrading and vainfo gives a healthy output.

❯ vainfo
Trying display: wayland
libva info: VA-API version 1.16.0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.16 (libva 2.16.0)
vainfo: Driver version: VA-API NVDEC driver
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      <unknown profile>               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD