Difference between revisions of "Hardware video acceleration"

From ArchWiki
Jump to navigation Jump to search
(Added important note to the driver not found bug.)
m (VDPAU has just received an update)
 
(240 intermediate revisions by 35 users not shown)
Line 1: Line 1:
 
[[Category:Graphics]]
 
[[Category:Graphics]]
 
[[Category:X server]]
 
[[Category:X server]]
{{Related articles start}}
+
[[ja:ハードウェアビデオアクセラレーション]]
{{Related|XvMC}}
+
[[ru:VA-API]]
{{Related articles end}}
+
[[zh-hans:Hardware video acceleration]]
{{Accuracy|I only have an Intel card so I wasn't able to test this out on AMD/NVIDIA. Please correct me in those places.}}
+
[[Wikipedia:Graphics processing unit#GPU accelerated video decoding|Hardware video acceleration]] makes it possible for the video card to decode/encode video, thus offloading the CPU and saving power.
 
 
Hardware video acceleration makes it possible for the video card to decode/encode video, thus offloading the CPU and saving power.
 
  
 
There are several ways to achieve this on Linux:
 
There are several ways to achieve this on Linux:
* '''[http://www.freedesktop.org/wiki/Software/vaapi Video Acceleration API]''' (VA-API) is a specification and open source library to provide both hardware accelerated video encoding and decoding, developed by Intel.
 
* '''[http://http.download.nvidia.com/XFree86/vdpau/doxygen/html/ Video Decode and Presentation API for Unix]''' (VDPAU) is an open source library and API to offload portions of the video decoding process and video post-processing to the GPU video-hardware, developed by NVIDIA.
 
* X-Video Motion Compensation ([[XvMC]]) is an extension for the X.Org Server, allowing video programs to offload portions of the video decoding process to the GPU video-hardware.
 
 
== Support ==
 
 
=== Formats ===
 
 
{{Expansion|I haven't found a usable list for {{pkg|libva-mesa-driver}} or {{aur|libvdpau-amdgpu-pro}}.}}
 
 
{| class="wikitable" style="width: 100%"
 
|+ VA-API
 
!
 
! {{pkg|libva-intel-driver}}
 
! {{pkg|libva-mesa-driver}}
 
! {{aur|libva-xvba-driver}}
 
! {{pkg|libva-vdpau-driver}}
 
|-
 
! MPEG2 decoding
 
| GMA 4500 and newer
 
| <center>?</center>
 
| Radeon HD 4000 and newer
 
| rowspan=4 | <center>See VDPAU.</center>
 
|-
 
! MPEG4 decoding
 
| <center>❌</center>
 
| <center>?</center>
 
| Radeon HD 6000 and newer
 
|-
 
! H264 decoding
 
| GMA 4500<sup>1</sup>, Ironlake Graphics and newer
 
| <center>?</center>
 
| Radeon HD 4000 and newer
 
|-
 
! VC1 decoding
 
| Sandy Bridge Graphics and newer
 
| <center>?</center>
 
| Radeon HD 4000 and newer
 
|-
 
! MPEG2 encoding
 
| Ivy Bridge Graphics and newer
 
| <center>?</center>
 
| <center>❌</center>
 
| <center>❌</center>
 
|-
 
! H264 encoding
 
| Sandy Bridge Graphics and newer
 
| <center>?</center>
 
| <center>❌</center>
 
| <center>❌</center>
 
|}
 
 
{| class="wikitable" style="width: 100%"
 
|+ VDPAU
 
!
 
! {{pkg|mesa-vdpau}}
 
! {{pkg|libvdpau-va-gl}}
 
! {{aur|libvdpau-amdgpu-pro}}
 
! {{pkg|nvidia-utils}}
 
|-
 
! MPEG2 decoding
 
| Radeon 9500 and newer, GeForce 8 and newer
 
| <center>❌<sup>2</sup></center>
 
| <center>?</center>
 
| GeForce 8 and newer
 
|-
 
! MPEG4 decoding
 
| Radeon HD 6000 and newer, GeForce 200 and newer
 
| <center>❌<sup>2</sup></center>
 
| <center>?</center>
 
| GeForce 200 and newer
 
|-
 
! H.264 decoding
 
| Radeon HD 4000 and newer, GeForce 8 and newer
 
| <center>See VA-API.</center>
 
| <center>?</center>
 
| GeForce 8 and newer
 
|-
 
! HEVC (H.265) decoding
 
| <center>❌</center>
 
| <center>❌<sup>2</sup></center>
 
| <center>?</center>
 
| GeForce 900<sup>4</sup> and newer
 
|-
 
! VC1 decoding
 
| Radeon HD 4000 and newer, GeForce 8<sup>3</sup> and newer
 
| <center>❌<sup>2</sup></center>
 
| <center>?</center>
 
| GeForce 8<sup>3</sup> and newer
 
|}
 
  
* <sup>1</sup> Supported by {{aur|libva-intel-driver-g45-h264}} instead.
+
* [https://www.freedesktop.org/wiki/Software/vaapi/ Video Acceleration API] (VA-API) is a specification and open source library to provide both hardware accelerated video encoding and decoding, developed by Intel.
* <sup>2</sup> As of version 0.3, the VA GL driver doesn't support any other hardware decoder than H.264.
+
* [https://www.freedesktop.org/wiki/Software/VDPAU/ Video Decode and Presentation API for Unix] (VDPAU) is an open source library and API to offload portions of the video decoding process and video post-processing to the GPU video-hardware, developed by NVIDIA.
* <sup>3</sup> [[Wikipedia:Nvidia PureVideo|Except]] GeForce 8800 Ultra, 8800 GTX, 8800 GTS (320/640 MB).
+
* [https://developer.nvidia.com/nvidia-video-codec-sdk NVDECODE/NVENCODE] - proprietary APIs for hardware video acceleration used by NVIDIA Fermi, Kepler, Maxwell and Pascal generation GPUs.
* <sup>4</sup> Except GeForce GTX 970 and GTX 980.
 
  
The features supported by your GPU may vary. To see what your GPU supports see [[#Verifying]].
+
For pre-2007 video cards see [[XvMC]]. For comprehensive overview of driver and application support see [[#Comparison tables]].
 
 
=== Software ===
 
 
 
{| class="wikitable" style="width: 100%"
 
!
 
! VA-API
 
! VDPAU
 
|-
 
! [[GStreamer]]
 
| ✓ (with {{pkg|gstreamer-vaapi}}, see [[GStreamer#Hardware acceleration]])
 
| ✓ (with {{pkg|gst-plugins-bad}}, see [[GStreamer#Hardware acceleration]])
 
|-
 
! [[VLC media player]]
 
| ✓ (see [[VLC media player#Hardware acceleration support]])
 
| ✓ (see [[VLC media player#Hardware acceleration support]])
 
|-
 
! [[mpv]]
 
| ✓ (see [[Mpv#Hardware Decoding]])
 
| ✓ (see [[Mpv#Hardware Decoding]])
 
|-
 
! [[MPlayer]]
 
| ✓ (with {{aur|mplayer-vaapi}}, see [[MPlayer#Enabling VA-API]])
 
| ✓ (see [[MPlayer#Enabling VDPAU]])
 
|-
 
! [[Flash]]
 
| ✓ (with {{pkg|libvdpau-va-gl}}, see [[Flash#Configuration]])
 
| ✓ (see [[Flash#Configuration]])
 
|}
 
  
 
== Installation ==
 
== Installation ==
  
The choice varies depending on your video card vendor:
+
=== Intel ===
 
 
* For Intel Graphics use VA-API.
 
* For NVIDIA cards use VDPAU.
 
* For AMD cards you have a choice: either VA-API with {{Pkg|mesa}} or VDPAU.
 
 
 
There are also two specific types of drivers for VA-API and VDPAU:
 
* {{pkg|libva-vdpau-driver}}, which uses VDPAU as a backend for VA-API.
 
* {{pkg|libvdpau-va-gl}}, which uses VA-API as a backend for VDPAU.
 
 
 
For pre-2007 cards see [[XvMC]].
 
 
 
{{tip|It is recommended to install and configure both VA-API and VDPAU to achieve support in different scenarios, e.g. [[Flash]] doesn't support VA-API but can use the VDPAU VA-API backend.}}
 
{{warning|Do not use {{pkg|libva-vdpau-driver}} and {{pkg|libvdpau-va-gl}} together as it will create an (infinite) loop between VA-API and VDPAU, which will result in something either really bad or really fun. But if you try it anyway please share your experiences.}}
 
 
 
=== Installing VA-API ===
 
 
 
'''Open source drivers:'''
 
  
* [[ATI|AMD]] Radeon 9500 and newer GPUs are supported by either {{pkg|libva-mesa-driver}} with {{pkg|mesa}} or {{pkg|libva-vdpau-driver}} (see [[#Installing VDPAU]]).
+
[[Intel graphics]] open-source drivers support VA-API:
* [[Intel]] GMA 4500 series and newer GPUs are supported by {{pkg|libva-intel-driver}} with {{pkg|mesa}}.
 
** To get better support on GMA 4500 consider using {{aur|libva-intel-driver-g45-h264}} instead, see [[Intel#H.264 decoding on GMA 4500]] for instructions and caveats.
 
* [[Nouveau|NVIDIA]] GeForce 8 series and newer GPUs are supported by {{pkg|libva-vdpau-driver}} (see [[#Installing VDPAU]]).
 
.
 
'''Proprietary drivers:'''
 
  
* [[AMD Catalyst|AMD]] Radeon HD 4000 series and newer GPUs are supported by {{AUR|libva-xvba-driver}}. It uses the {{AUR|catalyst-utils}} driver for Radeon HD 5000 series and newer, and {{AUR|catalyst-total-hd234k}} for Radeon HD 4000 series.
+
* HD Graphics series starting from [https://github.com/intel/media-driver/#supported-platforms Broadwell] [https://en.wikipedia.org/wiki/Template:Intel_processor_roadmap (~2015)] and newer are supported by {{Pkg|intel-media-driver}}.
* [[NVIDIA]] GeForce 8 series and newer GPUs are supported by {{pkg|libva-vdpau-driver}} (see [[#Installing VDPAU]]).
+
* GMA 4500 [https://01.org/linuxmedia/vaapi series] and newer GPUs up to [https://en.wikipedia.org/wiki/Coffee_Lake Coffee Lake] are supported by {{Pkg|libva-intel-driver}}.
 +
* GMA 4500 H.264 decoding is supported by {{AUR|libva-intel-driver-g45-h264}}, see [[Intel#Hardware accelerated H.264 decoding on GMA 4500]].
 +
* Broadwell to Skylake VP9 decoding and Haswell to Skylake hybrid VP8 encoding is supported by {{AUR|intel-hybrid-codec-driver}}. [https://github.com/intel/intel-hybrid-driver/issues/21 VP9 decoding on Haswell crashes].
  
=== Installing VDPAU ===
+
=== NVIDIA ===
  
'''Open source drivers:'''
+
[[Nouveau]] open-source driver supports both VA-API and VDPAU:
  
* [[ATI|AMD]] Radeon 9500 and newer GPUs are supported by {{pkg|mesa-vdpau}}.
+
* GeForce 8 series and newer GPUs up until GeForce GTX 750 are supported by {{Pkg|libva-mesa-driver}} and {{Pkg|mesa-vdpau}}.
* [[Intel]] GMA 4500 series and newer GPUs are supported by {{pkg|libvdpau-va-gl}} (see [[#Installing VA-API]]).
+
* [https://nouveau.freedesktop.org/wiki/VideoAcceleration/#firmware Requires] {{AUR|nouveau-fw}} firmware package, presently extracted from the NVIDIA binary driver.
* [[Nouveau|NVIDIA]] GeForce 8 series and newer GPUs are supported by {{pkg|mesa-vdpau}}. It [http://nouveau.freedesktop.org/wiki/VideoAcceleration/#firmware requires] {{AUR|nouveau-fw}}, which contains the required firmware to operate that is presently extracted from the NVIDIA binary driver.
 
  
'''Proprietary drivers:'''
+
[[NVIDIA]] proprietary driver supports via {{Pkg|nvidia-utils}}:
  
* [[AMD Catalyst|AMD]] Radeon HD 4000 series and newer GPUs are supported by {{pkg|libvdpau-va-gl}} (see [[#Installing VA-API]]).
+
* VDPAU on GeForce 8 series and newer GPUs;
* [[NVIDIA]] GeForce 400 series and newer GPUs are supported by {{pkg|nvidia-utils}}.
+
* NVDECODE on Fermi and newer GPUs [https://developer.download.nvidia.com/assets/cuda/files/NVIDIA_Video_Decoder.pdf];
** GeForce 8/9 and GeForce 100-300 series are supported by {{pkg|nvidia-340xx-utils}}.
+
* NVENCODE on Kepler and newer GPUs.
 
 
== Configuration ==
 
 
 
=== Configuring VA-API ===
 
  
The [http://www.freedesktop.org/wiki/Software/vaapi/#driversback-endsthatimplementva-api driver] for  VA-API is autodetected. To determine which one is used see [[#Verifying]]. You can override it by setting the {{ic|LIBVA_DRIVER_NAME}} [[environment variable]]:
+
=== ATI/AMD ===
  
* For Intel Graphics use {{ic|i965}}.
+
[[ATI]] and [[AMDGPU]] open-source drivers support both VA-API and VDPAU:
* For NVIDIA use {{ic|vdpau}}.
 
* For AMD use either {{ic|gallium}} (for {{Pkg|libva-mesa-driver}}) or {{ic|vdpau}} (for {{Pkg|libva-vdpau-driver}}).
 
  
{{note|You can find the installed drivers in {{ic|/usr/lib/dri/}}.}}
+
* VA-API on Radeon HD 2000 and newer GPUs is supported by {{Pkg|libva-mesa-driver}}.
 +
* VDPAU on Radeon R300 and newer GPUs is supported by {{Pkg|mesa-vdpau}}.
  
=== Configuring VDPAU ===
+
[[AMDGPU PRO]] proprietary driver is built on top of AMDGPU driver and supports both VA-API and VDPAU.
  
{{Expansion|When does {{ic|VDPAU_DRIVER}} ''need'' to be set? So far I only know about Intel and Catalyst (because of {{pkg|libvdpau-va-gl}}), it should work correctly with other cards.}}
+
=== Translation layers ===
  
The driver for use with VDPAU is auto-detected, but you may need to override it by using the {{ic|VDPAU_DRIVER}} [[environment variable]].
+
To get VA-API support when device driver provides none:
  
The correct driver name depends on your setup:
+
* {{Pkg|libva-vdpau-driver}} – VDPAU backend for VA-API.
 +
* {{AUR|libva-vdpau-driver-chromium}} – VDPAU backend for VA-API, patched to work with [[Chromium]].
 +
* [[AMD Catalyst#Video acceleration|XvBA]] backend for VA-API is provided by proprietary [[AMD Catalyst]] driver.
  
* For Intel Graphics or AMD Catalyst you [[#Failed_to_open_VDPAU_backend|need]] to set it to {{ic|va_gl}}.
+
To get VDPAU support when device driver provides none:
* For the open source AMD/ATI driver set it to the proper driver version depending on your GPU (see below).
 
* For NVIDIA's proprietary version set it to {{ic|nvidia}}.
 
  
The driver name can determined by running:
+
* {{Pkg|libvdpau-va-gl}} – VA-API backend for VDPAU, [https://github.com/i-rinat/libvdpau-va-gl/issues/67#issuecomment-318470175 only H.264 support].
{{hc|$ grep -i vdpau ~/.local/share/xorg/Xorg.0.log|
 
(II) RADEON(0): [DRI2] VDPAU driver: r300
 
}}
 
In this case you want to set {{ic|1=VDPAU_DRIVER=r300}}.
 
  
{{note|You can find the installed drivers in {{ic|/usr/lib/vdpau/}}.}}
+
== Verification ==
  
For hybrid setups (both NVIDIA and AMD), it may be necessary to [[environment variable|set]] {{ic|1=DRI_PRIME=1}}. For more information see [[PRIME]].
+
Your system may work perfectly out-of-the-box without needing any configuration. Therefore it is a good idea to start with this section to see that it is the case.
  
== Verifying ==
+
{{Tip|[[mpv#Hardware video acceleration|mpv]] is great for testing hardware acceleration in practice.}}
  
 
=== Verifying VA-API ===
 
=== Verifying VA-API ===
  
Verify the settings for VA-API by running {{ic|vainfo}}, which is provided by {{pkg|libva}}:
+
Verify the settings for VA-API by running {{ic|vainfo}}, which is provided by {{Pkg|libva-utils}}:
  
 
{{hc|$ vainfo|<nowiki>
 
{{hc|$ vainfo|<nowiki>
libva info: VA-API version 0.39.0
+
libva info: VA-API version 0.39.4
 
libva info: va_getDriverName() returns 0
 
libva info: va_getDriverName() returns 0
 
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
 
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
 
libva info: Found init function __vaDriverInit_0_39
 
libva info: Found init function __vaDriverInit_0_39
 
libva info: va_openDriver() returns 0
 
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.0)
+
vainfo: VA-API version: 0.39 (libva 1.7.3)
vainfo: Driver version: Intel i965 driver for Intel(R) Sandybridge Mobile - 1.7.0
+
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 1.7.3
 
vainfo: Supported profile and entrypoints
 
vainfo: Supported profile and entrypoints
 
       VAProfileMPEG2Simple            : VAEntrypointVLD
 
       VAProfileMPEG2Simple            : VAEntrypointVLD
 +
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
 
       VAProfileMPEG2Main              : VAEntrypointVLD
 
       VAProfileMPEG2Main              : VAEntrypointVLD
 +
      VAProfileMPEG2Main              : VAEntrypointEncSlice
 
       VAProfileH264ConstrainedBaseline: VAEntrypointVLD
 
       VAProfileH264ConstrainedBaseline: VAEntrypointVLD
 
       VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
 
       VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
 +
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
 
       VAProfileH264Main              : VAEntrypointVLD
 
       VAProfileH264Main              : VAEntrypointVLD
 
       VAProfileH264Main              : VAEntrypointEncSlice
 
       VAProfileH264Main              : VAEntrypointEncSlice
 +
      VAProfileH264Main              : VAEntrypointEncSliceLP
 
       VAProfileH264High              : VAEntrypointVLD
 
       VAProfileH264High              : VAEntrypointVLD
 
       VAProfileH264High              : VAEntrypointEncSlice
 
       VAProfileH264High              : VAEntrypointEncSlice
 +
      VAProfileH264High              : VAEntrypointEncSliceLP
 +
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
 +
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
 
       VAProfileH264StereoHigh        : VAEntrypointVLD
 
       VAProfileH264StereoHigh        : VAEntrypointVLD
 +
      VAProfileH264StereoHigh        : VAEntrypointEncSlice
 
       VAProfileVC1Simple              : VAEntrypointVLD
 
       VAProfileVC1Simple              : VAEntrypointVLD
 
       VAProfileVC1Main                : VAEntrypointVLD
 
       VAProfileVC1Main                : VAEntrypointVLD
 
       VAProfileVC1Advanced            : VAEntrypointVLD
 
       VAProfileVC1Advanced            : VAEntrypointVLD
       VAProfileNone                  : VAEntrypointVideoProc</nowiki>
+
       VAProfileNone                  : VAEntrypointVideoProc
}}
+
      VAProfileJPEGBaseline          : VAEntrypointVLD
 +
      VAProfileJPEGBaseline          : VAEntrypointEncPicture
 +
      VAProfileVP8Version0_3          : VAEntrypointVLD
 +
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
 +
      VAProfileHEVCMain              : VAEntrypointVLD
 +
      VAProfileHEVCMain              : VAEntrypointEncSlice
 +
</nowiki>}}
  
''VAEntrypointVLD'' means that your card is capable to decode this format, ''VAEntrypointEncSlice'' means that you can encode to this format.
+
{{ic|VAEntrypointVLD}} means that your card is capable to decode this format, {{ic|VAEntrypointEncSlice}} means that you can encode to this format.
  
 
In this example the {{ic|i965}} driver is used, as you can see in this line:
 
In this example the {{ic|i965}} driver is used, as you can see in this line:
{{bc|libva info: Trying to open /usr/lib/dri/'''i965'''_drv_video.so}}
+
 
 +
libva info: Trying to open /usr/lib/dri/'''i965'''_drv_video.so
 +
 
 +
If the following error is displayed when running {{ic|vainfo}}:
 +
 
 +
libva info: va_openDriver() returns -1
 +
vaInitialize failed with error code -1 (unknown libva error),exit
 +
 
 +
You need to configure the correct driver, see [[#Configuring VA-API]].
  
 
=== Verifying VDPAU ===
 
=== Verifying VDPAU ===
  
{{Expansion|Please add a sample output from a VDPAU supported system.}}
+
Install {{pkg|vdpauinfo}} to verify if the VDPAU driver is loaded correctly and retrieve a full report of the configuration:
 +
 
 +
{{hc|$ vdpauinfo|
 +
display: :0  screen: 0
 +
API version: 1
 +
Information string: G3DVL VDPAU Driver Shared Library version 1.0
 +
 
 +
Video surface:
  
You can verify VDPAU is correctly configured by running {{ic|vdpauinfo}}, provided by {{pkg|vdpauinfo}}.
+
name  width height types
 +
-------------------------------------------
 +
420    16384 16384  NV12 YV12
 +
422    16384 16384  UYVY YUYV
 +
444    16384 16384  Y8U8V8A8 V8U8Y8A8
 +
 
 +
Decoder capabilities:
 +
 
 +
name                        level macbs width height
 +
----------------------------------------------------
 +
MPEG1                          --- not supported ---
 +
MPEG2_SIMPLE                    3  9216  2048  1152
 +
MPEG2_MAIN                      3  9216  2048  1152
 +
H264_BASELINE                  41  9216  2048  1152
 +
H264_MAIN                      41  9216  2048  1152
 +
H264_HIGH                      41  9216  2048  1152
 +
VC1_SIMPLE                      1  9216  2048  1152
 +
VC1_MAIN                        2  9216  2048  1152
 +
VC1_ADVANCED                    4  9216  2048  1152
 +
 
 +
..
 +
}}
 +
 
 +
== Configuration ==
 +
 
 +
Although the video driver should automatically enable hardware video acceleration support for both VA-API and VDPAU, it may be needed to configure VA-API/VDPAU manually. Only continue to this section if you went through [[#Verification]].
 +
 
 +
The default driver names, used if there is no other configuration present, are guess by the system. However, they are often hacked together and may not work. You can see the guessed values by running:
 +
 
 +
{{hc|$ grep -iE 'vdpau {{!}} dri driver' ~/.local/share/xorg/Xorg.0.log|
 +
(II) RADEON(0): [DRI2] DRI driver: radeonsi
 +
(II) RADEON(0): [DRI2] VDPAU driver: radeonsi
 +
}}
 +
 
 +
In this case {{ic|radeonsi}} is the default for both VA-API and VDPAU.
 +
 
 +
{{Note|If you use [[GDM]], run {{ic|journalctl -b {{!}} grep -iE 'vdpau {{!}} dri driver'}} instead.}}
 +
 
 +
This does not represent the ''configuration'' however. The values above will not change even if you override them.
 +
 
 +
=== Configuring VA-API ===
 +
 
 +
You can override the [http://www.freedesktop.org/wiki/Software/vaapi/#driversback-endsthatimplementva-api driver] for VA-API by using the {{ic|LIBVA_DRIVER_NAME}} [[environment variable]]:
 +
 
 +
* [[Intel graphics]]:
 +
** For {{Pkg|libva-intel-driver}} use {{ic|i965}}.
 +
** For {{Pkg|intel-media-driver}} use {{ic|iHD}}.
 +
* NVIDIA:
 +
** For [[Nouveau]] use {{ic|nouveau}}.
 +
** For [[NVIDIA]] use {{ic|vdpau}}.
 +
* ATI/AMD:
 +
** For [[AMDGPU]] driver use {{ic|radeonsi}}.
 +
** For [[AMD Catalyst]] use {{ic|fglrx}}.
 +
 
 +
{{Note|
 +
* You can find the installed drivers in {{ic|/usr/lib/dri/}}. They are used as {{ic|/usr/lib/dri/'''${LIBVA_DRIVER_NAME}'''_drv_video.so}}.
 +
* Some drivers are installed several times under different names for compatibility reasons. You can see which by running {{ic|sha1sum /usr/lib/dri/*}}.
 +
* {{ic|LIBVA_DRIVERS_PATH}} can be used to overrule the VA-API drivers location.
 +
* Since version 12.0.1 {{Pkg|libva-mesa-driver}} provides {{ic|radeonsi}} instead of {{ic|gallium}}.
 +
}}
 +
 
 +
=== Configuring VDPAU ===
 +
 
 +
You can override the driver for VDPAU by using the {{ic|VDPAU_DRIVER}} [[environment variable]].
 +
 
 +
The correct driver name depends on your setup:
 +
 
 +
* For Intel Graphics or AMD Catalyst you [[#Failed to open VDPAU backend|need]] to set it to {{ic|va_gl}}.
 +
* For the open source AMD/ATI driver set it to the proper driver version depending on your GPU, see [[#Verification]].
 +
* For the open source Nouveau driver set it to {{ic|nouveau}}.
 +
* For NVIDIA's proprietary version set it to {{ic|nvidia}}.
 +
 
 +
{{Note|
 +
* You can find the installed drivers in {{ic|/usr/lib/vdpau/}}. They are used as {{ic|/usr/lib/vdpau/libvdpau_'''${VDPAU_DRIVER}'''.so}}.
 +
* Some drivers are installed several times under different names for compatibility reasons. You can see which by running {{ic|sha1sum /usr/lib/vdpau/*}}.
 +
* For hybrid setups (both NVIDIA and AMD), it may be necessary to [[environment variable|set]] {{ic|1=DRI_PRIME=1}}. For more information see [[PRIME]].
 +
}}
  
 
== Troubleshooting ==
 
== Troubleshooting ==
Line 259: Line 213:
 
=== Failed to open VDPAU backend ===
 
=== Failed to open VDPAU backend ===
  
This happens when you use {{pkg|libvdpau-va-gl}} without overriding {{ic|VDPAU_DRIVER}}. VDPAU doesn't know what driver to use in this case for some reason and guesses wrongly. See [[#Configuring VDPAU]].
+
You need to set {{ic|VDPAU_DRIVER}} variable to point to correct driver. See [[#Configuring VDPAU]].
 +
 
 +
=== VAAPI init failed ===
 +
 
 +
An error along the lines of {{ic|libva: /usr/lib/dri/i965_drv_video.so init failed}} is encountered. This can happen because of improper detection of Wayland. One solution is to unset {{ic|$DISPLAY}} so that mpv, mplayer, VLC, etc. do not assume it is X11. Another mpv-specific solution is to add the parameter {{ic|1=--opengl-backend=wayland}}.
 +
 
 +
== Comparison tables ==
 +
 
 +
=== VA-API drivers ===
 +
 
 +
{| class="wikitable" style="text-align:center;"
 +
! Codec
 +
! {{pkg|libva-intel-driver}} [https://github.com/01org/intel-vaapi-driver/blob/master/README]
 +
! {{pkg|intel-media-driver}} [https://github.com/intel/media-driver/blob/master/README.md]
 +
! {{pkg|libva-mesa-driver}} [https://www.x.org/wiki/RadeonFeature/] [https://nouveau.freedesktop.org/wiki/VideoAcceleration/]
 +
! [[AMD Catalyst#Video acceleration|AMD Catalyst]] <br> (XvBA adapter)
 +
! {{pkg|libva-vdpau-driver}} <br> (VDPAU adapter)
 +
|-
 +
! colspan=6 | Decoding
 +
|-
 +
! MPEG-2
 +
| {{G|GMA 4500 and newer}}
 +
| {{G|Broadwell and newer}}
 +
| {{G|Radeon HD 6000 and newer<br>GeForce 8 and newer<sup>1</sup>}}
 +
| {{G|Radeon HD 4000 and newer}}
 +
| rowspan=6 | See [[#VDPAU drivers]]
 +
|-
 +
! MPEG-4<sup>4</sup>
 +
| {{No}}
 +
| {{No}}
 +
| {{G|Radeon HD 6000 and newer}}
 +
| {{G|Radeon HD 6000 and newer}}
 +
|-
 +
! VC-1
 +
| {{G|Sandy Bridge and newer}}
 +
| rowspan=2 {{G|Broadwell and newer}}
 +
| {{G|Radeon HD 2000 and newer<br>GeForce 9300 and newer<sup>1</sup>}}
 +
| {{G|Radeon HD 4000 and newer}}
 +
|-
 +
! H.264/MPEG-4 AVC
 +
| {{G|GMA 4500<sup>2</sup>, Ironlake and newer}}
 +
| {{G|Radeon HD 2000 and newer<br>GeForce 8 and newer<sup>1</sup>}}
 +
| {{G|Radeon HD 4000 and newer}}
 +
|-
 +
! H.265/HEVC 8bit
 +
| {{G|Cherryview/Braswell and newer}}
 +
| {{G|Skylake and newer}}
 +
| {{G|Radeon R9 Fury and newer}}
 +
| rowspan=5 {{No}}
 +
|-
 +
! H.265/HEVC 10bit
 +
| {{G|Broxton and newer}}
 +
| {{G|Broxton/Apollo Lake and newer}}
 +
| {{G|Radeon 400 and newer}}
 +
|-
 +
! VP8
 +
| {{G|Broadwell and newer}}
 +
| {{G|Broadwell and newer}}
 +
| {{No}}
 +
| {{No}}
 +
|-
 +
! VP9 8bit
 +
| {{G|Broxton and newer <br> Hybrid: Broadwell to Skylake<sup>3</sup>}}
 +
| {{G|Broxton/Apollo Lake and newer}}
 +
| rowspan=2 {{G|Raven Ridge and newer}}
 +
| rowspan=2 | See [[#VDPAU drivers]]
 +
|-
 +
! VP9 10bit
 +
| {{G|Kaby Lake and newer}}
 +
| {{G|Kaby Lake and newer}}
 +
|-
 +
! colspan=6 | Encoding
 +
|-
 +
! MPEG-2
 +
| {{G|Ivy Bridge and newer}}
 +
| {{G|Broadwell and newer<br>except Broxton/Apollo Lake}}
 +
| {{No}}
 +
| rowspan=7 {{No}}
 +
| rowspan=7 {{No}}
 +
|-
 +
! H.264/MPEG-4 AVC
 +
| {{G|Sandy Bridge and newer}}
 +
| {{G|Broadwell and newer}}
 +
| {{G|Radeon HD 7000 and newer}}
 +
|-
 +
! H.265/HEVC 8bit
 +
| {{G|Skylake and newer}}
 +
| {{G|Skylake and newer}}
 +
| {{G|Radeon 400 and newer}}
 +
|-
 +
! H.265/HEVC 10bit
 +
| {{G|Kaby Lake and newer}}
 +
| rowspan=2 {{G|Kaby Lake and newer}}
 +
| {{G|Raven Ridge and newer}}
 +
|-
 +
! VP8
 +
| {{G|Cherryview/Braswell and newer <br> Hybrid: Haswell to Skylake<sup>3</sup>}}
 +
| rowspan=3 {{No}}
 +
|-
 +
! VP9 8bit
 +
| {{G|Kaby Lake and newer}}
 +
| rowspan=2 {{G|Icelake and newer}}
 +
|-
 +
! VP9 10bit
 +
| {{No}}
 +
|}
 +
 
 +
* <sup>1</sup> Up until GeForce GTX 750.
 +
* <sup>2</sup> Supported by {{aur|libva-intel-driver-g45-h264}} instead.
 +
* <sup>3</sup> Hybrid VP8 encoder and VP9 decoder supported by {{AUR|intel-hybrid-codec-driver}}. [https://github.com/intel/intel-hybrid-driver/issues/21 VP9 decoding on Haswell crashes].
 +
* <sup>4</sup> MPEG-4 is disabled by default due to VAAPI limitations. Set the [[environment variable]] {{ic|1=VAAPI_MPEG4_ENABLED=true}} to try to use it anyway.
 +
 
 +
=== VDPAU drivers ===
 +
 
 +
{| class="wikitable" style="text-align:center;"
 +
! Codec
 +
! {{pkg|mesa-vdpau}} [https://www.x.org/wiki/RadeonFeature/] [https://nouveau.freedesktop.org/wiki/VideoAcceleration/]
 +
! {{pkg|nvidia-utils}} [https://www.nvidia.com/page/purevideo_support.html]
 +
! {{pkg|libvdpau-va-gl}}<br>(VA-API adapter)
 +
|-
 +
! colspan=5 | Decoding
 +
|-
 +
! MPEG-2
 +
| {{G|Radeon R300 and newer <br> GeForce 8 and newer<sup>1</sup>}}
 +
| {{G|GeForce 8 and newer}}
 +
| rowspan=3 {{R|No}}
 +
|-
 +
! MPEG-4
 +
| {{G|Radeon HD 6000 and newer <br> GeForce 200 and newer<sup>1</sup>}}
 +
| {{G|GeForce 200 and newer}}
 +
|-
 +
! VC-1
 +
| {{G|Radeon HD 2000 and newer <br> GeForce 9300 and newer<sup>1</sup>}}
 +
| {{G|GeForce 8 and newer<sup>2</sup>}}
 +
|-
 +
! H.264/MPEG-4 AVC
 +
| {{G|Radeon HD 2000 and newer <br> GeForce 8 and newer<sup>1</sup>}}
 +
| {{G|GeForce 8 and newer}}
 +
| See [[#VA-API drivers]]
 +
|-
 +
! H.265/HEVC 8bit
 +
| {{G|Radeon R9 Fury and newer}}
 +
| {{G|GeForce 900 and newer<sup>3</sup>}}
 +
| rowspan=2 {{No}}
 +
|-
 +
! H.265/HEVC 10bit
 +
| {{G|Radeon 400 and newer}}
 +
| {{No}}<sup>4</sup>
 +
|-
 +
! VP9
 +
| {{No}}
 +
| {{No}}
 +
| {{No}}
 +
|}
 +
 
 +
* <sup>1</sup> Up until GeForce GTX 750.
 +
* <sup>2</sup> [[Wikipedia:Nvidia PureVideo|Except]] GeForce 8800 Ultra, 8800 GTX, 8800 GTS (320/640 MB).
 +
* <sup>3</sup> Except GeForce GTX 970 and GTX 980.
 +
* <sup>4</sup> NVIDIA implementation is limited to 8-bit streams [https://devtalk.nvidia.com/default/topic/940228/vdpau-expose-hevc-main10-support-where-available-on-die/] [https://us.download.nvidia.com/XFree86/Linux-x86_64/410.57/README/vdpausupport.html#vdpau-implementation-limits].
 +
 
 +
=== NVIDIA driver only ===
 +
 
 +
{| class="wikitable" style="text-align:center;"
 +
! rowspan=2 | Codec
 +
! colspan=2 | {{Pkg|nvidia-utils}} [https://developer.nvidia.com/nvidia-video-codec-sdk]
 +
|-
 +
! NVDECODE
 +
! NVENCODE
 +
|-
 +
! MPEG-2
 +
| rowspan=3 {{G|Fermi and newer<sup>1</sup>}}
 +
| rowspan=2 {{No}}
 +
|-
 +
! VC-1
 +
|-
 +
! H.264/MPEG-4 AVC
 +
| {{G|Kepler and newer<sup>2</sup>}}
 +
|-
 +
! H.265/HEVC 8bit
 +
| rowspan=2 {{G|Maxwell (GM206) and newer}}
 +
| {{G|Maxwell (2nd Gen) and newer}}
 +
|-
 +
! H.265/HEVC 10bit
 +
| {{G|Pascal and newer}}
 +
|-
 +
! VP8
 +
| {{G|Maxwell (2nd Gen) and newer}}
 +
| rowspan=3 {{No}}
 +
|-
 +
! VP9 8bit
 +
| {{G|Maxwell (GM206) and newer}}
 +
|-
 +
! VP9 10bit
 +
| {{G|Pascal and newer}}
 +
|}
 +
 
 +
* <sup>1</sup> Except GM108 (not supported)
 +
* <sup>2</sup> Except GM108 and GP108 (not supported)
 +
 
 +
=== Application support ===
 +
 
 +
{| class="wikitable"
 +
! rowspan=2 | Application
 +
! colspan=3 | Decoding
 +
! colspan=2 | Encoding
 +
! rowspan=2 | Documentation
 +
|-
 +
! VA-API
 +
! VDPAU
 +
! NVDECODE
 +
! VA-API
 +
! NVENCODE
 +
|-
 +
! [[FFmpeg]]
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{Yes}}
 +
| [[FFmpeg#Hardware video acceleration]]
 +
|-
 +
! [[GStreamer]]
 +
| {{Yes}}<sup>1</sup>
 +
| {{Yes}}
 +
| {{Yes}}<sup>2</sup>
 +
| {{Yes}}<sup>1</sup>
 +
| {{Yes}}<sup>2</sup>
 +
| [[GStreamer#Hardware video acceleration]]
 +
|-
 +
! [[Kodi]]
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{-}}
 +
| {{-}}
 +
| [[Kodi#Hardware video acceleration]]
 +
|-
 +
! [[mpv]]
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{-}}
 +
| {{-}}
 +
| [[mpv#Hardware video acceleration]]
 +
|-
 +
! [[VLC media player]]
 +
| {{Yes}}
 +
| {{Yes}}
 +
| {{No}}
 +
| {{-}}
 +
| {{-}}
 +
| [[VLC media player#Hardware video acceleration]]
 +
|-
 +
! [[MPlayer]]
 +
| {{Yes}}<sup>3</sup>
 +
| {{Yes}}
 +
| {{No}}
 +
| {{-}}
 +
| {{-}}
 +
| [[MPlayer#Hardware video acceleration]]
 +
|-
 +
! [[Flash]]
 +
| {{No}}<sup>4</sup>
 +
| {{Yes}}<sup>4</sup>
 +
| {{No}}
 +
| {{-}}
 +
| {{-}}
 +
| [[Browser plugins#Adobe Flash Player]]
 +
|-
 +
! [[Chromium]]
 +
| {{Yes}}<sup>3</sup>
 +
| {{No}}
 +
| {{No}}
 +
| {{-}}
 +
| {{-}}
 +
| [[Chromium#Hardware video acceleration]]
 +
|-
 +
! [[Firefox]]
 +
| {{No}}
 +
| {{No}}
 +
| {{No}}
 +
| {{-}}
 +
| {{-}}
 +
| [https://bugzilla.mozilla.org/show_bug.cgi?id=1210726 Bug report]
 +
|}
 +
 
 +
* <sup>1</sup> GStreamer [https://blogs.igalia.com/vjaquez/2018/03/28/gstreamer-va-api-troubleshooting/ uses a whitelist] of VA-API drivers. To use other drivers like {{Pkg|intel-media-driver}}, set [[environment variable]] {{ic|1=GST_VAAPI_ALL_DRIVERS=1}}.
 +
* <sup>2</sup> NVDECODE/NVENCODE is [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/gst-plugins-bad#n45 disabled in the Arch package].
 +
* <sup>3</sup> Not supported officially by developers, alternative packages available.
 +
* <sup>4</sup> VDPAU is supported only by NPAPI plugin. PPAPI plugin to NPAPI browser experimental adapter is available that provides partial VA-API and VDPAU acceleration.
  
You may however to configure your media player to use VA-API instead, getting far better results, see [[#Software]].
+
{{Tip|To reduce CPU usage while watching YouTube where VP8/VP9 hardware decoding is not available use the h264ify extension (available for [https://addons.mozilla.org/firefox/addon/h264ify/ Firefox] and [https://chrome.google.com/webstore/detail/h264ify/aleakchihdccplidncghkekgioiakgal Chromium]) or the enhanced-h264ify extension (available for [https://addons.mozilla.org/firefox/addon/enhanced-h264ify/ Firefox] and [https://chrome.google.com/webstore/detail/enhanced-h264ify/omkfmpieigblcllmkgbflkikinpkodlk Chromium]).}}

Latest revision as of 11:13, 29 August 2019

Hardware video acceleration makes it possible for the video card to decode/encode video, thus offloading the CPU and saving power.

There are several ways to achieve this on Linux:

  • Video Acceleration API (VA-API) is a specification and open source library to provide both hardware accelerated video encoding and decoding, developed by Intel.
  • Video Decode and Presentation API for Unix (VDPAU) is an open source library and API to offload portions of the video decoding process and video post-processing to the GPU video-hardware, developed by NVIDIA.
  • NVDECODE/NVENCODE - proprietary APIs for hardware video acceleration used by NVIDIA Fermi, Kepler, Maxwell and Pascal generation GPUs.

For pre-2007 video cards see XvMC. For comprehensive overview of driver and application support see #Comparison tables.

Installation

Intel

Intel graphics open-source drivers support VA-API:

NVIDIA

Nouveau open-source driver supports both VA-API and VDPAU:

NVIDIA proprietary driver supports via nvidia-utils:

  • VDPAU on GeForce 8 series and newer GPUs;
  • NVDECODE on Fermi and newer GPUs [1];
  • NVENCODE on Kepler and newer GPUs.

ATI/AMD

ATI and AMDGPU open-source drivers support both VA-API and VDPAU:

  • VA-API on Radeon HD 2000 and newer GPUs is supported by libva-mesa-driver.
  • VDPAU on Radeon R300 and newer GPUs is supported by mesa-vdpau.

AMDGPU PRO proprietary driver is built on top of AMDGPU driver and supports both VA-API and VDPAU.

Translation layers

To get VA-API support when device driver provides none:

To get VDPAU support when device driver provides none:

Verification

Your system may work perfectly out-of-the-box without needing any configuration. Therefore it is a good idea to start with this section to see that it is the case.

Tip: mpv is great for testing hardware acceleration in practice.

Verifying VA-API

Verify the settings for VA-API by running vainfo, which is provided by libva-utils:

$ vainfo
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 1.7.3
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice

VAEntrypointVLD means that your card is capable to decode this format, VAEntrypointEncSlice means that you can encode to this format.

In this example the i965 driver is used, as you can see in this line:

libva info: Trying to open /usr/lib/dri/i965_drv_video.so

If the following error is displayed when running vainfo:

libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

You need to configure the correct driver, see #Configuring VA-API.

Verifying VDPAU

Install vdpauinfo to verify if the VDPAU driver is loaded correctly and retrieve a full report of the configuration:

$ vdpauinfo
display: :0   screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name   width height types

420 16384 16384 NV12 YV12 422 16384 16384 UYVY YUYV 444 16384 16384 Y8U8V8A8 V8U8Y8A8 Decoder capabilities: name level macbs width height
MPEG1 --- not supported --- MPEG2_SIMPLE 3 9216 2048 1152 MPEG2_MAIN 3 9216 2048 1152 H264_BASELINE 41 9216 2048 1152 H264_MAIN 41 9216 2048 1152 H264_HIGH 41 9216 2048 1152 VC1_SIMPLE 1 9216 2048 1152 VC1_MAIN 2 9216 2048 1152 VC1_ADVANCED 4 9216 2048 1152 ..

Configuration

Although the video driver should automatically enable hardware video acceleration support for both VA-API and VDPAU, it may be needed to configure VA-API/VDPAU manually. Only continue to this section if you went through #Verification.

The default driver names, used if there is no other configuration present, are guess by the system. However, they are often hacked together and may not work. You can see the guessed values by running:

$ grep -iE 'vdpau | dri driver' ~/.local/share/xorg/Xorg.0.log
(II) RADEON(0): [DRI2] DRI driver: radeonsi
(II) RADEON(0): [DRI2] VDPAU driver: radeonsi

In this case radeonsi is the default for both VA-API and VDPAU.

Note: If you use GDM, run journalctl -b | grep -iE 'vdpau | dri driver' instead.

This does not represent the configuration however. The values above will not change even if you override them.

Configuring VA-API

You can override the driver for VA-API by using the LIBVA_DRIVER_NAME environment variable:

Note:
  • You can find the installed drivers in /usr/lib/dri/. They are used as /usr/lib/dri/${LIBVA_DRIVER_NAME}_drv_video.so.
  • Some drivers are installed several times under different names for compatibility reasons. You can see which by running sha1sum /usr/lib/dri/*.
  • LIBVA_DRIVERS_PATH can be used to overrule the VA-API drivers location.
  • Since version 12.0.1 libva-mesa-driver provides radeonsi instead of gallium.

Configuring VDPAU

You can override the driver for VDPAU by using the VDPAU_DRIVER environment variable.

The correct driver name depends on your setup:

  • For Intel Graphics or AMD Catalyst you need to set it to va_gl.
  • For the open source AMD/ATI driver set it to the proper driver version depending on your GPU, see #Verification.
  • For the open source Nouveau driver set it to nouveau.
  • For NVIDIA's proprietary version set it to nvidia.
Note:
  • You can find the installed drivers in /usr/lib/vdpau/. They are used as /usr/lib/vdpau/libvdpau_${VDPAU_DRIVER}.so.
  • Some drivers are installed several times under different names for compatibility reasons. You can see which by running sha1sum /usr/lib/vdpau/*.
  • For hybrid setups (both NVIDIA and AMD), it may be necessary to set DRI_PRIME=1. For more information see PRIME.

Troubleshooting

Failed to open VDPAU backend

You need to set VDPAU_DRIVER variable to point to correct driver. See #Configuring VDPAU.

VAAPI init failed

An error along the lines of libva: /usr/lib/dri/i965_drv_video.so init failed is encountered. This can happen because of improper detection of Wayland. One solution is to unset $DISPLAY so that mpv, mplayer, VLC, etc. do not assume it is X11. Another mpv-specific solution is to add the parameter --opengl-backend=wayland.

Comparison tables

VA-API drivers

Codec libva-intel-driver [2] intel-media-driver [3] libva-mesa-driver [4] [5] AMD Catalyst
(XvBA adapter)
libva-vdpau-driver
(VDPAU adapter)
Decoding
MPEG-2 GMA 4500 and newer Broadwell and newer Radeon HD 6000 and newer
GeForce 8 and newer1
Radeon HD 4000 and newer See #VDPAU drivers
MPEG-44 No No Radeon HD 6000 and newer Radeon HD 6000 and newer
VC-1 Sandy Bridge and newer Broadwell and newer Radeon HD 2000 and newer
GeForce 9300 and newer1
Radeon HD 4000 and newer
H.264/MPEG-4 AVC GMA 45002, Ironlake and newer Radeon HD 2000 and newer
GeForce 8 and newer1
Radeon HD 4000 and newer
H.265/HEVC 8bit Cherryview/Braswell and newer Skylake and newer Radeon R9 Fury and newer No
H.265/HEVC 10bit Broxton and newer Broxton/Apollo Lake and newer Radeon 400 and newer
VP8 Broadwell and newer Broadwell and newer No No
VP9 8bit Broxton and newer
Hybrid: Broadwell to Skylake3
Broxton/Apollo Lake and newer Raven Ridge and newer See #VDPAU drivers
VP9 10bit Kaby Lake and newer Kaby Lake and newer
Encoding
MPEG-2 Ivy Bridge and newer Broadwell and newer
except Broxton/Apollo Lake
No No No
H.264/MPEG-4 AVC Sandy Bridge and newer Broadwell and newer Radeon HD 7000 and newer
H.265/HEVC 8bit Skylake and newer Skylake and newer Radeon 400 and newer
H.265/HEVC 10bit Kaby Lake and newer Kaby Lake and newer Raven Ridge and newer
VP8 Cherryview/Braswell and newer
Hybrid: Haswell to Skylake3
No
VP9 8bit Kaby Lake and newer Icelake and newer
VP9 10bit No

VDPAU drivers

Codec mesa-vdpau [6] [7] nvidia-utils [8] libvdpau-va-gl
(VA-API adapter)
Decoding
MPEG-2 Radeon R300 and newer
GeForce 8 and newer1
GeForce 8 and newer No
MPEG-4 Radeon HD 6000 and newer
GeForce 200 and newer1
GeForce 200 and newer
VC-1 Radeon HD 2000 and newer
GeForce 9300 and newer1
GeForce 8 and newer2
H.264/MPEG-4 AVC Radeon HD 2000 and newer
GeForce 8 and newer1
GeForce 8 and newer See #VA-API drivers
H.265/HEVC 8bit Radeon R9 Fury and newer GeForce 900 and newer3 No
H.265/HEVC 10bit Radeon 400 and newer No4
VP9 No No No
  • 1 Up until GeForce GTX 750.
  • 2 Except GeForce 8800 Ultra, 8800 GTX, 8800 GTS (320/640 MB).
  • 3 Except GeForce GTX 970 and GTX 980.
  • 4 NVIDIA implementation is limited to 8-bit streams [9] [10].

NVIDIA driver only

Codec nvidia-utils [11]
NVDECODE NVENCODE
MPEG-2 Fermi and newer1 No
VC-1
H.264/MPEG-4 AVC Kepler and newer2
H.265/HEVC 8bit Maxwell (GM206) and newer Maxwell (2nd Gen) and newer
H.265/HEVC 10bit Pascal and newer
VP8 Maxwell (2nd Gen) and newer No
VP9 8bit Maxwell (GM206) and newer
VP9 10bit Pascal and newer
  • 1 Except GM108 (not supported)
  • 2 Except GM108 and GP108 (not supported)

Application support

Application Decoding Encoding Documentation
VA-API VDPAU NVDECODE VA-API NVENCODE
FFmpeg Yes Yes Yes Yes Yes FFmpeg#Hardware video acceleration
GStreamer Yes1 Yes Yes2 Yes1 Yes2 GStreamer#Hardware video acceleration
Kodi Yes Yes Yes Kodi#Hardware video acceleration
mpv Yes Yes Yes mpv#Hardware video acceleration
VLC media player Yes Yes No VLC media player#Hardware video acceleration
MPlayer Yes3 Yes No MPlayer#Hardware video acceleration
Flash No4 Yes4 No Browser plugins#Adobe Flash Player
Chromium Yes3 No No Chromium#Hardware video acceleration
Firefox No No No Bug report
  • 1 GStreamer uses a whitelist of VA-API drivers. To use other drivers like intel-media-driver, set environment variable GST_VAAPI_ALL_DRIVERS=1.
  • 2 NVDECODE/NVENCODE is disabled in the Arch package.
  • 3 Not supported officially by developers, alternative packages available.
  • 4 VDPAU is supported only by NPAPI plugin. PPAPI plugin to NPAPI browser experimental adapter is available that provides partial VA-API and VDPAU acceleration.
Tip: To reduce CPU usage while watching YouTube where VP8/VP9 hardware decoding is not available use the h264ify extension (available for Firefox and Chromium) or the enhanced-h264ify extension (available for Firefox and Chromium).