VLC not utlizing NVIDIA hardware acceleration under Wayland

VLC (3.0.18 Vetinari) can’t be configured to utilize hardware acceleration on my configuration. This is shown in two ways:

  1. When configuring VLC HWAccel option to auto, VLC won’t utilize any HWAccel option, resulting in severe lag when playing 4K+ video.
  2. When configuring VLC HWAccel option to vaapi(force VA-API usage), VLC won’t play any video at all, the output area would be just black(but the video is still played as sound is still present).

Any other extra configuration such as specifying output would result in VLC crash.
Force VDPAU usage is not an option since RPM Fusion Howto/NVIDIA#Wayland states:

Please remind that video acceleration with VDPAU isn’t available under Wayland.

With vdpauinfo further confirms:

$ vdpauinfo
display: :0   screen: 0
Xlib:  extension "NV-GLX" missing on display ":0".
Xlib:  extension "NV-GLX" missing on display ":0".
Error creating VDPAU device: 1

I can confirm my card/driver/VA-API configurations are all working since mpv with nvdec or vaapi and ffplay are all usable on the same config.

Other options I’ve tried:

  1. Use x11 mode(vlc -V x11): Black screen;
  2. Different codecs: H.264, H.265, VP8, VP9 - all the same;
  3. Every experienced error log message, all solved using different approaches but not contributed to the problem:
    libEGL warning: egl: failed to create dri2 screen
    Xlib: extension "NV-GLX" missing on display ":0"
  4. Different VA-API configuration packages:
    mesa-va-drivers
    nvidia-vaapi-driver

This problem has been consistent from f35 so I guess it’s not a version specific one.

My configuration:

  • Hardware:
$ hwinfo --gfxcard
11: PCI 900.0: 0300 VGA compatible controller (VGA)             
  [Created at pci.386]
  Unique ID: <REDACTED>
  Parent ID: <REDACTED>
  SysFS ID: /devices/pci0000:00/0000:00:03.1/0000:09:00.0
  SysFS BusID: 0000:09:00.0
  Hardware Class: graphics card
  Model: "nVidia GM206 [GeForce GTX 950]"
  Vendor: pci 0x10de "nVidia Corporation"
  Device: pci 0x1402 "GM206 [GeForce GTX 950]"
  SubVendor: <REDACTED>
  SubDevice: pci 0x11a9 
  Revision: 0xa1
  Driver: "nvidia"
  Driver Modules: "nvidia"
  Memory Range: 0xf5000000-0xf5ffffff (rw,non-prefetchable)
  Memory Range: 0xe0000000-0xefffffff (ro,non-prefetchable)
  Memory Range: 0xf0000000-0xf1ffffff (ro,non-prefetchable)
  I/O Ports: 0xe000-0xe07f (rw)
  Memory Range: 0x000c0000-0x000dffff (rw,non-prefetchable,disabled)
  IRQ: 74 (345265 events)
  Module Alias: "pci:v000010DEd00001402sv00001B4Csd000011A9bc03sc00i00"
  Driver Info #0:
    Driver Status: nouveau is not active
    Driver Activation Cmd: "modprobe nouveau"
  Driver Info #1:
    Driver Status: nvidia_drm is active
    Driver Activation Cmd: "modprobe nvidia_drm"
  Driver Info #2:
    Driver Status: nvidia is active
    Driver Activation Cmd: "modprobe nvidia"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #7 (PCI bridge)

Primary display adapter: #11
  • VA-API info
$ sudo dnf list --installed akmod-nvidia xorg-x11-drv-nvidia*
Installed Packages
akmod-nvidia.x86_64                        3:525.85.05-1.fc37       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                 3:525.85.05-1.fc37       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64       3:525.85.05-1.fc37       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64         3:525.85.05-1.fc37       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686              3:525.85.05-1.fc37       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64            3:525.85.05-1.fc37       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64           3:525.85.05-1.fc37       @rpmfusion-nonfree-nvidia-driver
$ 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 [egl backend]
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
      VAProfileHEVCMain10             :	VAEntrypointVLD

https://rpmfusion.org/Howto/Multimedia#Hardware_Accelerated_Codec

nvidia-vaapi-driverhas been installed. Again, My VA-API config should be correct since mpv correctly handles it. It’s solely VLC problem.

1 Like

Some further dig in:

  1. X11 Display on Wayland GDM can still be achieved with XWayland, thus using x11 to further test HWAccel is applicable;
  2. Validation on mpv:
  • --vo=vaapi won’t work at all;
  • --vo=gpu --hwdec=vaapi/vaapi-copy would just stuck;
  • --vo=gpu --hwdec=vdpau --gpu-context=x11 won’t work as well, it just logs that vdpau can’t be retrieved and back to software decoding;
  1. Validation on VLC:
  • --avcodec-hw=vaapi won’t work: black screen;
  • --avcodec-hw=vdpau won’t work: video can be displayed, but HWAccel is not enabled, still resulting in frame drop on 4K+ video;

Some further guessing:

  1. nvidia-vaapi-driver won’t work at all since it’s an Intel/AMD thing;
  2. vdpau support is missing since I’m using Wayland;
  3. Other video output driver/HWAccel combination won’t work too;

NVDec is the only working option, but the current VLC doesn’t support it.

I would love to be proved wrong because I’m not hardcore enough to play with mpv rather than VLC, and if HWAccel can be supported I would be delighted.

1 Like