Generic Installation for Intel ® Media Server Studio

ID 671960
Updated 5/30/2018
Version Latest
Public

author-image

By

Purpose

This article covers the installation steps for Intel ® Media Server Studio 2018 R1 on Ubuntu 16.04.03 with Kernel 4.4.111.

Please check the hardware configuration support described in Linux* Release Notes.

Support is limited for the "Generic" installation of Intel ® Media Server Studio Professional and Essential edition. For a better understanding of what "Generic" means see next section.


What are "Gold" and "Generic" Installations?

Intel ® Media Server Studio install updates many graphics stack components, such as the kernel, the i915 kernel-mode graphics driver, the user-mode graphics driver, and libraries like libdrm and libva.

A "Gold" configuration is fully validated and supported.  Kernel patches are prepared for the default/non-updated kernel for this specific release.

The "Generic" approach allows you to build your own configuration based on a minimal set of requirements. 
Usually this means using patches prepared for a specific kernel branch ( 4.4 for 16.8/ Intel ® Media Server Studio 2017 and 2018).

The main distinction between "Gold" and "Generic" is support.  Functionally they are identical, but more freedom brings more responsibility. Intel's provides much more support for "Gold" than it does "Generic".  In general, any issues found in Generic installs must be reproducible in a Gold configuration for Intel to process bug reports. 

Note: ANY updates affecting graphics stack or kernel components can potentially cause your configuration to become Generic. 
 

High level view of Media SDK Software Stack

 

Pre-Requisites

Follow these steps for setting up Intel ® Media Server Studio on Ubuntu* 16.04.03 long term support (LTS) with kernel 4.4.111.

Note: steps are similar for other versions of Ubuntu or Ubuntu-based distros like Mint. 

GCC, glibc and libstdc++.so version:


The main requirements for "Generic" installation are:

glibc >=2.12
gcc >=4.7
However, your Linux distro may have a different gcc, glibc, libstdc++ version.

Use following command lines to check the gcc version on the system

gcc -v
gcc –version


Use following command line to check the glibc version

ldd --version


ldd (GNU libc) 2.17
......
Many Linux distros have updated toolsets or other mechanisms to easily upgrade gcc.  Upgrading glibc can be significantly more difficult and is not recommended for production systems.

If gcc is too old, update:

sudo apt-get install g++-4.7    # or higher gcc version


Add the user(s) that will run Intel ® Media Server Studio(MSS) applications to the video group
Note: to find the user you can run the whoami command

usermod –a –G video <user>

Check that an Intel VGA adapter can be found with lspci

lspci -nn –s 0:02.0
00:02.0 VGA compatible controller [0300]: Intel Corporation Sky Lake Integrated Graphics [8086:193b] (rev 09)
The command output above shows 193b as the graphics device ID. The ID reported by lspci may be different for your machine. The main thing to look for is that an Intel graphics adapter is available. If not, you may need to check your BIOS settings and hardware configuration.


Update apt to make sure that you have an updated package list for upgrades as well as new packages.
 

sudo apt-get update


Installation steps

Remove other Libdrm/Libva(This is OPTIONAL as it is recommended to start on a bare Ubuntu 16.04.03 image)

sudo find /usr -name "libdrm*" | xargs sudo rm -rf
sudo find /usr -name "libva*" | xargs sudo rm -rf

Remove old MSS Install files(This is OPTIONAL as it is recommended to start on a bare Ubuntu 16.04.03 image)

sudo rm -rf /opt/intel/mediasdk
sudo rm -rf /opt/intel/common
sudo rm -rf /opt/intel/opencl

Unpack MSS file

tar –xzvf MediaServerStudioProfessional2018R1.tar
cd MediaServerStudioProfessional2018R1

Unpack SDK/HEVC/OpenCL with HEVC being optional

tar -xzvf SDK2018Production16.8.tar.gz
tar -xzvf intel_sdk_for_opencl_2017_7.0.0.2580_x64.tgz
tar -xzvf HEVC2018R1.tar.gz
cd SDK2018Production16.8/Generic

