Hi,
I've been trying to install the Media SDK on a Ubuntu 18.04.1 machine without any luck.
uname -a
Linux 4.15.0-44-generic #47-Ubuntu SMP Mon Jan 14 11:26:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
cat /proc/cpuinfo
Intel(R) Xeon(R) CPU E3-1225 v5 @ 3.30GHz
So without touching the machine after a fresh install I SSH to it and run my script. The script is divided into two phases with a reboot after the first script.(the scripts are included in the zip file )->
#!/bin/bash set -e #Ensure the platform is up to date sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade #Install baseline dependencies first (inclusive of OpenCL headers+) sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev intel-gpu-tools opencl-headers libwayland-dev xutils-dev ocl-icd-* #Add the Oibaf PPA, needed to install the latest development headers for libva: sudo add-apt-repository ppa:oibaf/graphics-drivers -y sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade #To address linker problems down the line with Ubuntu 18.04LTS: #https://forum.openframeworks.cc/t/ubuntu-unable-to-compile-missing-glx-mesa/29367/2 if [ -f /usr/lib/x86_64-linux-gnu/libGLX_mesa.so ]; then sudo rm /usr/lib/x86_64-linux-gnu/libGLX_mesa.so fi sudo ln -s /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0 /usr/lib/x86_64-linux-gnu/libGLX_mesa.so #Setup build environment: mkdir -p ~/vaapi #installing the latest build of libdrm echo "**************************************" echo "*** Building and installing libdrm ***" echo "**************************************" cd ~/vaapi git clone https://anongit.freedesktop.org/git/mesa/drm.git libdrm cd libdrm ./autogen.sh --prefix=/usr --enable-udev time make -j$(nproc) VERBOSE=1 sudo make -j$(nproc) install sudo ldconfig -vvvv #installing the latest build of libdrm echo "**************************************" echo "*** Building and installing libva ***" echo "**************************************" cd ~/vaapi git clone https://github.com/01org/libva cd libva ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu time make -j$(nproc) VERBOSE=1 sudo make -j$(nproc) install sudo ldconfig -vvvv #installing the latest build of gmmlib echo "**************************************" echo "*** Building and installing gmmlib ***" echo "**************************************" mkdir -p ~/vaapi/workspace cd ~/vaapi/workspace git clone https://github.com/intel/gmmlib mkdir -p build cd build cmake -DCMAKE_BUILD_TYPE= Release ../gmmlib make -j$(nproc) sudo make -j$(nproc) install #installing the latest build of Intel Media driver echo "***************************************************" echo "*** Building and installing Intel Media driver: ***" echo "***************************************************" cd ~/vaapi/workspace git clone https://github.com/intel/media-driver cd media-driver git submodule init git pull mkdir -p ~/vaapi/workspace/build_media cd ~/vaapi/workspace/build_media cmake ../media-driver \ -DMEDIA_VERSION="2.0.0" \ -DBS_DIR_GMMLIB=$PWD/../gmmlib/Source/GmmLib/ \ -DBS_DIR_COMMON=$PWD/../gmmlib/Source/Common/ \ -DBS_DIR_INC=$PWD/../gmmlib/Source/inc/ \ -DBS_DIR_MEDIA=$PWD/../media-driver \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=/usr/lib/x86_64-linux-gnu \ -DINSTALL_DRIVER_SYSCONF=OFF \ -DLIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri time make -j$(nproc) VERBOSE=1 sudo make -j$(nproc) install VERBOSE=1 #Add yourself to the video group: sudo usermod -a -G video $USER #export environment variables # # TODO: If LIBVA_DRIVERS_PATH or LIBVA_DRIVER_NAME exists.. then replace # if [[ -z "${LIBVA_DRIVERS_PATH}" ]]; then sudo sh -c "echo 'LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri'>> /etc/environment" fi if [[ -z "${LIBVA_DRIVER_NAME}" ]]; then sudo sh -c "echo 'LIBVA_DRIVER_NAME=iHD'>> /etc/environment" fi #installing the latest build of libva-utils echo "*******************************************" echo "*** Building and installing libva-utils ***" echo "*******************************************" cd ~/vaapi git clone https://github.com/intel/libva-utils cd libva-utils ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu time make -j$(nproc) VERBOSE=1 sudo make -j$(nproc) install #reboot echo echo "Reboot system by typing -> sudo reboot now ***" echo
Then after the reboot this script is executed ->
#!/bin/bash set -e #Build Media SDK sudo echo #to avoid the break at sudo make install cd ~/vaapi git clone https://github.com/Intel-Media-SDK/MediaSDK msdk cd msdk mkdir build && cd build cmake -DENABLE_OPENCL=OFF .. make sudo make install
Everything compiles and installs however when trying to decode using the included sample decoder.. I get this Error->
LD_LIBRARY_PATH=/opt/intel/mediasdk/lib /opt/intel/mediasdk/share/mfx/samples/sample_decode h264 -i myVideo2.nal -o out.yuv
[ERROR], sts=MFX_ERR_MEMORY_ALLOC(-4), CreateAllocator, CreateHWDevice failed at /home/netinsight/vaapi/msdk/samples/sample_decode/src/pipeline_decode.cpp:1282
[ERROR], sts=MFX_ERR_MEMORY_ALLOC(-4), Init, CreateAllocator failed at /home/netinsight/vaapi/msdk/samples/sample_decode/src/pipeline_decode.cpp:425
[ERROR], sts=MFX_ERR_MEMORY_ALLOC(-4), main, Pipeline.Init failed at /home/netinsight/vaapi/msdk/samples/sample_decode/src/sample_decode.cpp:676
So obviously the Media SDK is not working as expected. Has anyone successfully installed the Media SDK on a Ubuntu 18.04.1? What am I doing wrong?
Thanks for any assistance.
/Anders