Difference between revisions of "Hardware video acceleration"
(→Formats: Catalyst doesn't support VP8,VP9 and HEVC) |
m (→Software: remove links now everything has landed in the stable packages) |
||
(32 intermediate revisions by 10 users not shown) | |||
Line 36: | Line 36: | ||
! MPEG2 | ! MPEG2 | ||
| {{G|GMA 4500 and newer}} | | {{G|GMA 4500 and newer}} | ||
− | | | + | | {{G|Radeon HD 4000 and newer?}} |
| {{G|Radeon HD 4000 and newer}} | | {{G|Radeon HD 4000 and newer}} | ||
| rowspan=5 style="background:#d3d3d3;" | See VDPAU. | | rowspan=5 style="background:#d3d3d3;" | See VDPAU. | ||
Line 42: | Line 42: | ||
! MPEG4 | ! MPEG4 | ||
| {{R|✗}} | | {{R|✗}} | ||
+ | | ? | ||
| {{G|Radeon HD 6000 and newer}} | | {{G|Radeon HD 6000 and newer}} | ||
|- | |- | ||
! H.264 | ! H.264 | ||
| {{G|GMA 4500<sup>1</sup>, Ironlake Graphics and newer}} | | {{G|GMA 4500<sup>1</sup>, Ironlake Graphics and newer}} | ||
+ | | {{G|Radeon HD 4000 and newer?}} | ||
| {{G|Radeon HD 4000 and newer}} | | {{G|Radeon HD 4000 and newer}} | ||
|- | |- | ||
! HEVC (H.265) | ! HEVC (H.265) | ||
| {{G|Cherryview/Braswell and newer}} | | {{G|Cherryview/Braswell and newer}} | ||
+ | | {{G|Radeon HD 6000 and newer?}} | ||
| {{R|✗}} | | {{R|✗}} | ||
|- | |- | ||
! VC1 | ! VC1 | ||
| {{G|Sandy Bridge Graphics and newer}} | | {{G|Sandy Bridge Graphics and newer}} | ||
+ | | {{G|Radeon HD 4000 and newer?}} | ||
| {{G|Radeon HD 4000 and newer}} | | {{G|Radeon HD 4000 and newer}} | ||
|- | |- | ||
! VP8 | ! VP8 | ||
| {{G|Broadwell and newer}} | | {{G|Broadwell and newer}} | ||
+ | | ? | ||
| {{R|✗}} | | {{R|✗}} | ||
| rowspan=2 style="background:#faa;" | ✗ | | rowspan=2 style="background:#faa;" | ✗ | ||
Line 63: | Line 68: | ||
! VP9 | ! VP9 | ||
| {{G|Broxton and newer}} | | {{G|Broxton and newer}} | ||
+ | | ? | ||
| {{R|✗}} | | {{R|✗}} | ||
|- | |- | ||
Line 69: | Line 75: | ||
! MPEG2 | ! MPEG2 | ||
| {{G|Ivy Bridge Graphics and newer}} | | {{G|Ivy Bridge Graphics and newer}} | ||
− | | rowspan=5 | + | | ? |
− | + | | rowspan=5 style="background:#faa;" | ✗ | |
| rowspan=5 style="background:#faa;" | ✗ | | rowspan=5 style="background:#faa;" | ✗ | ||
|- | |- | ||
! H.264 | ! H.264 | ||
| {{G|Sandy Bridge Graphics and newer}} | | {{G|Sandy Bridge Graphics and newer}} | ||
− | | {{ | + | | {{G|Radeon HD 4000 and newer?}} |
|- | |- | ||
! HEVC (H.265) | ! HEVC (H.265) | ||
Line 118: | Line 124: | ||
|- | |- | ||
! HEVC (H.265) | ! HEVC (H.265) | ||
− | | {{ | + | | {{G|1=[https://cgit.freedesktop.org/mesa/mesa/commit/src/gallium/state_trackers/vdpau/decode.c?id=5609a6986f3eb3c452d66d373b6081df5c6fb34c yes] {{Expansion|which cards?}}}} |
| {{G|GeForce 900<sup>4</sup> and newer}} | | {{G|GeForce 900<sup>4</sup> and newer}} | ||
| rowspan=4 style="background:#faa;" | ✗<sup>2</sup> | | rowspan=4 style="background:#faa;" | ✗<sup>2</sup> | ||
Line 132: | Line 138: | ||
* <sup>3</sup> [[Wikipedia:Nvidia PureVideo|Except]] GeForce 8800 Ultra, 8800 GTX, 8800 GTS (320/640 MB). | * <sup>3</sup> [[Wikipedia:Nvidia PureVideo|Except]] GeForce 8800 Ultra, 8800 GTX, 8800 GTS (320/640 MB). | ||
* <sup>4</sup> Except GeForce GTX 970 and GTX 980. | * <sup>4</sup> Except GeForce GTX 970 and GTX 980. | ||
+ | |||
+ | {| class="wikitable" style="text-align:center;" | ||
+ | |+ Nvidia NVDEC/NVENC ([[NVIDIA]] only) | ||
+ | ! | ||
+ | ! Decoding (NVDEC) | ||
+ | ! Encoding (NVENC) | ||
+ | |- | ||
+ | ! MPEG-2 | ||
+ | | {{G|✓}} | ||
+ | | {{R|✗}} | ||
+ | |- | ||
+ | ! VC-1 | ||
+ | | {{G|✓}} | ||
+ | | {{R|✗}} | ||
+ | |- | ||
+ | ! H.264 | ||
+ | | {{G|✓}} | ||
+ | | {{G|✓}} | ||
+ | |- | ||
+ | ! HEVC (H.265) | ||
+ | | {{G|Pascal and newer}} | ||
+ | | {{G|Pascal and newer}} | ||
+ | |- | ||
+ | ! VP8 | ||
+ | | {{G|Maxwell2 and newer}} | ||
+ | | {{R|✗}} | ||
+ | |- | ||
+ | ! VP9 | ||
+ | | {{G|Pascal and newer}} | ||
+ | | {{R|✗}} | ||
+ | |- | ||
+ | |} | ||
The features supported by your GPU may vary. To see what your GPU supports see [[#Verification]]. | The features supported by your GPU may vary. To see what your GPU supports see [[#Verification]]. | ||
Line 143: | Line 181: | ||
! VA-API | ! VA-API | ||
! VDPAU | ! VDPAU | ||
+ | ! NVDEC/NVENC | ||
|- | |- | ||
! [[GStreamer]] | ! [[GStreamer]] | ||
| {{G|✓ (with {{pkg|gstreamer-vaapi}}, see [[GStreamer#Hardware acceleration]])}} | | {{G|✓ (with {{pkg|gstreamer-vaapi}}, see [[GStreamer#Hardware acceleration]])}} | ||
+ | | {{G|✓ (with {{pkg|gst-plugins-bad}}, see [[GStreamer#Hardware acceleration]])}} | ||
| {{G|✓ (with {{pkg|gst-plugins-bad}}, see [[GStreamer#Hardware acceleration]])}} | | {{G|✓ (with {{pkg|gst-plugins-bad}}, see [[GStreamer#Hardware acceleration]])}} | ||
|- | |- | ||
Line 151: | Line 191: | ||
| {{G|✓ (see [[VLC media player#Hardware acceleration support]])}} | | {{G|✓ (see [[VLC media player#Hardware acceleration support]])}} | ||
| {{G|✓ (see [[VLC media player#Hardware acceleration support]])}} | | {{G|✓ (see [[VLC media player#Hardware acceleration support]])}} | ||
+ | | {{R|✗}} | ||
|- | |- | ||
! [[mpv]] | ! [[mpv]] | ||
| {{G|✓ (see [[mpv#Hardware decoding]])}} | | {{G|✓ (see [[mpv#Hardware decoding]])}} | ||
| {{G|✓ (see [[mpv#Hardware decoding]])}} | | {{G|✓ (see [[mpv#Hardware decoding]])}} | ||
+ | | {{G|✓}} | ||
|- | |- | ||
! [[MPlayer]] | ! [[MPlayer]] | ||
| {{G|✓ (with {{aur|mplayer-vaapi}}, see [[MPlayer#Enabling VA-API]])}} | | {{G|✓ (with {{aur|mplayer-vaapi}}, see [[MPlayer#Enabling VA-API]])}} | ||
| {{G|✓ (see [[MPlayer#Enabling VDPAU]])}} | | {{G|✓ (see [[MPlayer#Enabling VDPAU]])}} | ||
+ | | {{R|✗}} | ||
|- | |- | ||
! [[Flash]] | ! [[Flash]] | ||
| {{G|✓ (with {{pkg|libvdpau-va-gl}}, see [[Flash#Configuration]])}} | | {{G|✓ (with {{pkg|libvdpau-va-gl}}, see [[Flash#Configuration]])}} | ||
| {{G|✓ (see [[Flash#Configuration]])}} | | {{G|✓ (see [[Flash#Configuration]])}} | ||
+ | | {{R|✗}} | ||
|- | |- | ||
! [[Kodi]] | ! [[Kodi]] | ||
+ | | {{G|✓}} | ||
| {{G|✓}} | | {{G|✓}} | ||
| {{G|✓}} | | {{G|✓}} | ||
|- | |- | ||
! [[Firefox]] | ! [[Firefox]] | ||
− | | colspan=2 style="background:#faa;" | ✗ [https://bugzilla.mozilla.org/show_bug.cgi?id=1210726] [https://bugzilla.mozilla.org/show_bug.cgi?id=1210727] [https://bugzilla.mozilla.org/show_bug.cgi?id=563206] | + | | colspan=2 style="background:#faa; text-align: center;" | ✗ [https://bugzilla.mozilla.org/show_bug.cgi?id=1210726] [https://bugzilla.mozilla.org/show_bug.cgi?id=1210727] [https://bugzilla.mozilla.org/show_bug.cgi?id=563206] |
+ | | {{R|✗}} | ||
|- | |- | ||
! [[Chromium]] | ! [[Chromium]] | ||
| {{Y|[https://chromium-review.googlesource.com/c/chromium/src/+/532294 WIP] ({{AUR|chromium-vaapi}})}} | | {{Y|[https://chromium-review.googlesource.com/c/chromium/src/+/532294 WIP] ({{AUR|chromium-vaapi}})}} | ||
| {{R|✗}} | | {{R|✗}} | ||
+ | | {{R|✗}} | ||
+ | |- | ||
+ | ! [[FFmpeg]] | ||
+ | | {{G|✓}} | ||
+ | | {{G|✓}} | ||
+ | | {{G|✓}} | ||
|} | |} | ||
Line 201: | Line 253: | ||
* [[ATI]]/[[AMDGPU]] Radeon 9500 and newer GPUs are supported by either {{pkg|libva-mesa-driver}} with {{pkg|mesa}} or {{pkg|libva-vdpau-driver}} (see [[#Installing VDPAU]]). | * [[ATI]]/[[AMDGPU]] 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]] GMA 4500 series and newer GPUs are supported by {{pkg|libva-intel-driver}} with {{pkg|mesa}}. | * [[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. | + | ** To get better support on GMA 4500 consider using {{aur|libva-intel-driver-g45-h264}} instead, see [[Intel#Hardware accelerated H.264 decoding on GMA 4500]] for instructions and caveats. |
+ | ** A new usermode driver being developed by Intel is available for Broadwell, Skylake, Kabylake, Apollolake and Canonlake: {{aur|intel-media-driver-git}} | ||
* [[Nouveau|NVIDIA]] GeForce 8 series and newer GPUs are supported by {{pkg|libva-vdpau-driver}} (see [[#Installing VDPAU]]). | * [[Nouveau|NVIDIA]] GeForce 8 series and newer GPUs are supported by {{pkg|libva-vdpau-driver}} (see [[#Installing VDPAU]]). | ||
Line 224: | Line 277: | ||
** [[AMD Catalyst]] uses {{pkg|libvdpau-va-gl}} (see [[#Installing VA-API]]). | ** [[AMD Catalyst]] uses {{pkg|libvdpau-va-gl}} (see [[#Installing VA-API]]). | ||
** [[AMDGPU PRO]] uses {{AUR|amdgpu-pro-vdpau}} (see [[AMDGPU#AMDGPU PRO]]). | ** [[AMDGPU PRO]] uses {{AUR|amdgpu-pro-vdpau}} (see [[AMDGPU#AMDGPU PRO]]). | ||
− | * [[NVIDIA]] GeForce | + | * [[NVIDIA]] GeForce 600 series and newer GPUs are supported by {{pkg|nvidia-utils}}. |
+ | ** GeForce 400/500 series are supported by {{pkg|nvidia-390xx-utils}}. | ||
** GeForce 8/9 and GeForce 100-300 series are supported by {{pkg|nvidia-340xx-utils}}. | ** GeForce 8/9 and GeForce 100-300 series are supported by {{pkg|nvidia-340xx-utils}}. | ||
Line 334: | Line 388: | ||
In this case {{ic|radeonsi}} is the default for both VA-API and VDPAU. | 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. | This does not represent the ''configuration'' however. The values above will not change even if you override them. | ||
Line 346: | Line 402: | ||
{{Note| | {{Note| | ||
− | * You can find the installed drivers in {{ic|/usr/lib/dri/}}. They are used as {{ic|/usr/lib/ | + | * 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/*}}. | * Some drivers are installed several times under different names for compatibility reasons. You can see which by running {{ic|sha1sum /usr/lib/dri/*}}. | ||
* Since version 12.0.1 {{Pkg|libva-mesa-driver}} provides {{ic|radeonsi}} instead of {{ic|gallium}}. | * Since version 12.0.1 {{Pkg|libva-mesa-driver}} provides {{ic|radeonsi}} instead of {{ic|gallium}}. | ||
Line 374: | Line 430: | ||
However you may want to configure your media player to use VA-API instead, getting far better results. See [[#Software]]. | However you may want to configure your media player to use VA-API instead, getting far better results. See [[#Software]]. | ||
+ | |||
+ | === 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}}. |
Revision as of 13:56, 13 May 2018
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.
- 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.
Contents
Support
Formats
libva-intel-driver [1] | libva-mesa-driver | Catalyst XvBA | libva-vdpau-driver
(VDPAU adapter) | |
---|---|---|---|---|
Decoding | ||||
MPEG2 | GMA 4500 and newer | Radeon HD 4000 and newer? | Radeon HD 4000 and newer | See VDPAU. |
MPEG4 | ✗ | ? | Radeon HD 6000 and newer | |
H.264 | GMA 45001, Ironlake Graphics and newer | Radeon HD 4000 and newer? | Radeon HD 4000 and newer | |
HEVC (H.265) | Cherryview/Braswell and newer | Radeon HD 6000 and newer? | ✗ | |
VC1 | Sandy Bridge Graphics and newer | Radeon HD 4000 and newer? | Radeon HD 4000 and newer | |
VP8 | Broadwell and newer | ? | ✗ | ✗ |
VP9 | Broxton and newer | ? | ✗ | |
Encoding | ||||
MPEG2 | Ivy Bridge Graphics and newer | ? | ✗ | ✗ |
H.264 | Sandy Bridge Graphics and newer | Radeon HD 4000 and newer? | ||
HEVC (H.265) | Skylake and newer | ? | ||
VP8 | Cherryview/Braswell and newer | ? | ||
VP9 | Kaby Lake and newer | ? |
mesa-vdpau | nvidia-utils | amdgpu-pro-vdpauAUR | libvdpau-va-gl (VA-API adapter) | |
---|---|---|---|---|
Decoding | ||||
MPEG2 | Radeon 9500 and newer, GeForce 8 and newer | GeForce 8 and newer | ? | ✗2 |
MPEG4 | Radeon HD 6000 and newer, GeForce 200 and newer | GeForce 200 and newer | ||
H.264 | Radeon HD 4000 and newer, GeForce 8 and newer | GeForce 8 and newer | See VA-API. | |
HEVC (H.265) | yes | GeForce 9004 and newer | ✗2 | |
VC1 | Radeon HD 4000 and newer, GeForce 83 and newer | GeForce 83 and newer |
- 1 Supported by libva-intel-driver-g45-h264AUR instead.
- 2 As of version 0.3, the VA GL driver does not support any other hardware decoder than H.264.
- 3 Except GeForce 8800 Ultra, 8800 GTX, 8800 GTS (320/640 MB).
- 4 Except GeForce GTX 970 and GTX 980.
Decoding (NVDEC) | Encoding (NVENC) | |
---|---|---|
MPEG-2 | ✓ | ✗ |
VC-1 | ✓ | ✗ |
H.264 | ✓ | ✓ |
HEVC (H.265) | Pascal and newer | Pascal and newer |
VP8 | Maxwell2 and newer | ✗ |
VP9 | Pascal and newer | ✗ |
The features supported by your GPU may vary. To see what your GPU supports see #Verification.
Regarding the amdgpu-pro-vdpauAUR package, see AMDGPU#AMDGPU PRO.
Software
VA-API | VDPAU | NVDEC/NVENC | |
---|---|---|---|
GStreamer | ✓ (with gstreamer-vaapi, see GStreamer#Hardware acceleration) | ✓ (with gst-plugins-bad, see GStreamer#Hardware acceleration) | ✓ (with 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 mplayer-vaapiAUR, see MPlayer#Enabling VA-API) | ✓ (see MPlayer#Enabling VDPAU) | ✗ |
Flash | ✓ (with libvdpau-va-gl, see Flash#Configuration) | ✓ (see Flash#Configuration) | ✗ |
Kodi | ✓ | ✓ | ✓ |
Firefox | ✗ [2] [3] [4] | ✗ | |
Chromium | WIP (chromium-vaapiAUR) | ✗ | ✗ |
FFmpeg | ✓ | ✓ | ✓ |
Installation
The choice varies depending on your video card vendor:
- For Intel Graphics use VA-API.
- For NVIDIA cards use VDPAU.
- For AMD cards you can use both (with mesa). The difference is really only in the application implementation [5].
There are also two specific types of drivers for VA-API and VDPAU:
- libva-vdpau-driver, which uses VDPAU as a backend for VA-API.
- libvdpau-va-gl, which uses VA-API as a backend for VDPAU.
For pre-2007 cards see XvMC.
Installing VA-API
Open source drivers:
- ATI/AMDGPU Radeon 9500 and newer GPUs are supported by either libva-mesa-driver with mesa or libva-vdpau-driver (see #Installing VDPAU).
- Intel GMA 4500 series and newer GPUs are supported by libva-intel-driver with mesa.
- To get better support on GMA 4500 consider using libva-intel-driver-g45-h264AUR instead, see Intel#Hardware accelerated H.264 decoding on GMA 4500 for instructions and caveats.
- A new usermode driver being developed by Intel is available for Broadwell, Skylake, Kabylake, Apollolake and Canonlake: intel-media-driver-gitAUR
- NVIDIA GeForce 8 series and newer GPUs are supported by libva-vdpau-driver (see #Installing VDPAU).
Proprietary drivers:
- AMD cards depend on the driver:
- AMD Catalyst uses xvba.
- AMDGPU PRO uses libva-vdpau-driver + amdgpu-pro-vdpauAUR (see AMDGPU#AMDGPU PRO).
- NVIDIA GeForce 8 series and newer GPUs are supported by libva-vdpau-driver (see #Installing VDPAU).
Installing VDPAU
Open source drivers:
- ATI/AMDGPU Radeon 9500 and newer GPUs are supported by mesa-vdpau.
- Intel GMA 4500 series and newer GPUs are supported by libvdpau-va-gl (see #Installing VA-API).
- NVIDIA GeForce 8 series and newer GPUs are supported by mesa-vdpau. It requires nouveau-fwAUR, which contains the required firmware to operate that is presently extracted from the NVIDIA binary driver.
Proprietary drivers:
- AMD cards depend on the driver:
- AMD Catalyst uses libvdpau-va-gl (see #Installing VA-API).
- AMDGPU PRO uses amdgpu-pro-vdpauAUR (see AMDGPU#AMDGPU PRO).
- NVIDIA GeForce 600 series and newer GPUs are supported by nvidia-utils.
- GeForce 400/500 series are supported by nvidia-390xx-utils.
- GeForce 8/9 and GeForce 100-300 series are supported by nvidia-340xx-utils.
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.
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.
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:
- For Intel Graphics use
i965
. - For NVIDIA use
vdpau
. - For AMD use either
radeonsi
orvdpau
.
- 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/*
. - Since version 12.0.1 libva-mesa-driver provides
radeonsi
instead ofgallium
.
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 NVIDIA's proprietary version set it to
nvidia
.
- 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
This happens when you use libvdpau-va-gl without overriding VDPAU_DRIVER
. VDPAU does not know what driver to use in this case for some reason and guesses wrongly. See #Configuring VDPAU.
However you may want to configure your media player to use VA-API instead, getting far better results. See #Software.
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
.