Ubuntu 20.10: Firefox 82+, Intel HD 500, Vaapi hardware acceleration

Solution 1:

After a lot of trial and error, I was able to enable and verify that 4k/60fps vaapi video hardware acceleration is working via VP9 and X11 on my system.

Step #1:

  • Ubuntu should already ship with all the necessary Mesa gpu drivers by default (Intel / Radeon)
  • In my case, I performed sudo apt-get install i965-va-driver vainfo just to be sure
  • Usually sudo apt-get install vainfo should suffice

Step #2:

  • Open a terminal and type vainfo in order to see what codecs your gpu supports (see my initial question further above)

Step #3, launch Firefox and set the following to true via about:config:

 - gfx.webrender.all
 - gfx.webrender.compositor.force-enabled
 - media.ffmpeg.vaapi-drm-display.enabled
 - media.ffmpeg.vaapi.enabled

Step #4, set the following to false, if your gpu supports the VP8/VP9 hardware acceleration:

  • media.ffvpx.enabled

Step #5:

  • Close Firefox
  • Open a terminal and launch Firefox via MOZ_X11_EGL=1 firefox

Step #6:

  • Browse Youtube, for example, and right-click a video -> stats for nerds
  • Check viewport / frames for dropped frames (ideally, you should have zero dropped frames)

Step #7 (optional):

  • Create a shortcut with the env set to MOZ_X11_EGL=1 firefox
  • See here for more infos

That's pretty much it. Have fun!