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 MIT & BSD-3-Clause

Prerequisites

For Ubuntu 16.04+

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

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 -j"$(nproc)"

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

Supported Platforms

  • BDW (Broadwell)
  • SKL (Skylake)
  • BXT (Broxton) / APL (Apollo Lake)
  • KBLx (KBL/Kaby Lake; CFL/Coffe Lake; WHL/Whiskey Lake; CML/Comet Lake; AML/Amber Lake)
  • ICL (Ice Lake)
  • JSL (Jasper Lake)/EHL (Elkhart Lake)
  • TGL (Tiger Lake)

Components and Features

Media driver contains three components as below

  • Video decoding calls hardware-based decoder(VDBox) which provides fully-accelerated hardware video decoding to release the graphics engine for other operations.
  • Video encoding supports two modes, one calls hardware-based encoder(VDEnc/Huc) to provide low power encoding, another one is hardware(PAK)+shader(media kernel+VME) based encoding. User could choose the mode through VA-API.
  • Video processing supports several popular features by hardware-based video processor(VEBox/SFC) and shader(media kernel) based solution together.

Media driver supports two build types as below

  • Full Feature Build is default driver build, which supports all feature by hardware accelerator and close source shaders(media kernel binaries). Ubuntu intel-media-va-driver-non-free package is generated from this build type.
  • Free Kernel Build, enables fully open source shaders(media kernels) and hardware features but the features would be limited. Ubuntu intel-media-va-driver package is generated from this build type.

Decoding/Encoding Features

CODECBuild TypesBDWSKLBXT/APLKBLxICLEHL/JSLTGL*
AVCFull Feature
Free Kernel
D/Es
D
D/E/Es
D/E
D/E/Es
D/E
D/E/Es
D/E
D/E/Es
D/E
D/E
D/E
D/E/Es
D/E
MPEG-2Full Feature
Free Kernel
D/Es
D
D/Es
D
D
D
D/Es
D
D/Es
D
D
D
D/Es
D
VC-1Full Feature
Free Kernel
D
 
D
 
D
 
D
 
D
 
D
 
D
 
JPEGFull Feature
Free Kernel
D
D
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
D/E
VP8Full Feature
Free Kernel
D
D
D
D
D
D
D/Es
D
D/Es
D
D
D
HEVC 8bitFull Feature
Free Kernel
D/Es
D
D/Es
D
D/Es
D
D/E/Es
D/E
D/E
D/E
D/E/Es
D/E
HEVC 8bit 422Full Feature
Free Kernel
D/Es
D
D
D
D/Es
D
HEVC 8bit 444Full Feature
Free Kernel
D/E
D/E
D/E
D/E
D/E
D/E
HEVC 10bitFull Feature
Free Kernel
D
D
D/Es
D
D/E/Es
D/E
D/E
D/E
D/E/Es
D/E
HEVC 10bit 422Full Feature
Free Kernel
D/Es
D
D
D
D/Es
D
HEVC 10bit 444Full Feature
Free Kernel
D/E
D/E
D/E
D/E
D/E
D/E
HEVC 12bitFull Feature
Free Kernel
D/Es
D
HEVC 12bit 422Full Feature
Free Kernel
D
D
HEVC 12bit 444Full Feature
Free Kernel
D
D
VP9 8bitFull Feature
Free Kernel
D
D
D
D
D/E
D/E
D/E
D/E
D/E
D/E
VP9 8bit 444Full Feature
Free Kernel
D/E
D/E
D/E
D/E
D/E
D/E
VP9 10bitFull Feature
Free Kernel
D
D
D/E
D/E
D/E
D/E
D/E
D/E
VP9 10bit 444Full Feature
Free Kernel
D/E
D/E
D/E
D/E
D/E
D/E
VP9 12bitFull Feature
Free Kernel
D
D
VP9 12bit 444Full Feature
Free Kernel
D
D
  • D - Hardware Decoding
  • E - Hardware Encoding, Low Power Encoding(VDEnc/Huc)
  • Es - Hardware(PAK) + Shader(media kernel+VME) Encoding

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

For more information, please refer to

Video Processing Features

FeaturesBuild TypesBDWSKLBXT/APLKBLxICLEHL/JSLTGL
BlendingFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
CSC
(Color Space Conversion)
Full Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
De-interlaceFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes*
Yes*
Yes
Yes
De-noiseFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
 
No
 
Yes
 
Luma KeyFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
MirroringFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
ProcAmp
(brightness,contrast,hue,saturation)
Full Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
RotationFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
ScalingFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
SharpeningFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
No
No
Yes
Yes
STD/E
(Skin Tone Detect & Enhancement)
Full Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
 
No
 
Yes
 
TCC
(Total Color Control)
Full Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
 
No
 
Yes
 
Color fillFull Feature
Free Kernel
Yes
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
Chroma SitingFull Feature
Free Kernel
 
 
Yes
 
Yes
 
Yes
 
Yes
Yes
Yes
Yes
Yes
Yes
HDR10 Tone MappingFull Feature
Free Kernel
 
 
 
 
 
 
 
 
Yes
 
No
 
Yes
 

For more feature information, please refer to Supported video processing csc/scaling format

Build Options

You could follow below build options to enable these two builds.

  • Full Feature Build: ENABLE_KERNELS=ON(Default) ENABLE_NONFREE_KERNELS=ON(Default)
  • Free Kernel Build: ENABLE_KERNELS=ON ENABLE_NONFREE_KERNELS=OFF
    • If trying to use pre-built open source kernel binaries, please add BUILD_KERNELS=OFF(Default).
    • If trying to rebuild open source kernel from source code, please add BUILD_KERNELS=ON.

* EHL/JSL only support BOB DI

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

  3. HuC firmware is needed for AVC/HEVC/VP9 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
    • ICL: starting from kernel 5.2
    • EHL/JSL/TGL: drm-tip, missed in <=5.4.3 kernels
  4. TGL: preliminary support and may not be fully functional. It requires Linux kernel 5.4+ loaded with i915.force_probe=* parameter to be tried. [drm-tip] (https://cgit.freedesktop.org/drm-tip) should work with more support and bug fixes.

  5. TGL VME encode has known issue 112377 with drm-tip

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