diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c11d3def3..99cf248070 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required(VERSION 2.8) project(MIVisionX) -set(VERSION "1.9.1") +set(VERSION "1.9.2") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) @@ -48,11 +48,19 @@ if(APPLE) set(CMAKE_MACOSX_RPATH 1) endif() +option(NEURAL_NET "Build MIVisionX with Neural Net Support" ON) +option(RALI "Build MIVisionX with RALI Support" ON) +option(LOOM "Build MIVisionX with LOOM Support" ON) + add_subdirectory(amd_openvx) add_subdirectory(amd_openvx_extensions) add_subdirectory(apps) add_subdirectory(utilities) -add_subdirectory(rali) +if(RALI) + add_subdirectory(rali) +else() + message("-- ${BoldBlue}RALI Module turned OFF by user option -DRALI=OFF ${ColourReset}") +endif() install(DIRECTORY docs DESTINATION .) diff --git a/MIVisionX-setup.py b/MIVisionX-setup.py index 939c7d9888..0f888bb07e 100644 --- a/MIVisionX-setup.py +++ b/MIVisionX-setup.py @@ -18,295 +18,405 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -__author__ = "Kiriti Nagesh Gowda" -__copyright__ = "Copyright 2018 - 2020, AMD Radeon MIVisionX setup" -__license__ = "MIT" -__version__ = "1.7.13" -__maintainer__ = "Kiriti Nagesh Gowda" -__email__ = "Kiriti.NageshGowda@amd.com" -__status__ = "Shipping" - -import argparse +import os import sys +import argparse + +__author__ = "Kiriti Nagesh Gowda" +__copyright__ = "Copyright 2018 - 2020, AMD Radeon MIVisionX setup" +__license__ = "MIT" +__version__ = "1.8.0" +__maintainer__ = "Kiriti Nagesh Gowda" +__email__ = "Kiriti.NageshGowda@amd.com" +__status__ = "Shipping" + if sys.version_info[0] < 3: - import commands + import commands else: - import subprocess -import os + import subprocess # Import arguments parser = argparse.ArgumentParser() -parser.add_argument('--directory', type=str, default='', help='Setup home directory - optional (default:~/)') -parser.add_argument('--installer', type=str, default='apt-get', help='Linux system installer - optional (default:apt-get) [options: Ubuntu - apt-get; CentOS - yum]') -parser.add_argument('--miopen', type=str, default='2.5.0', help='MIOpen Version - optional (default:2.5.0)') -parser.add_argument('--miopengemm',type=str, default='1.1.5', help='MIOpenGEMM Version - optional (default:1.1.5)') -parser.add_argument('--protobuf', type=str, default='3.12.0', help='ProtoBuf Version - optional (default:3.12.0)') -parser.add_argument('--ffmpeg', type=str, default='no', help='FFMPEG Installation - optional (default:no) [options:yes/no]') -parser.add_argument('--rpp', type=str, default='yes', help='Radeon Performance Primitives (RPP) Installation - optional (default:yes) [options:yes/no]') -parser.add_argument('--rpp_ver', type=str, default='0.4', help='RPP Version - optional (default:0.4)') -parser.add_argument('--reinstall', type=str, default='no', help='Remove previous setup and reinstall - optional (default:no) [options:yes/no]') +parser.add_argument('--directory', type=str, default='~/mivisionx-deps', + help='Setup home directory - optional (default:~/)') +parser.add_argument('--installer', type=str, default='apt-get', + help='Linux system installer - optional (default:apt-get) [options: Ubuntu - apt-get; CentOS - yum]') +parser.add_argument('--opencv', type=str, default='3.4.0', + help='OpenCV Version - optional (default:3.4.0)') +parser.add_argument('--miopen', type=str, default='2.5.0', + help='MIOpen Version - optional (default:2.5.0)') +parser.add_argument('--miopengemm', type=str, default='1.1.5', + help='MIOpenGEMM Version - optional (default:1.1.5)') +parser.add_argument('--protobuf', type=str, default='3.12.0', + help='ProtoBuf Version - optional (default:3.12.0)') +parser.add_argument('--rpp', type=str, default='0.4', + help='RPP Version - optional (default:0.4)') +parser.add_argument('--ffmpeg', type=str, default='no', + help='FFMPEG Installation - optional (default:no) [options:yes/no]') +parser.add_argument('--neural_net', type=str, default='yes', + help='MIVisionX Neural Net Dependency Install - optional (default:yes) [options:yes/no]') +parser.add_argument('--rali', type=str, default='yes', + help='MIVisionX RALI Dependency Install - optional (default:yes) [options:yes/no]') +parser.add_argument('--reinstall', type=str, default='no', + help='Remove previous setup and reinstall - optional (default:no) [options:yes/no]') args = parser.parse_args() setupDir = args.directory linuxSystemInstall = args.installer +opencvVersion = args.opencv MIOpenVersion = args.miopen MIOpenGEMMVersion = args.miopengemm ProtoBufVersion = args.protobuf +rppVersion = args.rpp ffmpegInstall = args.ffmpeg -rppInstall = args.rpp -rppVersion = args.rpp_ver +neuralNetInstall = args.neural_net +raliInstall = args.rali reinstall = args.reinstall # sudo requirement check sudoLocation = '' userName = '' if sys.version_info[0] < 3: - status, sudoLocation = commands.getstatusoutput("which sudo") - if sudoLocation != '/usr/bin/sudo': - status, userName = commands.getstatusoutput("whoami") + status, sudoLocation = commands.getstatusoutput("which sudo") + if sudoLocation != '/usr/bin/sudo': + status, userName = commands.getstatusoutput("whoami") else: - status, sudoLocation = subprocess.getstatusoutput("which sudo") - if sudoLocation != '/usr/bin/sudo': - status, userName = subprocess.getstatusoutput("whoami") - + status, sudoLocation = subprocess.getstatusoutput("which sudo") + if sudoLocation != '/usr/bin/sudo': + status, userName = subprocess.getstatusoutput("whoami") -if setupDir == '': - setupDir_deps = '~/mivisionx-deps' +# Setup Directory for Deps +if setupDir == '~/mivisionx-deps': + setupDir_deps = setupDir else: - setupDir_deps = setupDir+'/mivisionx-deps' + setupDir_deps = setupDir+'/mivisionx-deps' + +# setup directory +deps_dir = os.path.expanduser(setupDir_deps) # setup for CentOS or Ubuntu linuxSystemInstall_check = '--nogpgcheck' linuxCMake = 'cmake3' linuxFlag = '' if linuxSystemInstall == '' or linuxSystemInstall == 'apt-get': - linuxSystemInstall = 'apt-get' - linuxSystemInstall_check = '--allow-unauthenticated' - linuxCMake = 'cmake' - linuxFlag = '-S' - if userName == 'root': - os.system('apt -y update') - os.system('apt -y install sudo') + linuxSystemInstall = 'apt-get' + linuxSystemInstall_check = '--allow-unauthenticated' + linuxCMake = 'cmake' + linuxFlag = '-S' + if userName == 'root': + os.system('apt -y update') + os.system('apt -y install sudo') else: - if userName == 'root': - os.system('yum -y update') - os.system('yum -y install sudo') - os.system('sudo -v') - os.system('sudo yum -y update') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install cmake3 boost boost-thread boost-devel') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install openssl-devel hg autoconf automake') - -# setup directory -deps_dir = os.path.expanduser(setupDir_deps) + if userName == 'root': + os.system('yum -y update') + os.system('yum -y install sudo') + os.system('sudo -v') + os.system('sudo yum -y update') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install cmake3 boost boost-thread boost-devel') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install openssl-devel hg autoconf automake') # Delete previous install if(os.path.exists(deps_dir) and reinstall == 'yes'): - os.system('sudo -v') - os.system('sudo rm -rf '+deps_dir) + os.system('sudo -v') + os.system('sudo rm -rf '+deps_dir) # MIVisionX setup if(os.path.exists(deps_dir)): - os.system('sudo -v') - os.system('(cd '+deps_dir+'; sudo cp half-files/include/half.hpp /usr/local/include/ )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/rocm-cmake; sudo '+linuxFlag+' make install -j8)') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/MIOpenGEMM; sudo '+linuxFlag+' make install -j8)') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/MIOpen; sudo '+linuxFlag+' make install -j8)') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' make install -j8)') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' make install -j8)') - if rppInstall == 'yes': - os.system('sudo -v') - os.system('(cd '+deps_dir+'/rpp/build; sudo '+linuxFlag+' make install -j8)') - if ffmpegInstall == 'yes': - os.system('sudo -v') - os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' make install -j8)') - print("\nMIVisionX Dependencies Installed with MIVisionX-setup.py V-"+__version__+"\n") + # opencv + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/OpenCV; sudo ' + + linuxFlag+' make install -j8)') + if raliInstall == 'yes' or neuralNetInstall == 'yes': + # half.hpp + os.system('sudo -v') + os.system( + '(cd '+deps_dir+'; sudo cp half-files/include/half.hpp /usr/local/include/ )') + if neuralNetInstall == 'yes': + # rocm-cmake + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/rocm-cmake; sudo ' + + linuxFlag+' make install -j8)') + # MIOpenGEMM + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/MIOpenGEMM; sudo ' + + linuxFlag+' make install -j8)') + # MIOpen + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/MIOpen; sudo ' + + linuxFlag+' make install -j8)') + if raliInstall == 'yes' or neuralNetInstall == 'yes': + # ProtoBuf + os.system('sudo -v') + os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion + + '; sudo '+linuxFlag+' make install -j8)') + if raliInstall == 'yes': + # RPP + os.system('sudo -v') + os.system('(cd '+deps_dir+'/rpp/build; sudo ' + + linuxFlag+' make install -j8)') + if ffmpegInstall == 'yes': + # FFMPEG + os.system('sudo -v') + os.system('(cd '+deps_dir+'/ffmpeg; sudo ' + + linuxFlag+' make install -j8)') + print("\nMIVisionX Dependencies Installed with MIVisionX-setup.py V-"+__version__+"\n") else: - print("\nMIVisionX Dependencies Installation with MIVisionX-setup.py V-"+__version__+"\n") - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install cmake git wget unzip') - os.system('(cd '+setupDir+'; mkdir mivisionx-deps)') - # Get Installation Source - os.system('(cd '+deps_dir+'; git clone https://github.com/RadeonOpenCompute/rocm-cmake.git )') - os.system('(cd '+deps_dir+'; wget https://github.com/ROCmSoftwarePlatform/MIOpenGEMM/archive/'+MIOpenGEMMVersion+'.zip )') - os.system('(cd '+deps_dir+'; unzip '+MIOpenGEMMVersion+'.zip )') - if ffmpegInstall == 'yes': - os.system('(cd '+deps_dir+'; git clone --recursive -b n4.0.4 https://git.ffmpeg.org/ffmpeg.git )') - os.system('(cd '+deps_dir+'; wget https://github.com/ROCmSoftwarePlatform/MIOpen/archive/'+MIOpenVersion+'.zip )') - os.system('(cd '+deps_dir+'; unzip '+MIOpenVersion+'.zip )') - os.system('(cd '+deps_dir+'; wget https://github.com/protocolbuffers/protobuf/archive/v'+ProtoBufVersion+'.zip )') - os.system('(cd '+deps_dir+'; unzip v'+ProtoBufVersion+'.zip )') - os.system('(cd '+deps_dir+'; wget https://github.com/opencv/opencv/archive/3.4.0.zip )') - os.system('(cd '+deps_dir+'; unzip 3.4.0.zip )') - os.system('(cd '+deps_dir+'; mkdir build )') - # Install half.hpp - os.system('(cd '+deps_dir+'; wget https://sourceforge.net/projects/half/files/half/1.12.0/half-1.12.0.zip )') - os.system('(cd '+deps_dir+'; unzip half-1.12.0.zip -d half-files )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'; sudo cp half-files/include/half.hpp /usr/local/include/ )') - # Install ROCm-CMake - os.system('(cd '+deps_dir+'/build; mkdir rocm-cmake MIOpenGEMM MIOpen OpenCV )') - os.system('(cd '+deps_dir+'/build/rocm-cmake; '+linuxCMake+' ../../rocm-cmake )') - os.system('(cd '+deps_dir+'/build/rocm-cmake; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/rocm-cmake; sudo '+linuxFlag+' make install )') - # Install MIOpenGEMM - os.system('(cd '+deps_dir+'/build/MIOpenGEMM; '+linuxCMake+' ../../MIOpenGEMM-'+MIOpenGEMMVersion+' )') - os.system('(cd '+deps_dir+'/build/MIOpenGEMM; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/MIOpenGEMM; sudo '+linuxFlag+' make install )') - # Install MIOpen - os.system('sudo -v') - os.system('(cd '+deps_dir+'/MIOpen-'+MIOpenVersion+'; sudo '+linuxFlag+' '+linuxCMake+' -P install_deps.cmake )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/MIOpen; sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install libssl-dev libboost-dev libboost-system-dev libboost-filesystem-dev )') - os.system('(cd '+deps_dir+'/build/MIOpen; '+linuxCMake+' -DMIOPEN_BACKEND=OpenCL -DMIOPEN_USE_MIOPENGEMM=On ../../MIOpen-'+MIOpenVersion+' )') - os.system('(cd '+deps_dir+'/build/MIOpen; make -j8 )') - os.system('(cd '+deps_dir+'/build/MIOpen; make MIOpenDriver )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/MIOpen; sudo '+linuxFlag+' make install )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/MIOpen; sudo '+linuxFlag+' '+linuxSystemInstall+' autoremove )') - # Install ProtoBuf - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install autoconf automake libtool curl make g++ unzip )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' '+linuxSystemInstall+' autoremove )') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; ./autogen.sh )') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; ./configure )') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; make -j8 )') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; make check -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' make install )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' ldconfig )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install python-pip )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' yes | pip install protobuf )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' yes | pip install pytz )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' yes | pip install numpy )') - # Install OpenCV - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev') - os.system('(cd '+deps_dir+'/build/OpenCV; '+linuxCMake+' -DWITH_OPENCL=OFF -DWITH_OPENCLAMDFFT=OFF -DWITH_OPENCLAMDBLAS=OFF -DWITH_VA_INTEL=OFF -DWITH_OPENCL_SVM=OFF ../../opencv-3.4.0 )') - os.system('(cd '+deps_dir+'/build/OpenCV; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' make install )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' ldconfig )') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install inxi aha libboost-python-dev build-essential') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install python-matplotlib python-numpy python-pil python-scipy python-skimage cython') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install qt5-default qtcreator') - # Install RPP - if rppInstall == 'yes': - #Yasm/Nasm for TurboJPEG - if linuxSystemInstall == 'apt-get': - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install nasm yasm') - #json-cpp - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install libjsoncpp-dev') - #clang+boost - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install libboost-all-dev clang') - #turbo-JPEG - os.system('(cd '+deps_dir+'; git clone -b 2.0.4 https://github.com/Indumathi31/libjpeg-turbo.git )') - os.system('(cd '+deps_dir+'/libjpeg-turbo; mkdir build; cd build; '+linuxCMake+' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-2.0.3 -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..; make -j 4; sudo make install )') - #RPP - os.system('(cd '+deps_dir+'; git clone -b '+rppVersion+' https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp.git; cd rpp; mkdir build; cd build; '+linuxCMake+' -DBACKEND=OCL ../; make -j4; sudo make install)') - # Turn off for CentOS - TBD: turn on when RPP is supported on CentOS - #else: - # Nasm - #os.system('(cd '+deps_dir+'; curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 )') - #os.system('(cd '+deps_dir+'; tar xjvf nasm-2.14.02.tar.bz2 )') - #os.system('(cd '+deps_dir+'/nasm-2.14.02; ./autogen.sh; ./configure; make -j8 )') - #os.system('sudo -v') - #os.system('(cd '+deps_dir+'/nasm-2.14.02; sudo '+linuxFlag+' make install )') - # Yasm - #os.system('(cd '+deps_dir+'; curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz )') - #os.system('(cd '+deps_dir+'; tar xzvf yasm-1.3.0.tar.gz )') - #os.system('(cd '+deps_dir+'/yasm-1.3.0; ./configure; make -j8 )') - #os.system('sudo -v') - #os.system('(cd '+deps_dir+'/yasm-1.3.0; sudo '+linuxFlag+' make install )') - #JSON-cpp - #os.system('sudo -v') - #os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install jsoncpp') - #clang+boost - #os.system('sudo -v') - #os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install boost-devel clang') - #turbo-JPEG - #os.system('(cd '+deps_dir+'; wget https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-2.0.3.tar.gz )') - #os.system('(cd '+deps_dir+'; tar xf libjpeg-turbo-2.0.3.tar.gz )') - #os.system('(cd '+deps_dir+'/libjpeg-turbo-2.0.3; mkdir build; cd build; '+linuxCMake+' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-2.0.3 -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..; make -j 4; sudo make install )') - #RPP - #os.system('(cd '+deps_dir+'; git clone -b 0.3 https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp.git; cd rpp; mkdir build; cd build; '+linuxCMake+' -DBACKEND=OCL ../; make -j4; sudo make install)') - # Install ffmpeg - if ffmpegInstall == 'yes': - if linuxSystemInstall == 'apt-get': - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install nasm yasm libx264-dev libx265-dev libnuma-dev libfdk-aac-dev') - # FFMPEG 4 - os.system('sudo -v') - os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' ldconfig )') - os.system('(cd '+deps_dir+'/ffmpeg; export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"; ./configure --enable-shared --disable-static --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libass --enable-gpl --enable-nonfree)') - os.system('(cd '+deps_dir+'/ffmpeg; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' make install )') - else: - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install autoconf automake bzip2 bzip2-devel cmake freetype-devel libass-devel') - os.system('sudo -v') - os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel') - # Nasm - os.system('(cd '+deps_dir+'; curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 )') - os.system('(cd '+deps_dir+'; tar xjvf nasm-2.14.02.tar.bz2 )') - os.system('(cd '+deps_dir+'/nasm-2.14.02; ./autogen.sh; ./configure; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/nasm-2.14.02; sudo '+linuxFlag+' make install )') - # Yasm - os.system('(cd '+deps_dir+'; curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz )') - os.system('(cd '+deps_dir+'; tar xzvf yasm-1.3.0.tar.gz )') - os.system('(cd '+deps_dir+'/yasm-1.3.0; ./configure; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/yasm-1.3.0; sudo '+linuxFlag+' make install )') - # libx264 - os.system('(cd '+deps_dir+'; git clone --depth 1 https://code.videolan.org/videolan/x264.git )') - os.system('(cd '+deps_dir+'/x264; ./configure --enable-static --disable-opencl; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/x264; sudo '+linuxFlag+' make install )') - # libx265 - os.system('(cd '+deps_dir+'; hg clone http://hg.videolan.org/x265 )') - os.system('(cd '+deps_dir+'/x265/build/linux; ./make-Makefiles.bash; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/x265/build/linux; sudo '+linuxFlag+' make install; sudo '+linuxFlag+' ldconfig )') - # libfdk_aac - os.system('(cd '+deps_dir+'; git clone https://github.com/mstorsjo/fdk-aac.git )') - os.system('(cd '+deps_dir+'/fdk-aac; autoreconf -fiv; ./configure --disable-shared; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/fdk-aac; sudo '+linuxFlag+' make install )') - # FFMPEG 4 - os.system('sudo -v') - os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' ldconfig )') - os.system('(cd '+deps_dir+'/ffmpeg; export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"; ./configure --disable-shared --enable-static --enable-libx264 --enable-libx265 --enable-libass --enable-gpl --enable-nonfree)') - os.system('(cd '+deps_dir+'/ffmpeg; make -j8 )') - os.system('sudo -v') - os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' make install )') - print("\nMIVisionX Dependencies Installed with MIVisionX-setup.py V-"+__version__+"\n") + print("\nMIVisionX Dependencies Installation with MIVisionX-setup.py V-"+__version__+"\n") + os.system('mkdir '+deps_dir) + # Create Build folder + os.system('(cd '+deps_dir+'; mkdir build )') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install cmake git wget unzip') + # Get Installation Source + os.system( + '(cd '+deps_dir+'; wget https://github.com/opencv/opencv/archive/'+opencvVersion+'.zip )') + os.system('(cd '+deps_dir+'; unzip '+opencvVersion+'.zip )') + if neuralNetInstall == 'yes': + os.system( + '(cd '+deps_dir+'; git clone https://github.com/RadeonOpenCompute/rocm-cmake.git )') + os.system( + '(cd '+deps_dir+'; wget https://github.com/ROCmSoftwarePlatform/MIOpenGEMM/archive/'+MIOpenGEMMVersion+'.zip )') + os.system('(cd '+deps_dir+'; unzip '+MIOpenGEMMVersion+'.zip )') + os.system( + '(cd '+deps_dir+'; wget https://github.com/ROCmSoftwarePlatform/MIOpen/archive/'+MIOpenVersion+'.zip )') + os.system('(cd '+deps_dir+'; unzip '+MIOpenVersion+'.zip )') + if raliInstall == 'yes' or neuralNetInstall == 'yes': + os.system( + '(cd '+deps_dir+'; wget https://github.com/protocolbuffers/protobuf/archive/v'+ProtoBufVersion+'.zip )') + os.system('(cd '+deps_dir+'; unzip v'+ProtoBufVersion+'.zip )') + if ffmpegInstall == 'yes': + os.system( + '(cd '+deps_dir+'; git clone --recursive -b n4.0.4 https://git.ffmpeg.org/ffmpeg.git )') + # Install + if raliInstall == 'yes' or neuralNetInstall == 'yes': + # Install half.hpp + os.system( + '(cd '+deps_dir+'; wget https://sourceforge.net/projects/half/files/half/1.12.0/half-1.12.0.zip )') + os.system('(cd '+deps_dir+'; unzip half-1.12.0.zip -d half-files )') + os.system('sudo -v') + os.system( + '(cd '+deps_dir+'; sudo cp half-files/include/half.hpp /usr/local/include/ )') + if neuralNetInstall == 'yes': + os.system('(cd '+deps_dir+'/build; mkdir rocm-cmake MIOpenGEMM MIOpen)') + # Install ROCm-CMake + os.system('(cd '+deps_dir+'/build/rocm-cmake; ' + + linuxCMake+' ../../rocm-cmake )') + os.system('(cd '+deps_dir+'/build/rocm-cmake; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/rocm-cmake; sudo ' + + linuxFlag+' make install )') + # Install MIOpenGEMM + os.system('(cd '+deps_dir+'/build/MIOpenGEMM; '+linuxCMake + + ' ../../MIOpenGEMM-'+MIOpenGEMMVersion+' )') + os.system('(cd '+deps_dir+'/build/MIOpenGEMM; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/MIOpenGEMM; sudo ' + + linuxFlag+' make install )') + # Install MIOpen + os.system('sudo -v') + os.system('(cd '+deps_dir+'/MIOpen-'+MIOpenVersion+'; sudo ' + + linuxFlag+' '+linuxCMake+' -P install_deps.cmake )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/MIOpen; sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install libssl-dev libboost-dev libboost-system-dev libboost-filesystem-dev )') + os.system('(cd '+deps_dir+'/build/MIOpen; '+linuxCMake + + ' -DMIOPEN_BACKEND=OpenCL -DMIOPEN_USE_MIOPENGEMM=On ../../MIOpen-'+MIOpenVersion+' )') + os.system('(cd '+deps_dir+'/build/MIOpen; make -j8 )') + os.system('(cd '+deps_dir+'/build/MIOpen; make MIOpenDriver )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/MIOpen; sudo ' + + linuxFlag+' make install )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/MIOpen; sudo ' + + linuxFlag+' '+linuxSystemInstall+' autoremove )') + # Install Packages for NN Apps + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install inxi aha libboost-python-dev build-essential') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install python-matplotlib python-numpy python-pil python-scipy python-skimage cython') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install qt5-default qtcreator') + if raliInstall == 'yes' or neuralNetInstall == 'yes': + # Install ProtoBuf + os.system('sudo -v') + os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' '+linuxSystemInstall + + ' -y '+linuxSystemInstall_check+' install autoconf automake libtool curl make g++ unzip )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion + + '; sudo '+linuxFlag+' '+linuxSystemInstall+' autoremove )') + os.system('(cd '+deps_dir+'/protobuf-' + + ProtoBufVersion+'; ./autogen.sh )') + os.system('(cd '+deps_dir+'/protobuf-' + + ProtoBufVersion+'; ./configure )') + os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; make -j8 )') + os.system('(cd '+deps_dir+'/protobuf-' + + ProtoBufVersion+'; make check -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion + + '; sudo '+linuxFlag+' make install )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion + + '; sudo '+linuxFlag+' ldconfig )') + # Install Packages for Apps + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install python-pip') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' yes | pip install protobuf') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' yes | pip install pytz') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' yes | pip install numpy') + # Install OpenCV + os.system('(cd '+deps_dir+'/build; mkdir OpenCV )') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev') + os.system('(cd '+deps_dir+'/build/OpenCV; '+linuxCMake + + ' -DWITH_OPENCL=OFF -DWITH_OPENCLAMDFFT=OFF -DWITH_OPENCLAMDBLAS=OFF -DWITH_VA_INTEL=OFF -DWITH_OPENCL_SVM=OFF ../../opencv-'+opencvVersion+' )') + os.system('(cd '+deps_dir+'/build/OpenCV; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' make install )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' ldconfig )') + if raliInstall == 'yes': + # Install Packages for RALI + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install libgflags-dev libgoogle-glog-dev liblmdb-dev') + # Install RPP + # Yasm/Nasm for TurboJPEG + if linuxSystemInstall == 'apt-get': + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall + + ' -y '+linuxSystemInstall_check+' install nasm yasm') + # json-cpp + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install libjsoncpp-dev') + # clang+boost + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' + + linuxSystemInstall_check+' install libboost-all-dev clang') + # turbo-JPEG + os.system( + '(cd '+deps_dir+'; git clone -b 2.0.4 https://github.com/Indumathi31/libjpeg-turbo.git )') + os.system('(cd '+deps_dir+'/libjpeg-turbo; mkdir build; cd build; '+linuxCMake + + ' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-2.0.3 -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..; make -j 4; sudo make install )') + # RPP + os.system('(cd '+deps_dir+'; git clone -b '+rppVersion+' https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp.git; cd rpp; mkdir build; cd build; ' + + linuxCMake+' -DBACKEND=OCL ../; make -j4; sudo make install)') + # Turn off for CentOS - TBD: turn on when RPP is supported on CentOS + # else: + # Nasm + #os.system('(cd '+deps_dir+'; curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 )') + #os.system('(cd '+deps_dir+'; tar xjvf nasm-2.14.02.tar.bz2 )') + #os.system('(cd '+deps_dir+'/nasm-2.14.02; ./autogen.sh; ./configure; make -j8 )') + #os.system('sudo -v') + #os.system('(cd '+deps_dir+'/nasm-2.14.02; sudo '+linuxFlag+' make install )') + # Yasm + #os.system('(cd '+deps_dir+'; curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz )') + #os.system('(cd '+deps_dir+'; tar xzvf yasm-1.3.0.tar.gz )') + #os.system('(cd '+deps_dir+'/yasm-1.3.0; ./configure; make -j8 )') + #os.system('sudo -v') + #os.system('(cd '+deps_dir+'/yasm-1.3.0; sudo '+linuxFlag+' make install )') + # JSON-cpp + #os.system('sudo -v') + #os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install jsoncpp') + # clang+boost + #os.system('sudo -v') + #os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install boost-devel clang') + # turbo-JPEG + #os.system('(cd '+deps_dir+'; wget https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-2.0.3.tar.gz )') + #os.system('(cd '+deps_dir+'; tar xf libjpeg-turbo-2.0.3.tar.gz )') + #os.system('(cd '+deps_dir+'/libjpeg-turbo-2.0.3; mkdir build; cd build; '+linuxCMake+' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-2.0.3 -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..; make -j 4; sudo make install )') + # RPP + #os.system('(cd '+deps_dir+'; git clone -b 0.3 https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp.git; cd rpp; mkdir build; cd build; '+linuxCMake+' -DBACKEND=OCL ../; make -j4; sudo make install)') + # Install ffmpeg + if ffmpegInstall == 'yes': + if linuxSystemInstall == 'apt-get': + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install nasm yasm libx264-dev libx265-dev libnuma-dev libfdk-aac-dev') + # FFMPEG 4 + os.system('sudo -v') + os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' ldconfig )') + os.system('(cd '+deps_dir+'/ffmpeg; export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"; ./configure --enable-shared --disable-static --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libass --enable-gpl --enable-nonfree)') + os.system('(cd '+deps_dir+'/ffmpeg; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/ffmpeg; sudo ' + + linuxFlag+' make install )') + else: + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install autoconf automake bzip2 bzip2-devel cmake freetype-devel libass-devel') + os.system('sudo -v') + os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check + + ' install gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel') + # Nasm + os.system( + '(cd '+deps_dir+'; curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 )') + os.system('(cd '+deps_dir+'; tar xjvf nasm-2.14.02.tar.bz2 )') + os.system( + '(cd '+deps_dir+'/nasm-2.14.02; ./autogen.sh; ./configure; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/nasm-2.14.02; sudo ' + + linuxFlag+' make install )') + # Yasm + os.system( + '(cd '+deps_dir+'; curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz )') + os.system('(cd '+deps_dir+'; tar xzvf yasm-1.3.0.tar.gz )') + os.system('(cd '+deps_dir+'/yasm-1.3.0; ./configure; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/yasm-1.3.0; sudo ' + + linuxFlag+' make install )') + # libx264 + os.system( + '(cd '+deps_dir+'; git clone --depth 1 https://code.videolan.org/videolan/x264.git )') + os.system( + '(cd '+deps_dir+'/x264; ./configure --enable-static --disable-opencl; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/x264; sudo ' + + linuxFlag+' make install )') + # libx265 + os.system('(cd '+deps_dir+'; hg clone http://hg.videolan.org/x265 )') + os.system( + '(cd '+deps_dir+'/x265/build/linux; ./make-Makefiles.bash; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/x265/build/linux; sudo ' + + linuxFlag+' make install; sudo '+linuxFlag+' ldconfig )') + # libfdk_aac + os.system( + '(cd '+deps_dir+'; git clone https://github.com/mstorsjo/fdk-aac.git )') + os.system( + '(cd '+deps_dir+'/fdk-aac; autoreconf -fiv; ./configure --disable-shared; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/fdk-aac; sudo ' + + linuxFlag+' make install )') + # FFMPEG 4 + os.system('sudo -v') + os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' ldconfig )') + os.system('(cd '+deps_dir+'/ffmpeg; export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"; ./configure --disable-shared --enable-static --enable-libx264 --enable-libx265 --enable-libass --enable-gpl --enable-nonfree)') + os.system('(cd '+deps_dir+'/ffmpeg; make -j8 )') + os.system('sudo -v') + os.system('(cd '+deps_dir+'/ffmpeg; sudo ' + + linuxFlag+' make install )') + print("\nMIVisionX Dependencies Installed with MIVisionX-setup.py V-"+__version__+"\n") diff --git a/README.md b/README.md index e87c478631..1312dbfdad 100644 --- a/README.md +++ b/README.md @@ -7,21 +7,21 @@ MIVisionX toolkit is a set of comprehensive computer vision and machine intellig * [AMD OpenVX](#amd-openvx) * [AMD OpenVX Extensions](#amd-openvx-extensions) - * [Loom 360 Video Stitch Library](amd_openvx_extensions/amd_loomsl) - * [Neural Net Library](amd_openvx_extensions/amd_nn#openvx-neural-network-extension-library-vx_nn) - * [OpenCV Extension](amd_openvx_extensions/amd_opencv#amd-opencv-extension) - * [RPP Extension](amd_openvx_extensions/amd_rpp) - * [WinML Extension](amd_openvx_extensions/amd_winml#amd-winml-extension) + + [Loom 360 Video Stitch Library](amd_openvx_extensions/amd_loomsl) + + [Neural Net Library](amd_openvx_extensions/amd_nn#openvx-neural-network-extension-library-vx_nn) + + [OpenCV Extension](amd_openvx_extensions/amd_opencv#amd-opencv-extension) + + [RPP Extension](amd_openvx_extensions/amd_rpp) + + [WinML Extension](amd_openvx_extensions/amd_winml#amd-winml-extension) * [Applications](#applications) * [Neural Net Model Compiler & Optimizer](#neural-net-model-compiler--optimizer) * [RALI](#rali) * [Samples](samples#samples) * [Toolkit](#toolkit) * [Utilities](#utilities) - * [Inference Generator](utilities/inference_generator#inference-generator) - * [Loom Shell](utilities/loom_shell#radeon-loomshell) - * [RunCL](utilities/runcl#amd-runcl) - * [RunVX](utilities/runvx#amd-runvx) + + [Inference Generator](utilities/inference_generator#inference-generator) + + [Loom Shell](utilities/loom_shell#radeon-loomshell) + + [RunCL](utilities/runcl#amd-runcl) + + [RunVX](utilities/runvx#amd-runvx) * [Prerequisites](#prerequisites) * [Build & Install MIVisionX](#build--install-mivisionx) * [Verify the Installation](#verify-the-installation) @@ -37,6 +37,7 @@ MIVisionX toolkit is a set of comprehensive computer vision and machine intellig Khronos OpenVX™ 1.0.1 conformant implementation is available in [MIVisionX Lite](https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/tree/openvx-1.0.1) ## AMD OpenVX Extensions + The OpenVX framework provides a mechanism to add new vision functions to OpenVX by 3rd party vendors. This project has below mentioned OpenVX [modules](amd_openvx_extensions#amd-openvx-extensions-amd_openvx_extensions) and utilities to extend [amd_openvx](amd_openvx#amd-openvx-amd_openvx) project, which contains the AMD OpenVX Core Engine.

