Generic Linux* Intel® Media Server Studio Installation

ID 671997
Updated 9/11/2016
Version Latest
Public

author-image

By

This article covers Linux* install options for Intel® Media Server Studio. The Getting Started Guide provides instructions for installing on the Gold OS:

  • Intel® Media Server Studio 2016: CentOS* 7.1.1503 
  • Intel® Media Server Studio 2017: CentOS* 7.2.1511

This article explains how to install on other configurations like  Ubuntu*.

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

Issues can only be processed for the "Gold" validated configuration.  For more info see the next section.

 

See also: 

 

What are "Gold", "Generic", and "Secondary OS" 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.  Note: ANY updates affecting graphics stack or kernel components can potentially cause your configuration to become Generic.  See  Media Server Studio CentOS Update Options for more information.

The "Generic" approach allows you to build your own configuration based on a minimal set of requirements.  More details next section.  Usually this means using patches prepared for a specific kernel branch (3.14.5 for 16.4 drivers/Intel® Media Server Studio 2016, 4.4 for 16.5/ Intel® Media Server Studio 2017), but you can also use the "Gold" patches as a starting point for similar CentOS/RedHat releases.  

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

A possible next step for "Generic" installs is for developers to port patches from the Generic branch (based on the kernel.org version of the 3.14.5/4.4 kernel) to the default kernel of a non-Gold distro.  This porting project is sometimes called "secondary OS" creation.  All of the components needed to start this are in the Generic package.  Usually the process is a straightforward merge of the patches to your desired target kernel.  However, help with porting the patches is usually beyond the scope of Intel support.    

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

[user@host]$ gcc -v
[user@host]$ gcc –version

Use following command line to check the glibc version

[user@host]$ 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.

 

Setting up Intel® Media Server Studio on Ubuntu* 14.04

Follow these steps for setting up Intel Media Server Studio on Ubuntu* 14.04 long term support (LTS).

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

If gcc is too old, update:

[root@host]# apt-get install g++-4.7    # or higher gcc version

Ubuntu 14.04 install steps below.  You can run as a script from the MediaServerStudio*/SDK*/Generic directory (as root).  Please note, this script is intended only as a starting/reference point.

 

install_ubuntu.sh (for Intel® Media Server Studio 2017, based on the 4.4 kernel)

#!/bin/bash

echo "remove other libdrm/libva"
find /usr -name "libdrm*" | xargs rm -rf
find /usr -name "libva*" | xargs rm -rf

echo "Remove old MSS install files ..."
rm -rf /opt/intel/mediasdk
rm -rf /opt/intel/common
rm -rf /opt/intel/opencl


echo "install user mode components"
#unpack the generic package
tar -xvzf intel-linux-media_generic*.tar.gz
tar -xvJf intel-opencl-16.5*.xz
tar -xvJf intel-opencl-devel-16.5*.xz

#put the generic components in standard locations

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

#ensure that new libraries can be found
echo '/usr/lib64' > /etc/ld.so.conf.d/libdrm_intel.conf
echo '/usr/local/lib' >> /etc/ld.so.conf.d/libdrm_intel.conf
ldconfig

echo "install kernel build dependencies"
apt-get -y install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc g++

echo "download 4.4 kernel"
if [ ! -f ./linux-4.4.tar.xz ]; then
     wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.tar.xz
fi
tar -xJf linux-4.4.tar.xz

echo "apply kernel patches" 
cp  /opt/intel/mediasdk/opensource/patches/kmd/4.4/intel-kernel-patches.tar.bz2 .
tar -xvjf intel-kernel-patches.tar.bz2
cd linux-4.4
for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done

echo "build patched 4.4 kernel" 
make olddefconfig
make -j 8
make modules_install
make install


echo "Install finished, please "
echo "1. update LD_LIBRARY_PATH to include /usr/lib64;/usr/local/lib"
echo "2. add user to video group: usermod -a -G video user"
echo "3. reboot"

 

install_ubuntu.sh (for Intel® Media Server Studio 2016, based on the 3.14.5 kernel)

#!/bin/bash

echo "remove other libdrm/libva"
find /usr -name "libdrm*" | xargs rm -rf
find /usr -name "libva*" | xargs rm -rf