Upack OpenCL components and MSS Generic package

tar -xvzf intel-linux-media_generic*.tar.gz
find ./ -type f -name "intel-opencl*x86_64.tar.xz" -exec tar xvJf {} \;

Place generic components in standard locations

sudo /bin/cp -r etc/* /etc
sudo /bin/cp -r lib/* /lib
sudo /bin/cp -r opt/* /opt
sudo /bin/cp -r usr/* /usr

Note: You will have to run these commands under root(sudo –H gnome-terminal)

echo '/usr/lib64' > /etc/ld.so.conf.d/libdrm_intel.conf
echo '/usr/local/lib' >> /etc/ld.so.conf.d/libdrm_intel.conf

Rest of the steps below should be executed in user terminal

sudo ldconfig
sudo apt-get -y install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc g++

Install and patch kernel 4.4.111

wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.111.tar.gz
tar -xzvf linux-4.4.111.tar.gz
cp /opt/intel/mediasdk/opensource/patches/kmd/4.4.111/intel-kernel-patches.tar.bz2 .
tar -xvjf intel-kernel-patches.tar.bz2
cd linux-4.4.111
for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done
make olddefconfig
make –j 8
sudo make modules_install
sudo make install

Reboot and load through the newly installed and patched Kernel 4.4.11.

Validate Kernel

uname -r


Set Library Path

export LD_LIBRARY_PATH=/usr/lib64

Smoke Test No. 1


Note: MEDIA_INSTALL_PATH defines the initial location of where you stored the original Media Server Studio tar file

Extract Media Server Studio Samples

cd <MEDIA_INSTALL_PATH>/MediaServerStudioProfessional2018R1
tar –xzvf MediaSamples_Linux_2018R1_b982.tar.gz
cd samples/_bin/x64

Run Multi-transcode Sample

./sample_multi_transcode –i::h264 ../content/test_stream.264 –o::h264 test_out.h264


Expected Results:

Multi Transcoding Sample Version 8.2.25.982
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
Pipeline surfaces number (DecPool): 20
MFX HARDWARE Session 0 API ver 1.25 parameters:
Input video: AVC
Output video: AVC
Session 0 was NOT joined with other sessions
Transcoding started
..
Transcoding finished
Common transcoding time is 0.235762 sec
-----------------------------------------------------------------------
--------
*** session 0 PASSED (MFX_ERR_NONE) 0.235465 sec, 101 frames
-i::h264 ../content/test_stream.264 -o::h264 test_out.h264
-----------------------------------------------------------------------
--------
The test PASSED

Smoke Test No. 2

Run encode sample:

sample_encode h265 -i test_stream_176x96.yuv -w 176 -h 96 -o out.h265 -pe e5400a06c74d41f5b12d430bbaa23d0b

The -pe parameter in the command is the HEVC gacc encoder GUID found in opt/intel/mediasdk/plugins/plugins.cfg.

Expected Results:

plugin_loader.h :172 [INFO] Plugin was loaded from GUID: { 0xe5, 0x40, 0x0a, 0x06, 0xc7, 0x4d, 0x41, 0xf5, 0xb1, 0x2d, 0x43, 0x0b, 0xba, 0xa2, 0x3d, 0x0b } (Intel (R) Media SDK GPU-Accelerated plugin for HEVC ENCODE)
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
Encoding Sample Version 8.2.25.982


Input file format    YUV420
Output video        HEVC
Source picture:
    Resolution    176x96
    Crop X,Y,W,H    0,0,176,96
Destination picture:
    Resolution    176x96
    Crop X,Y,W,H    0,0,176,96
Frame rate    30.00
Bit rate(Kbps)    366
Gop size    0
Ref dist    0
Ref number    0
Idr Interval    0
Target usage    balanced
Memory type    system
Media SDK impl        hw
Media SDK version    1.25

Processing started
Frame number: 101
plugin_loader.h :198 [INFO] MFXBaseUSER_UnLoad(session=0x0x55fc1cc305d0), sts=0

Processing finished


Smoke Test No. 3

Build LibVA tools

git clone https://github.com/intel/libva-utils.git
cd libva-utils/
git checkout tags/1.8.3
sudo apt-get install automake libtool
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$PKG_CONFIG_PATH

Note: If you have any issues with running the autogen script below take a look at the config.log file for helpful hints to fix the issue

./autogen.sh –-prefix=/usr --libdir=/usr/lib/x86-linux-gnu

IMPORTANT: Comment out lines 244-248(entire if statement) in encode/avcenc.c file or you will get an error when running the following command

make –j4
sudo make install

The vainfo utility should show the current driver, Media SDK's iHD (from /opt/intel/mediasdk) and several codec entry points.
 

vainfo

Expected Results:

libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0  (libva 2.0.0.pre1)
vainfo: Driver version: 16.8.69021-ubit 
vainfo: Supported profile and entrypoints 
VAProfileH264ConstrainedBaseline:
VAProfileH264ConstrainedBaseline:
VAProfileH264Main :
VAProfileH264Main :
VAProfileH264High :
VAProfileH264High :  VAEntrypointVLD
VAEntrypointEncSlice
VAEntrypointVLD
VAEntrypointEncSlice
VAEntrypointVLD
VAEntrypointEncSlice

HEVC Installation(Optional)

Note:The HEVC package is for Intel ® Media Server Studio Professional 2018 R1 ONLY and isn't for Intel ® Media Server Studio Essential/Community 2018 R1 Edition.

The steps below will show you how to install HEVC for Intel ® Media Server Studio(MSS) Professional 2018 R1. These steps should be followed after installation of MSS Professional 2018 R1.

Unpack HEVC file

tar -xzvf HEVC2018R1.tar.gz

Run the installer that will guide you through the installation process
 

./install.sh


Smoke Test No. 1

Note: You should run smoke test in local directory instead of root directory to obtain optimal results.
 

./sample_multi_transcode –i::h265 ../content/test_stream.265 –o::h265 test_out.h265 -sw -pe 2fca99749fdb49aeb121a5b63ef568f7

The -pe parameter in the command is the HEVC sw encoder GUID found in opt/intel/mediasdk/plugins/plugins.cfg.

Expected Results:

Multi Transcoding Sample Version 8.2.25.982


plugin_loader.h :172 [INFO] Plugin was loaded from GUID: { 0x15, 0xdd, 0x93, 0x68, 0x25, 0xad, 0x47, 0x5e, 0xa3, 0x4e, 0x35, 0xf3, 0xf5, 0x42, 0x17, 0xa6 } (Intel (R) Media SDK plugin for HEVC DECODE)
plugin_loader.h :172 [INFO] Plugin was loaded from GUID: { 0x2f, 0xca, 0x99, 0x74, 0x9f, 0xdb, 0x49, 0xae, 0xb1, 0x21, 0xa5, 0xb6, 0x3e, 0xf5, 0x68, 0xf7 } (Intel (R) Media SDK plugin for HEVC ENCODE)
Pipeline surfaces number (DecPool): 12
MFX SOFTWARE Session 0 API ver 1.25 parameters:
Input  video: HEVC
Output video: HEVC

Session 0 was NOT joined with other sessions

Transcoding started
..
Transcoding finished

Common transcoding time is 1.0314 sec
-------------------------------------------------------------------------------
*** session 0 PASSED (MFX_ERR_NONE) 1.03131 sec, 101 frames
-i::h265 ../content/test_stream.265 -o::h265 test_out.h265 -sw -pe 2fca99749fdb49aeb121a5b63ef568f7

-------------------------------------------------------------------------------

The test PASSED
plugin_loader.h :198 [INFO] MFXBaseUSER_UnLoad(session=0x0x55c950c3bb80), sts=0
plugin_loader.h :198 [INFO] MFXBaseUSER_UnLoad(session=0x0x55c950c3bb80), sts=0