@@ -45,9 +46,10 @@ The OpenVX framework provides a mechanism to add new vision functions to OpenVX * [amd_nn](amd_openvx_extensions/amd_nn#openvx-neural-network-extension-library-vx_nn): OpenVX neural network module * [amd_opencv](amd_openvx_extensions/amd_opencv#amd-module-for-opencv-interop-from-openvx-vx_opencv): OpenVX module that implements a mechanism to access OpenCV functionality as OpenVX kernels * [amd_rpp](amd_openvx_extensions/amd_rpp): OpenVX extension providing an interface to some of the [RPP](https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp)'s (Radeon Performance Primitives) functions. This extension is used to enable [RALI](rali/README.md) to perform image augmentation. -* [amd_winml](amd_openvx_extensions/amd_winml#amd-winml-extension): WinML extension will allow developers to import a pre-trained ONNX model into an OpenVX graph and add hundreds of different pre & post processing `vision`/`generic`/`user-defined` functions, available in OpenVX and OpenCV interop, to the input and output of the neural net model. This will allow developers to build an end to end application for inference. +* [amd_winml](amd_openvx_extensions/amd_winml#amd-winml-extension): WinML extension will allow developers to import a pre-trained ONNX model into an OpenVX graph and add hundreds of different pre & post processing `vision` / `generic` / `user-defined` functions, available in OpenVX and OpenCV interop, to the input and output of the neural net model. This will allow developers to build an end to end application for inference. ## Applications + MIVisionX has several [applications](apps#applications) built on top of OpenVX modules, it uses AMD optimized libraries to build applications which can be used to prototype or used as models to develop a product.

@@ -56,9 +58,9 @@ MIVisionX has several [applications](apps#applications) built on top of OpenVX m * [Cloud Inference Application](apps/cloud_inference#cloud-inference-application): This sample application does inference using a client-server system. * [Digit Test](apps/dg_test#amd-dgtest): This sample application is used to recognize hand written digits. * [Image Augmentation](apps/image_augmentation#image-augmentation-application): This sample application demonstrates the basic usage of RALI's C API to load JPEG images from the disk and modify them in different possible ways and displays the output images. -* [MIVisionX Inference Analyzer](apps/mivisionx_inference_analyzer#mivisionx-python-inference-analyzer): This sample application uses pre-trained `ONNX`/`NNEF`/`Caffe` models to analyze and summarize images. +* [MIVisionX Inference Analyzer](apps/mivisionx_inference_analyzer#mivisionx-python-inference-analyzer): This sample application uses pre-trained `ONNX` / `NNEF` / `Caffe` models to analyze and summarize images. * [MIVisionX OpenVX Classsification](apps#mivisionx-openvx-classsification): This sample application shows how to run supported pre-trained caffe models with MIVisionX RunTime. -* [MIVisionX Validation Tool](apps/mivisionx_validation_tool#mivisionx-python-ml-model-validation-tool): This sample application uses pre-trained `ONNX`/`NNEF`/`Caffe` models to analyze, summarize and validate models. +* [MIVisionX Validation Tool](apps/mivisionx_validation_tool#mivisionx-python-ml-model-validation-tool): This sample application uses pre-trained `ONNX` / `NNEF` / `Caffe` models to analyze, summarize and validate models. * [MIVisionX WinML Classification](apps#mivisionx-winml-classification): This sample application shows how to run supported ONNX models with MIVisionX RunTime on Windows. * [MIVisionX WinML YoloV2](apps#mivisionx-winml-yolov2): This sample application shows how to run tiny yolov2(20 classes) with MIVisionX RunTime on Windows. * [External Applications](apps#external-application) @@ -70,6 +72,7 @@ MIVisionX has several [applications](apps#applications) built on top of OpenVX m [Neural Net Model Compiler & Optimizer](model_compiler#neural-net-model-compiler--optimizer) converts pre-trained neural net models to MIVisionX runtime code for optimized inference. ## RALI + The Radeon Augmentation Library - [RALI](rali/README.md) is designed to efficiently decode and process images and videos from a variety of storage formats and modify them through a processing graph programmable by the user. ## Toolkit @@ -79,12 +82,14 @@ The Radeon Augmentation Library - [RALI](rali/README.md) is designed to efficien MIVisionX provides you with tools for accomplishing your tasks throughout the whole neural net life-cycle, from creating a model to deploying them for your target platforms. ## Utilities + * [inference_generator](utilities/inference_generator#inference-generator): generate inference library from pre-trained CAFFE models * [loom_shell](utilities/loom_shell/README.md#radeon-loomsh): an interpreter to prototype 360 degree video stitching applications using a script * [RunVX](utilities/runvx/README.md#amd-runvx): command-line utility to execute OpenVX graph described in GDF text file * [RunCL](utilities/runcl/README.md#amd-runcl): command-line utility to build, execute, and debug OpenCL programs ## Prerequisites + * CPU: [SSE4.1 or above CPU, 64-bit](https://rocm.github.io/hardware.html) * GPU: [GFX7 or above](https://rocm.github.io/hardware.html) [optional] * APU: Carrizo or above [optional] @@ -92,27 +97,29 @@ MIVisionX provides you with tools for accomplishing your tasks throughout the wh **Note:** Some modules in MIVisionX can be built for CPU only. To take advantage of advanced features and modules we recommend using AMD GPUs or AMD APUs. ### Windows + * Windows 10 * Windows SDK * Visual Studio 2017 and above * Install the latest AMD [drivers](https://www.amd.com/en/support) * Install [OpenCL SDK](https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases/tag/1.0) * Install [OpenCV 3.4](https://github.com/opencv/opencv/releases/tag/3.4.0) - * Set `OpenCV_DIR` environment variable to `OpenCV/build` folder - * Add `%OpenCV_DIR%\x64\vc14\bin` or `%OpenCV_DIR%\x64\vc15\bin` to your `PATH` + + Set `OpenCV_DIR` environment variable to `OpenCV/build` folder + + Add `%OpenCV_DIR%\x64\vc14\bin` or `%OpenCV_DIR%\x64\vc15\bin` to your `PATH` ### Linux + * Install [ROCm](https://rocm.github.io/ROCmInstall.html) * ROCm CMake, MIOpenGEMM & MIOpen for Neural Net Extensions (vx_nn) * CMake 2.8 or newer [download](http://cmake.org/download/) * Qt Creator for [Cloud Inference Client](apps/cloud_inference/client_app/README.md) * [Protobuf](https://github.com/google/protobuf) for inference generator & model compiler - * install `libprotobuf-dev` and `protobuf-compiler` needed for vx_nn + + install `libprotobuf-dev` and `protobuf-compiler` needed for vx_nn * [OpenCV 3.4](https://github.com/opencv/opencv/releases/tag/3.4.0) - * Set `OpenCV_DIR` environment variable to `OpenCV/build` folder + + Set `OpenCV_DIR` environment variable to `OpenCV/build` folder * [FFMPEG n4.0.4](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.0.4) - Optional - * FFMPEG is required for amd_media & mv_deploy modules - + + FFMPEG is required for amd_media & mv_deploy modules + #### Prerequisites setup script for Linux - `MIVisionX-setup.py` For the convenience of the developer, we here provide the setup script which will install all the dependencies required by this project. @@ -120,24 +127,32 @@ For the convenience of the developer, we here provide the setup script which wil **MIVisionX-setup.py** builds all the prerequisites required by MIVisionX. The setup script creates a deps folder and installs all the prerequisites, this script only needs to be executed once. If the directory option is not given, the script will install the deps folder in the home directory(~/) by default, else in the user-specified location. ##### Prerequisites for running the script -1. Ubuntu `16.04`/`18.04` or CentOS `7.5`/`7.6` -2. X Window -3. [ROCm supported hardware](https://rocm.github.io/hardware.html) -4. [ROCm](https://github.com/RadeonOpenCompute/ROCm#installing-from-amd-rocm-repositories) + +1. Ubuntu `16.04` / `18.04` or CentOS `7.5` / `7.6` +2. [ROCm supported hardware](https://rocm.github.io/hardware.html) +3. [ROCm](https://github.com/RadeonOpenCompute/ROCm#installing-from-amd-rocm-repositories) **usage:** -```` -python MIVisionX-setup.py --directory [setup directory - optional] + +``` +python MIVisionX-setup.py --directory [setup directory - optional (default:~/)] --installer [Package management tool - optional (default:apt-get) [options: Ubuntu:apt-get;CentOS:yum]] + --opencv [OpenCV Version - optional (default:3.4.0)] --miopen [MIOpen Version - optional (default:2.5.0)] --miopengemm[MIOpenGEMM Version - optional (default:1.1.5)] - --ffmpeg [FFMPEG Installation - optional (default:no) [options:Install ffmpeg - yes]] - --rpp [RPP Installation - optional (default:yes) [options:yes/no]] + --protobuf [ProtoBuf Version - optional (default:3.12.0)] + --rpp [RPP Version - optional (default:0.4)] + --ffmpeg [FFMPEG Installation - optional (default:no) [options:yes/no]] + --rali [MIVisionX RALI Dependency Install - optional (default:yes) [options:yes/no]] + --neural_net[MIVisionX Neural Net Dependency Install - optional (default:yes) [options:yes/no]] --reinstall [Remove previous setup and reinstall (default:no)[options:yes/no]] -```` -**Note:** use `--installer yum` for **CentOS** +``` -**Note:** ROCm upgrade with `sudo apt upgrade` requires the setup script rerun. +**Note:** + + + use `--installer yum` for **CentOS** + + ROCm upgrade with `sudo apt upgrade` requires the setup script rerun. + + use `X Window` / `X11` for remote GUI app control ##### Refer to [Wiki](https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/wiki/Suggested-development-workflow) page for developer instructions. @@ -151,6 +166,7 @@ python MIVisionX-setup.py --directory [setup directory - optional] * [MIVisionX_WinML-installer.msi](https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/releases): MIVisionX for WinML #### Using `Visual Studio 2017` on 64-bit `Windows 10` + * Install [Windows Prerequisites](#windows) * Use `MIVisionX.sln` to build for x64 platform @@ -158,97 +174,124 @@ python MIVisionX-setup.py --directory [setup directory - optional] ### Linux -#### Using `apt-get`/`yum` +#### Using `apt-get` / `yum` ##### Prerequisites -1. Ubuntu `16.04`/`18.04` or CentOS `7.5`/`7.6` + +1. Ubuntu `16.04` / `18.04` or CentOS `7.5` / `7.6` 2. [ROCm supported hardware](https://rocm.github.io/hardware.html) 3. [ROCm](https://github.com/RadeonOpenCompute/ROCm#installing-from-amd-rocm-repositories) ###### Ubuntu -```` + +``` sudo apt-get install mivisionx -```` +``` + ###### CentOS -```` + +``` sudo yum install mivisionx -```` +``` + **Note:** - * vx_winml is not supported on linux - * source code will not available with apt-get/yum install - * executables placed in `/opt/rocm/mivisionx/bin` and libraries in `/opt/rocm/mivisionx/lib` - * OpenVX and module header files into `/opt/rocm/mivisionx/include` - * model compiler, toolkit, & samples placed in `/opt/rocm/mivisionx` - * Package (.deb & .rpm) install requires OpenCV v3.4.0 to execute AMD OpenCV extensions - -#### Using `MIVisionX-setup.py` and `CMake` on Linux (Ubuntu `16.04`/`18.04` or CentOS `7.5`/`7.6`) with ROCm + + + vx_winml is not supported on linux + + source code will not available with apt-get/yum install + + executables placed in `/opt/rocm/mivisionx/bin` and libraries in `/opt/rocm/mivisionx/lib` + + OpenVX and module header files into `/opt/rocm/mivisionx/include` + + model compiler, toolkit, & samples placed in `/opt/rocm/mivisionx` + + Package (.deb & .rpm) install requires OpenCV v3.4.0 to execute AMD OpenCV extensions + +#### Using `MIVisionX-setup.py` and `CMake` on Linux (Ubuntu `16.04` / `18.04` or CentOS `7.5` / `7.6` ) with ROCm + * Install [ROCm](https://rocm.github.io/ROCmInstall.html) * Use the below commands to set up and build MIVisionX -```` + +``` git clone https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX.git cd MIVisionX -```` -```` -python MIVisionX-setup.py --directory [setup directory - optional] +``` + +``` +python MIVisionX-setup.py --directory [setup directory - optional (default:~/)] + --installer [Package management tool - optional (default:apt-get) [options: Ubuntu:apt-get;CentOS:yum]] + --opencv [OpenCV Version - optional (default:3.4.0)] --miopen [MIOpen Version - optional (default:2.5.0)] --miopengemm[MIOpenGEMM Version - optional (default:1.1.5)] - --ffmpeg [FFMPEG Installation - optional (default:no) [options:Install ffmpeg - yes]] - --rpp [RPP Installation - optional (default:yes) [options:yes/no]] + --protobuf [ProtoBuf Version - optional (default:3.12.0)] + --rpp [RPP Version - optional (default:0.4)] + --ffmpeg [FFMPEG Installation - optional (default:no) [options:yes/no]] + --rali [MIVisionX RALI Dependency Install - optional (default:yes) [options:yes/no]] + --neural_net[MIVisionX Neural Net Dependency Install - optional (default:yes) [options:yes/no]] --reinstall [Remove previous setup and reinstall (default:no)[options:yes/no]] -```` -**Note:** Use `--installer yum` for **CentOS** -```` +``` + +**Note:** + + + use `--installer yum` for **CentOS** + +``` mkdir build cd build cmake ../ make -j8 sudo make install -```` +``` + **Note:** - * vx_winml is not supported on Linux - * the installer will copy all executables into `/opt/rocm/mivisionx/bin` and libraries into `/opt/rocm/mivisionx/lib` - * the installer also copies all the OpenVX and module header files into `/opt/rocm/mivisionx/include` folder + + vx_winml is not supported on Linux + + the installer will copy all executables into `/opt/rocm/mivisionx/bin` and libraries into `/opt/rocm/mivisionx/lib` + + the installer also copies all the OpenVX and module header files into `/opt/rocm/mivisionx/include` folder + +#### Using `CMake` on Linux (Ubuntu `16.04` / `18.04` or CentOS `7.5` / `7.6` ) with ROCm -#### Using `CMake` on Linux (Ubuntu `16.04`/`18.04` or CentOS `7.5`/`7.6`) with ROCm * Install [ROCm](https://rocm.github.io/ROCmInstall.html) -* git clone, build and install other ROCm projects (using `cmake` and `% make install`) in the below order for vx_nn. - * [rocm-cmake](https://github.com/RadeonOpenCompute/rocm-cmake) - * [MIOpenGEMM](https://github.com/ROCmSoftwarePlatform/MIOpenGEMM) - * [MIOpen](https://github.com/ROCmSoftwarePlatform/MIOpen) -- make sure to use `-DMIOPEN_BACKEND=OpenCL` option with cmake +* git clone, build and install other ROCm projects (using `cmake` and `% make install` ) in the below order for vx_nn. + + [rocm-cmake](https://github.com/RadeonOpenCompute/rocm-cmake) + + [MIOpenGEMM](https://github.com/ROCmSoftwarePlatform/MIOpenGEMM) + + [MIOpen](https://github.com/ROCmSoftwarePlatform/MIOpen) -- make sure to use `-DMIOPEN_BACKEND=OpenCL` option with cmake * install [protobuf](https://github.com/protocolbuffers/protobuf/releases/tag/v3.5.2) * install [OpenCV](https://github.com/opencv/opencv/releases/tag/3.3.0) * install [FFMPEG n4.0.4](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.0.4) - Optional -* build and install (using `cmake` and `% make install`) - * executables will be placed in `bin` folder - * libraries will be placed in `lib` folder - * the installer will copy all executables into `/opt/rocm/mivisionx/bin` and libraries into `/opt/rocm/mivisionx/lib` - * the installer also copies all the OpenVX and OpenVX module header files into `/opt/rocm/mivisionx/include` folder -* add the installed library path to LD_LIBRARY_PATH environment variable (default `/opt/rocm/mivisionx/lib`) -* add the installed executable path to PATH environment variable (default `/opt/rocm/mivisionx/bin`) +* build and install (using `cmake` and `% make install` ) + + executables will be placed in `bin` folder + + libraries will be placed in `lib` folder + + the installer will copy all executables into `/opt/rocm/mivisionx/bin` and libraries into `/opt/rocm/mivisionx/lib` + + the installer also copies all the OpenVX and OpenVX module header files into `/opt/rocm/mivisionx/include` folder +* add the installed library path to LD_LIBRARY_PATH environment variable (default `/opt/rocm/mivisionx/lib` ) +* add the installed executable path to PATH environment variable (default `/opt/rocm/mivisionx/bin` ) ## Verify the Installation ### Linux + * The installer will copy all executables into `/opt/rocm/mivisionx/bin` and libraries into `/opt/rocm/mivisionx/lib` * The installer also copies all the OpenVX and OpenVX module header files into `/opt/rocm/mivisionx/include` folder * Apps, Samples, Documents, Model Compiler and Toolkit are placed into `/opt/rocm/mivisionx` * Run samples to verify the installation - * **Canny Edge Detection** - + +**Canny Edge Detection**

- ```` + +``` export PATH=$PATH:/opt/rocm/mivisionx/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/mivisionx/lib runvx /opt/rocm/mivisionx/samples/gdf/canny.gdf - ```` -**Note:** More samples are available [here](samples#samples) +``` + +**Note:** + + + More samples are available [here](samples#samples) ### Windows + * MIVisionX.sln builds the libraries & executables in the folder `MIVisionX/x64` * Use RunVX to test the build -``` + +``` ./runvx.exe PATH_TO/MIVisionX/samples/gdf/skintonedetect.gdf ``` @@ -257,6 +300,7 @@ sudo make install MIVisionX provides developers with docker images for Ubuntu 16.04, Ubuntu 18.04, CentOS 7.5, & CentOS 7.6. Using docker images developers can quickly prototype and build applications without having to be locked into a single system setup or lose valuable time figuring out the dependencies of the underlying software. ### MIVisionX Docker + * [Ubuntu 16.04](https://hub.docker.com/r/mivisionx/ubuntu-16.04) * [Ubuntu 18.04](https://hub.docker.com/r/mivisionx/ubuntu-18.04) * [CentOS 7.5](https://hub.docker.com/r/mivisionx/centos-7.5) @@ -265,27 +309,32 @@ MIVisionX provides developers with docker images for Ubuntu 16.04, Ubuntu 18.04, ### Docker Workflow Sample on Ubuntu 16.04 #### Prerequisites + * Ubuntu `16.04` * [rocm supported hardware](https://rocm.github.io/hardware.html) #### Workflow + * Step 1 - *Install rocm-dkms* -```` + +``` sudo apt update sudo apt dist-upgrade sudo apt install libnuma-dev sudo reboot -```` -```` +``` + +``` wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-key add - echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list sudo apt update sudo apt install rocm-dkms sudo reboot -```` +``` * Step 2 - *Setup Docker* -```` + +``` sudo apt-get install curl sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" @@ -293,46 +342,56 @@ sudo apt-get update apt-cache policy docker-ce sudo apt-get install -y docker-ce sudo systemctl status docker -```` +``` * Step 3 - *Get Docker Image* -```` + +``` sudo docker pull mivisionx/ubuntu-16.04 -```` +``` * Step 4 - *Run the docker image* -```` + +``` sudo docker run -it --device=/dev/kfd --device=/dev/dri --cap-add=SYS_RAWIO --device=/dev/mem --group-add video --network host mivisionx/ubuntu-16.04 -```` - * Optional: Map localhost directory on the docker image - * option to map the localhost directory with trained caffe models to be accessed on the docker image. - * usage: -v {LOCAL_HOST_DIRECTORY_PATH}:{DOCKER_DIRECTORY_PATH} -```` +``` + + + Optional: Map localhost directory on the docker image + - option to map the localhost directory with trained caffe models to be accessed on the docker image. + - usage: -v {LOCAL_HOST_DIRECTORY_PATH}:{DOCKER_DIRECTORY_PATH} + +``` sudo docker run -it -v /home/:/root/hostDrive/ --device=/dev/kfd --device=/dev/dri --cap-add=SYS_RAWIO --device=/dev/mem --group-add video --network host mivisionx/ubuntu-16.04 -```` +``` **Note:** **Display option with docker** + * Using host display -```` + +``` xhost +local:root sudo docker run -it --device=/dev/kfd --device=/dev/dri --cap-add=SYS_RAWIO --device=/dev/mem --group-add video --network host --env DISPLAY=unix$DISPLAY --privileged --volume $XAUTH:/root/.Xauthority --volume /tmp/.X11-unix/:/tmp/.X11-unix mivisionx/ubuntu-16.04:latest -```` +``` + * Test display with MIVisionX sample -```` + +``` export PATH=$PATH:/opt/rocm/mivisionx/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/mivisionx/lib runvx /opt/rocm/mivisionx/samples/gdf/canny.gdf -```` +``` ## Release Notes ### Known issues -* Package (.deb & .rpm) install requires **OpenCV `v3.4.0`** to execute AMD OpenCV extensions + +* Package (.deb & .rpm) install requires **OpenCV `v3.4.0` ** to execute AMD OpenCV extensions * ROCm `3.0` and above has known to slow down OpenCL kernels. ### Tested configurations + * Windows 10 -* Linux: Ubuntu - `16.04`/`18.04` & CentOS - `7.5`/`7.6` +* Linux: Ubuntu - `16.04` / `18.04` & CentOS - `7.5` / `7.6` * ROCm: rocm-dkms - `3.3.0-19` * rocm-cmake - [github master:ac45c6e](https://github.com/RadeonOpenCompute/rocm-cmake/tree/master) * MIOpenGEMM - [1.1.5](https://github.com/ROCmSoftwarePlatform/MIOpenGEMM/releases/tag/1.1.5) @@ -341,4 +400,4 @@ runvx /opt/rocm/mivisionx/samples/gdf/canny.gdf * OpenCV - [3.4.0](https://github.com/opencv/opencv/releases/tag/3.4.0) * RPP - [0.4](https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp/releases/tag/0.4) * Dependencies for all the above packages -* MIVisionX Setup Script - `V1.7.13` +* MIVisionX Setup Script - `V1.8.0` diff --git a/amd_openvx_extensions/CMakeLists.txt b/amd_openvx_extensions/CMakeLists.txt index 5cbb9147b8..9e534b140a 100644 --- a/amd_openvx_extensions/CMakeLists.txt +++ b/amd_openvx_extensions/CMakeLists.txt @@ -36,8 +36,12 @@ if(OpenCL_FOUND) else() message("-- ${Red}WARNING:AMDRPP Not Found -- amd_rpp module excluded${ColourReset}") endif() - add_subdirectory(amd_loomsl) - message("-- ${Green}AMD OpenVX Loom Stich Library Extension -- amd_loomsl module added${ColourReset}") + if(LOOM) + add_subdirectory(amd_loomsl) + message("-- ${Green}AMD OpenVX Loom Stich Library Extension -- amd_loomsl module added${ColourReset}") + else() + message("-- ${BoldBlue}LOOM Module turned OFF by user option -DLOOM=OFF ${ColourReset}") + endif() if(FFMPEG_FOUND) add_subdirectory(amd_media) message("-- ${Green}AMD OpenVX Media Extension -- amd_media module added${ColourReset}") @@ -48,11 +52,15 @@ else() message("-- ${Red}WARNING:OpenCL/FFMPEG Not Found -- amd_loomsl, & amd_media modules excluded${ColourReset}") endif(OpenCL_FOUND) -if(OpenCL_FOUND AND miopengemm_FOUND AND miopen_FOUND) - add_subdirectory(amd_nn) - message("-- ${Green}AMD OpenVX Neural Network Extension -- amd_nn module added${ColourReset}") +if(NEURAL_NET) + if(OpenCL_FOUND AND miopengemm_FOUND AND miopen_FOUND) + add_subdirectory(amd_nn) + message("-- ${Green}AMD OpenVX Neural Network Extension -- amd_nn module added${ColourReset}") + else() + message("-- ${Red}WARNING:MIOpen/MIOpenGEMM Not Found -- amd_nn module excluded${ColourReset}") + endif() else() - message("-- ${Red}WARNING:MIOpen/MIOpenGEMM Not Found -- amd_nn module excluded${ColourReset}") + message("-- ${BoldBlue}Neural Net Modules turned OFF by user option -DNEURAL_NET=OFF ${ColourReset}") endif() if(OpenCV_FOUND)