How to Setup and Deploy Intel® Media Server Studio on CentOS* 7.1

The CentOS* 7.1 default kernel is considered a primary OS for the current version of Intel Media Server Studio. See additional information in the Getting Started Guide.

We use the following kernel in our build_kernel_rpm_CentOS.sh script: kernel-3.10.0-229.1.2.el7.src.rpm. However, there are many other recent kernels. For an updated list of recent kernels, see: vault.centos.org:

The following section details how to install Intel Media Server Studio on other than "Gold" kernel release (kernel-3.10.0-229.11.1.el7.src.rpm) from the CentOS* official website.

1 Setup Intel Media Server Studio on CentOS* 7.1

The following sections describe the steps for setting up Intel Media Server on a system with CentOS 7.1 OS.

1.1 Setup the User Mode Graphics Driver (UMD)

(as regular user)
$ tar –xvzf mediaserverstudio*.tar.gz
$ cd mediaserverstudio*
$ tar -xvzf SDK*.tar.gz
$ cd SDK*/CentOS
$ tar -xvzf install_scripts*.tar.gz

(as root)
# ./install_sdk_UMD_CentOS.sh

For more information, see the Getting Started Guide.

1.2 Setup the Kernel Mode Graphics Driver (KMD)

The following sections explain three different options for setting up the Kernel Mode Graphics Driver (KMD)

via kernel tree
Follow these steps to set up the kernel mode graphics (KMD) driver for Intel Media Server Studio via a kernel tree.

1. Setup the rpm build environment

(as regular user)
$ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

2. Setup the kernel source rpm package

(as regular user)
$ wget http://vault.centos.org/7.1.1503/updates/Source/SPackages/kernel-3.10.0-229.11.1.el7.src.rpm
$ rpm -i kernel-3.10.0-229.11.1.el7.src.rpm 2>&1 | grep -v mock 
$ cd ~/rpmbuild/SPECS
$ rpmbuild -bp --target=$(uname -m) kernel.spec

3. Apply the KMD patches for Intel Media Server Studio

(as regular user)
$ cd ~/rpmbuild/BUILD/kernel-3.10.0-229.11.1.el7
$ 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.10.0-229.11.1.el7.centos.x86_64
$ for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done

Note: You will need to fix any issues causing conflicts and rejections during patching

4. Build and install the patched kernel:

(as regular user)
$ make oldconfig
$ sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-MSSr6"/g' .config
$ make –j8

(as root)
# make modules_install
# make install
# reboot ==> new kernel

5. Create the source and binary rpm packages for easy setup on additional machines (optional)

(as regular user)
$ make rpm-pkg

6. Verify the installation

See "Verifying correct installation" in media_server_studio_getting_started_guide.pdf

via rpmbuild

1. Upgrade to a new kernel

(as root)
# yum update kernel-3.10.0-229.11.1.el7   ## upgrade to new kernel

2. Apply KMD patches to the kernel source tree

See sections 1 – 3 in "via kernel tree" above.

3. Build and setup the patched kernel

(as regular user)
$ cd ~/rpmbuild/SPECS
$ sed -i "s#%define specrelease 229.11.1%{?dist}#%define specrelease 229.11.1%{?dist}.MSSr6.39163%{?dist}#" kernel.spec
$ rpmbuild –ba --target=$(uname –m) kernel.spec

(as root)
# cd ~/rpmbuild/RPMS/x86_64
# rpm -Uvh kernel-3.10.*.rpm
# reboot

Note: source rpm package can be found in ~/rpmbuild/SRPMS

4. Verify the installation was successful and then proceed

See "Verifying correct installation" in media_server_studio_getting_started_guide.pdf

via build_kernel_rpm_CentOS.sh

1. Upgrade to a new kernel

(As root)
# yum update kernel-3.10.0-229.11.1.el7   ## upgrade to new kernel

2. Modify build_kernel_rpm_CentOS.sh

-CENTOS7_LATEST_KER_BID=229.1.2
+CENTOS7_LATEST_KER_BID=229.11.1

3. Build and setup patched kernel

(As a regular user)
$ cp build_kernel_rpm_CentOS.sh /MSS
$ cd /MSS
$ ./build_kernel_rpm*.sh 6 ## 6 for R6 version 

(as root)
# cd /MSS/rpmbuild/RPMS/x86_64
# rpm -Uvh kernel-3.10.*.rpm
# reboot

Note: If this method is unsuccessful, refer to steps 3 and 4 in “via kernel tree” section, which install Intel Media Server Studio without the build script shown here.

