Intel(R) Media Driver for VAAPI

Introduction

The Intel(R) Media Driver for VAAPI is a new VA-API (Video Acceleration API) user mode driver supporting hardware accelerated decoding, encoding, and video post processing for GEN based graphics hardware.

License

The Intel(R) Media Driver for VAAPI is distributed under the MIT license with portions covered under the BSD 3-clause “New” or “Revised” License. You may obtain a copy of the License at:

https://opensource.org/licenses/MIT

&

https://opensource.org/licenses/BSD-3-Clause

Prerequisites

For Ubuntu 16.04 and above

# apt install autoconf libtool libdrm-dev xorg xorg-dev openbox libx11-dev libgl1-mesa-glx libgl1-mesa-dev

Equivalents for other distributions should work.

Dependencies

Libva - https://github.com/intel/libva

GmmLib - https://github.com/intel/gmmlib (please check https://github.com/intel/media-driver/wiki/Comparability-with-GmmLib)

Building

  1. Build and install libva master
  2. Build and install gmmlib master
  3. Get media repo and format the workspace folder as below (suggest the workspace to be a dedicated one for media driver build):
<workspace>
    |- media-driver
$ mkdir <workspace>/build_media
$ cd <workspace>/build_media
$ cmake ../media-driver
$ make -j8

Install

$ sudo make install

This will install the following files (e.g. on Ubuntu):

-- Installing: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
-- Installing: /etc/profile.d/intel-media.sh
-- Installing: /usr/lib/x86_64-linux-gnu/igfxcmrt64.so

For iHD_drv_video.so please export related LIBVA environment variables.

export LIBVA_DRIVERS_PATH=<path-contains-iHD_drv_video.so>
export LIBVA_DRIVER_NAME=iHD

Build Modes

This section summarizes key driver build modes which can be used in the different environment requirements:

Build optionDefault valueDependenciesComments
ENABLE_KERNELSONN/AEnable/Disable shaders during driver build
ENABLE_NONFREE_KERNELSONENABLE_KERNELS=ONEnable/disable close source shaders (kernels) during the build
BUILD_KERNELSOFFENABLE_KERNELS=ON, ENABLE_NONFREE_KERNELS=OFFIf enabled, rebuild open source shaders (kernels) from sources. Requires ENABLE_NONFREE_KERNELS=OFF

With the above options it is possible to build (table assumes that non-listed options have default values):

No.Build option(s)HW FeaturesShaders (Kernels)Comments
1ENABLE_KERNELS=ONYesClose source (pre-built)Default, full feature driver
2ENABLE_KERNELS=OFFYesNoneHW features only, include HW decoder, HW VDEnc Encoder (CQP mode)
3ENABLE_NONFREE_KERNELS=OFFYesOpen source (pre-built)HW features available in prev. mode (ENABLE_KERNELS=ON) and features supported by open source shaders
4ENABLE_NONFREE_KERNELS=OFF BUILD_KERNELS=ONYesOpen sourceSame as ENABLE_NONFREE_KERNELS=OFF driver, but shaders are rebuilt from sources

Supported Platforms

BDW (Broadwell)

SKL (Skylake)

BXT (Broxton) / APL (Apollo Lake)

KBL (Kaby Lake)

CFL (Coffee Lake)

WHL (Whiskey Lake)

CNL (Cannonlake)

ICL (Ice Lake)

Default Driver Build Features

CODECBDWSKLBXT/APLKBLCFLWHLCNLICL*
AVCD/EsD/E/EsD/E/EsD/E/EsD/E/EsD/E/EsD/EsD/E/Es
MPEG-2D/EsD/EsDD/EsD/EsD/EsD/EsD/Es
VC-1DDDDDDDD
JPEGDD/ED/ED/ED/ED/ED/ED/E
VP8DDDDDD/EsD/EsD/Es
HEVC 8bitD/EsD/EsD/EsD/EsD/EsD/EsD/E/Es
HEVC 10bitDDDDD/EsD/E/Es
VP9 8bitDDDDDD/E
VP9 10bitDDDDD/E

