Step by step research into Intel Media SDK for Linux server

Intel release an alpha version of Media SDK for linux servers (Intel® Media SDK 2013 for Linux Servers) recently, here now I am researching on it. I will record my research details in this post, as usual,  can not guarantee everything I write here are exact true and right, only an experiment of it.

Introduction

Intel® Media SDK 2013 for Linux Servers is an SDK for optimizing datacenter and embedded media applications for Linux operating systems to utilize Intel HD Graphics hardware acceleration capabilities. Now, quickly and easily develop optimized media applications for Linux operating systems such as encode, decode, and transcode for real-time streaming, teleconferencing, and video analytics.

You can visit: http://software.intel.com/en-us/vcsource/tools/media-sdk-linux to get more informations from Intel’s official website of Media SDK

Features

  • For Intel Xeon® E3-1285Lv2 and Intel Core™ Processor-based Platforms with Intel HD Graphics
  • Encode, decode, and transcode for server-based streaming
  • Supports Ubuntu* and SUSE* Linux Enterprise Operating Systems
  • Supports H.264, MPEG-2, VC-1 formats

Experiments

Step by step to setup the develop environment, and get into works. My hardware environemts(CPU) is Core 3rd Generation Ivy, according to Intel’s introduction in it Release Notes, I can only choose ubuntu 12.04 server 64 with kernel 3.2.

1. OS Install
Related files:
1. ubuntu-12.04-server-amd64.iso
2. unetbootin-windows-581.exe

According to Intel’s Release Notes, target OS version match with MediaSDK is ubuntu 12.04 server 64 bit with kernel 3.2.
So we choose: ubuntu-12.04-server-amd64.iso(we can not download this version of ubuntu server on ubuntu.com, if you dont have it, you can mail me or call me)

1. Get yourself a USB flash(4G or bigger), use unetbootin-windows-581.exe to write the iso to the USB flash.
2. Plug the USB to 8000e, and power up, press DEL to get into BIOS, choose your newly plugged in USB as first boot option.
3. Install Ubuntu server.
4. Make sure your 8000e can access to the internet (Mail your 8000e’s ethernet MAC ADDR together with your pre-assigned IP addr to 黄阳)
5. I strongly recommend you to not do it on 8000e’s iCF4000 card(which has only 8 GB rom), because I was sucked here 2 times being told “no space left” while compiling the kernel.
2. Media SDK install
Related files:
1. haswell.rar which including but not limits to files:
a. intel-Linux-media_ubuntu_16.1.0.8778_64bit.tar.gz
b. kmd_patched_sources.tar.bz2

Upload haswell.rar to 8000e, and extract it, you will find a file named as intel-linux-media_ubuntu_16.1.0.8778_64bit.tar.gz
1. Extract intel-linux-media_ubuntu_16.1.0.8778_64bit.tar.gz
2. Locate to the extracted files, find and execute ./install_media.sh

jacky@ubuntu-msdk:~/msdk$ ./install_media.sh
INFO... Install on Ubuntu ...
Error... This script must be run as root!
jacky@ubuntu-msdk:~/msdk$ sudo -i
[sudo] password for jacky:
root@ubuntu-msdk:~# ls
root@ubuntu-msdk:~# cd /home/jacky/msdk/
root@ubuntu-msdk:/home/jacky/msdk# ls
bak  install_media.sh  intel-linux-media_ubuntu_16.1.0.8778_64bit.tar.gz  kmd  MSDK  usr
root@ubuntu-msdk:/home/jacky/msdk# ./install_media.sh
INFO... Install on Ubuntu ...
INFO... Installing New Driver...
INFO... The default media driver is renderless API, do you want to use X11 backend?
press 'y' to use X11 backend, otherwise by default(drm backend, renderless)y
INFO... X11 backend enabled!
INFO... MediaSDK installed successfully in /opt/intel/mediasdk!
INFO... Do you want to install KMD?
press 'y' to confirm, otherwise cancelled.y
INFO... Original i915.ko backuped in kmd_backup/i915.ko.2013-07-02_182315
INFO... Trying to install 3.2.42 kmd...
Error... Kernel module updated failed, due to mismatched kernel 3.2.0-23-generic with pre-build KMD. You have to rebuild kernel with patched files (kmd/source) manually.
INFO... Package installation Done.
root@ubuntu-msdk:/home/jacky/msdk# uname -a
Linux ubuntu-msdk 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

As you can see, I was told to rebuild the kernel, so we do it. However it’s a long way to go…

3. Install a bunch of stuffs with rebuild kernel needed:
If you encounter with network setting & routing problems, you can refer to http://bbs.rosoo.net/forum.php?m … pid=24641&fromuid=3 for a guide.

sudo apt-get install git g++ make curl
sudo apt-get install ncurses-dev kernel-package

4. Download kernel

git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
git checkout v3.2

5. Apply Intel Media SDK patch

jacky@ubuntu-msdk:~/kernel/linux-stable/include$ cd ../drivers/char/agp/
jacky@ubuntu-msdk:~/kernel/linux-stable/drivers/char/agp$ cp -r ~/msdk/kmd/source/xcode-ubuntu-kmd-rel/drivers/char/agp/* .
jacky@ubuntu-msdk:~/kernel/linux-stable/drivers/char/agp$ cd ../../gpu/
jacky@ubuntu-msdk:~/kernel/linux-stable/drivers/gpu$ cp -r ~/msdk/kmd/source/xcode-ubuntu-kmd-rel/drivers/gpu/* .
jacky@ubuntu-msdk:~/kernel/linux-stable/drivers/gpu$

6. Recompile kernel

make menuconfig
make-kpkg --initrd --append-to-version -01 kernel_image kernel_headers -j8