echo "Remove old MSS install files ..."
rm -rf /opt/intel/mediasdk
rm -rf /opt/intel/common
rm -rf /opt/intel/opencl


echo "install user mode components"
#unpack the generic package
tar -xvzf intel-linux*.tar.gz

#put the generic components in standard locations
/bin/cp -r etc/* /etc
/bin/cp -r opt/* /opt
/bin/cp -r usr/* /usr

#ensure that new libraries can be found
echo '/usr/lib64' > /etc/ld.so.conf.d/libdrm_intel.conf
echo '/usr/local/lib' >> /etc/ld.so.conf.d/libdrm_intel.conf
ldconfig

echo "install kernel build dependencies"
apt-get -y install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc g++

echo "download 3.14.5 kernel"
if [ ! -f ./linux-3.14.5.tar.xz ]; then
     wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz
fi
tar -xJf linux-3.14.5.tar.xz

echo "apply kernel patches" 
cp  /opt/intel/mediasdk/opensource/patches/kmd/3.14.5/intel-kernel-patches.tar.bz2 .
tar -xvjf intel-kernel-patches.tar.bz2
cd linux-3.14.5
for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done

echo "build patched 3.14.5 kernel" 
make olddefconfig
make -j 8
make modules_install
make install


echo "Install finished, please "
echo "1. update LD_LIBRARY_PATH to include /usr/lib64;/usr/local/lib"
echo "2. add user to video group: usermod -a -G video user"
echo "3. reboot"

 

 

Setting up Intel Media Server Studio on other distros

The basic steps above are known to work on several distros.  Differences to keep in mind:

  • Default locations for libraries vary greatly between distros.  If the search path is managed with LD_LIBRARY_PATH the Media SDK default locations may be used, or other locations specific to your product's installation.
  • Package management system and package requirements to build a kernel vary greatly between distros.  However, package requirements for kernel builds are usually documented.
  • glibc version: usually only an issue with very old distros, but if not recent enough this can be a showstopper
  • gcc version (usually only an issue with older distros)
    • For CentOS/Redhat, easy gcc updates are available in the developer toolsets
    • For Ubuntu and derivatives, update with apt-get
    • For SuSE/SLES, update with zypper

 

2.4 Smoke Tests

The 'vainfo' utility should show that the Intel iHD is loaded, and there should be many VAProfile entry points.

 

$ vainfo
libva info: VA-API version 0.99.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_0_32
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.99 (libva 1.67.0.pre1)
vainfo: Driver version: 16.4.4.47109-ubit
vainfo: Supported profile and entrypoints
      VAProfileH264Baseline           :	VAEntrypointEncSlice

 

Download MSDK samples from https://software.intel.com/en-us/intel-media-server-studio-support/code-samples

[user@host]$ ./sample_multi_transcode_drm -hw -i::h264 input.h264 -o::h264 out.h264

 

Recompiling libva and libdrm (Optional)

Full source for libdrm and libva version used by Media Server Studio are included.  Depending on prefix, you may need to update LD_LIBRARY_PATH to find the libraries after install.  Also, remember to remove other versions of libdrm/libva first.

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

 

1. Rebuild and install libdrm:

[user@host msdk_install]$ cp /opt/intel/mediasdk/opensource/libdrm/*/libdrm-2.4.66.tar.bz2 .
[user@host msdk_install]$ tar xf libdrm-2.4.66.tar.bz2
[user@host msdk_install]$ cd libdrm-2.4.66
[user@host libdrm-2.4.66]$ ./configure --prefix=/usr/local
[user@host libdrm-2.4.66]$ make
[root@host libdrm-2.4.66]# make install

2. Rebuild and install libva:

[user@host msdk_install]$ cp /opt/intel/mediasdk/opensource/libva/*/libva-1.67.0.pre1.tar.bz2 .
[user@host msdk_install]$ tar xf libva-1.67.0.pre1.tar.bz2
[user@host msdk_install]$ cd libva-1.67.0.pre1
[user@host libva-1.67.0.pre1]$ ./configure --prefix=/usr/local --with-drivers-path=/opt/intel/mediasdk/lib64
[user@host libva-1.67.0.pre1]$ make
[root@host libva-1.67.0.pre1]# make install

Note: Please compile libdrm first because libva depend on libdrm