1.3 Troubleshooting

1.3.1 Fix rejection and setup new KMD

The Intel® Graphics Driver for Linux* includes three important kernel modules (drm.ko, drm_kms_helper.ko and i915.ko). Typically, Intel Media Server Studio patches apply to the source of these kernel modules. If the Intel Media Server Studio patches to CentOS* 7.1 kernel tree patches failed, you will see rejection files (*.rej) in the kernel tree. To fix, you need to implement manual changes and merge them into patches in the rejection files. In addition, you need to fix any compile or link issues during the rebuild of the kernel.

Rerun the following command line:

$ ./sample_multi_transcode_drm -hw -i::h264 test.h264 -o::h264 output.h264 -angle 180 -opencl
$ ./sample_encode_drm h264  -hw -i test.yuv -o test-la-out.h264 -w 720 -h 480 -la -lad 20

If the command lines ends successfully, your kernel tree patch is ready for use. If the script throws an error, you need to debug the KMD code You can use following command lines to build DRM and i915 separately.

(As a regular user)
$ cp /boot/config-`uname -r` .config
$ make oldconfig
$ make menuconfig
$ make prepare
$ make modules_prepare
$ make M=drivers/gpu/drm

You can use following command lines to install DRM and i915 separately.

(As root)
# cp drivers/gpu/drm/drm.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm
# cp drivers/gpu/drm/ drm_kms_helper.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm
# cp drivers/gpu/drm/i915/i915.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm/i915
# mkinitrd -f -v /boot/initrd-$(uname -r).img $(uname -r)
# reboot

1.3.2 Verify the new KMD with Intel Media Server Studio sample

Find "Samples and Tutorials" section in media_server_studio_getting_started_guide.pdf and use the following command lines to test the KMD.

$ ./sample_multi_transcode_drm -hw -i::h264 test.h264 -o::h264 output.h264 -angle 180 -opencl
$ ./sample_encode_drm h264  -hw -i test.yuv -o test-la-out.h264 -w 720 -h 480 -la -lad 20

1.3.3 FAQ

  • Q: Can I install Intel Media Server Studio on my CentOS* 7.1 kernel? If so, how to do it?
    A: Yes. After you fix the patch, Intel Media Server Studio should work correctly on the kernel.
     
  • Q: If the install fails, how to roll-back to a previous kernel?
    A: Try to select a previous kernel using the grub menu. If the grub menu does not work, run “make install”. In this case, use the grub menu to make sure that the new kernel is OK before you reboot with it.

2 Deploy Intel® Media Server Studio on CentOS* 7.1

This section provides instructions for testing and deploying Intel Media Server Studio on CentOS* 7.1

1. Deploy Intel Media Server Studio UMD

Use the library runtime package, not the development package. You can use command line "rpm -qlp *.rpm" If you want to check files in rpm,

(as regular user)
$ tar –xvzf mediaserverstudio*.tar.gz
$ cd mediaserverstudio*
$ tar -xvzf SDK*.tar.gz
$ cd SDK*/CentOS
$ find -name "*.rpm" | grep -v devel ## list runtime rpm package

2. Deploy the KMD of MSS

Create Kernel binary rpm package

(as regular user)
$ cd /MSS
$ ./build_kernel_rpm*.sh 6 ## 6 for R6 version

Note: Use kernel binary rpm package that be created by build_kernel_rpm_CentOS.sh. More detail can be found in media_server_studio_getting_started_guide.pdf Create the kernel source rpm package

(as regular user)
$ cd /MSS
$ sed -i 's/\-bb/\-bs/' build_kernel_rpm_CentOS.sh
$ ./build_kernel_rpm*.sh 6 ## 6 for R6 version

Note: If you run into kernel rpm package issues, use the kernel source package for customer to rebuild kernel. The source and binary rpm package /MSS/rpmbuild/SRPMS/kernel-3.10.0-229.1.2.39163.MSSr6.el7.centos.src.rpm can be found in ~/rpmbuild/RPMS/x86_64 folder.

3. Rebuild kernel binary rpm package from the kernel source rpm package

(as regular user)
$ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
$ rpmbuild --rebuild --target=$(uname -m) --with firmware --without debug --without debuginfo --without perf --without tools kernel-3.10.0-229.1.2.39163.MSSr6.el7.centos.src.rpm

4. Conclusion

We suggest including three components when deploying the Intel Media Server Studio. You can run your scripts for the components installation on CentOS* 7.1

  • UMD of Media Server without developing the package.
  • Kernel binary rpm package.
  • Kernel source rpm package.
Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.