D - HW Decoding

E - HW Encoding

Es - HW + Shader Encoding

* ICL encoding is pending on i915 support on upstream, for more information, please check Known Issues and Limitations #5.

Video ProcessingBDWSKLBXT/APLKBLCFLWHLCNLICL
BlendingYYYYYYYY
CSC (Color Space Conversion)YYYYYYYY
De-interlaceYYYYYYYY
De-noiseYYYYYYYY
Luma KeyYYYYYYYY
MirroringYYYYYYYY
ProcAmp (brightness,contrast,hue,saturation)YYYYYYYY
RotationYYYYYYYY
ScalingYYYYYYYY
SharpeningYYYYYYYY
STD/E (Skin Tone Detect & Enhancement)YYYYYYYY
TCC (Total Color Control)YYYYYYYY
Color fillYYYYYYYY
Chroma SitingYYYYYYY
HDR10 Tone MappingY

For detail feature information, you can access Media Features.

HW Media Features

Media FeaturesBDWSKLBXT/APLKBLCFLWHLCNLICL
AVCDDD/ED/ED/ED/EDD/E
MPEG-2DDDDDDDD
VC-1DDDDDDDD
JPEGDD/ED/ED/ED/ED/ED/ED/E
VP8DDDDDDDD
HEVC 8bitDDDDDDD/E
HEVC 10bitDDDDDD/E
VP9 8bitDDDDDD/E
VP9 10bitDDDDD/E

D - HW Decoding

E - HW Encoding, VDEnc CQP mode only, BRC mode is pending on i915 support on upstream.

Open Source Shader Media Features

Media FeaturesBDWSKLBXT/APLKBLCFLWHLCNLICL
BlendingY
CSC (Color Space Conversion)Y
De-interlaceY
Luma KeyY
MirroringY
ProcAmp (brightness,contrast,hue,saturation)Y
RotationY
ScalingY
SharpeningY
Color fillY
Chroma SitingY

Close Source Shader Media Codec Features

All Open Source Shaders listed in the previous paragraph are still available, but Close Source Media Codec Shaders provide few additional features listed below.

Encode FeaturesBDWSKLBXT/APLKBLCFLWHLCNLICL*
AVCEsEsEsEsEsEsEsEs
MPEG-2EsEsEsEsEsEsEs
VP8EsEsEs
HEVC 8bitEsEsEsEsEsEsEs
HEVC 10bitEsEs

Es - HW + Shader Encoding

* ICL encoding is pending on i915 support on upstream, for more information, please check Known Issues and Limitations #5.

Known Issues and Limitations

  1. Intel(R) Media Driver for VAAPI is recommended to be built against gcc compiler v6.1 or later, which officially supported C++11.

  2. SKL: Green or other incorrect color will be observed in output frames when using YV12/I420 as input format for csc/scaling/blending/rotation, etc. on Ubuntu 16.04 stock (with kernel 4.10). The issue can be addressed with the kernel patch: WaEnableYV12BugFixInHalfSliceChicken7 commit 0b71cea29fc29bbd8e9dd9c641fee6bd75f6827

  3. HuC firmware is needed for AVC low power encoding bitrate control, including CBR, VBR, etc. As of now, HuC firmware support is disabled in Linux kernels by default. Please, refer to i915 kernel mode driver documentation to learn how to enable it. Mind that HuC firmware support presents in the following kernels for the specified platforms:

    • APL/KBL: starting from kernel 4.11
    • CFL: starting from kernel 4.15
  4. ICL: preliminary support and may not be fully functional. It requires Linux kernel 4.17+ loaded with i915.alpha_support=1 parameter to be tried.

  5. ICL encoding has two known issues:

(*) Other names and brands may be claimed as property of others.