Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Build Media SDK on Ubuntu

Anton Grishin edited this page Jan 17, 2020 · 9 revisions

This build documentation was tested under clear Ubuntu Server 18.04 (with gcc-7.3.0, gcc-8.1.0 and clang-6.0 compilers) but it should work on another OS distributions with various versions of gcc and clang.

Prepare environment and dependencies

Install all required common packages:

sudo apt-get install git cmake pkg-config

Build and install LibVA and its dependencies:

The minimum required meson version is 0.37.0 or later

sudo apt-get install meson libdrm-dev automake libtool

Take latest libva version:

git clone https://github.com/intel/libva.git
cd libva

Or you can take the recommended working version libva (by checkout to latest tag):

git clone https://github.com/intel/libva.git
cd libva

# fetch available tags 
git fetch --tags

# find latest
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latest_tag

Build using make

./autogen.sh
make

To install it on your system:

make install

Also it can be built and installed with using meson

meson build
ninja -C build
cd build
sudo ninja install

[Optional] In addition you can build and install some optional dependencies:

Packages needed for test_monitor:

sudo apt-get install googletest libgtest-dev libpciaccess0 libpciaccess-dev

Packages needed for rotate_opencl plugin:

sudo apt-get install opencl-headers ocl-icd-dev ocl-icd-opencl-dev

#Download package from https://github.com/intel/compute-runtime/releases/tag/18.24.10921
dpkg -i intel-opencl_18.24.10921_amd64.deb

Packages needed for wayland:

sudo apt-get install libffi libffi-dev expat expat-dev

#Install package:
wget https://wayland.freedesktop.org/releases/wayland-1.8.93.tar.xz
tar xf wayland-1.8.93.tar.xz
cd wayland-1.8.93
./configure --disable-documentation
make
make install

Packages needed for X11:

sudo apt-get install libX11-dev
#After that rebuild libva   

Build Media SDK

Get sources

Use the following Git* command (pay attention that to get full Media SDK sources bundle it is required to have Git* with LFS support):

git clone https://github.com/Intel-Media-SDK/MediaSDK msdk
cd msdk

Configure and build Media SDK install

Use cmake version 2.8.5 or later

mkdir build && cd build
cmake ..
make

ProTip: Output of cmake will have full information about the configuration in which Media SDK will be built. Read it carefully.

ProTip: Use following command to speed up the build: make -j12 where 12 - is number of cores on your host

After that you will have all Media SDK binaries in the folder build.

In case of clang building

In addition to all previous steps install clang and configure cmake to use clang during the build:

sudo apt-get install clang-8
mkdir build && cd build
cmake .. -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8
make

If you want to install Media SDK on your host run:

make install
Clone this wiki locally