Installation#

This topic provides instructions for installing MIVisionX and related packages.

Prerequisites#

The following are the hardware and OS requirements of the MIVisionX library. Refer to System Requirements for additional information.

Hardware#

  • CPU: AMD64

  • GPU: AMD Radeon Graphics

  • APU: AMD Radeon Mobile/Embedded

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 APUs.

Operating System#

  • Linux

    • Ubuntu - 20.04 or 22.04

    • CentOS - 7

    • RedHat - 8 or 9

    • SLES - 15-SP4

  • Windows 10 or 11

  • macOS Ventura 13 or Sonoma 14

Linux installation#

The installation process uses the following steps:

  • ROCm-supported hardware install verification

  • Install ROCm 6.0.0 or later with amdgpu-install with --usecase=rocm

  • Install either from existing Packages or by building Source files as described below

Installation from packages#

Install MIVisionX runtime, development, and test packages.

  • Runtime package - mivisionx only provides the dynamic libraries and executables

  • Development package - mivisionx-dev / mivisionx-devel provides the libraries, executables, header files, and samples

  • Test package - mivisionx-test provides ctest to verify installation

Ubuntu#

sudo apt-get install mivisionx mivisionx-dev mivisionx-test

CentOS / RedHat#

sudo yum install mivisionx mivisionx-devel mivisionx-test

SLES#

sudo zypper install mivisionx mivisionx-devel mivisionx-test
  • Package install supports HIP backend

  • Package install requires OpenCV V4.6 manual install

  • CentOS/RedHat/SLES requires FFMPEG Dev package manual install

Installation from source files#

For your convenience a setup script is provided, MIVisionX-setup.py, which installs all required dependencies:

python MIVisionX-setup.py --directory [setup directory - optional (default:~/)]
                          --opencv    [OpenCV Version - optional (default:4.6.0)]
                          --ffmpeg    [FFMPEG V4.4.2 Installation - optional (default:ON) [options:ON/OFF]]
                          --amd_rpp   [MIVisionX VX RPP Dependency Install - optional (default:ON) [options:ON/OFF]]
                          --neural_net[MIVisionX Neural Net Dependency Install - optional (default:ON) [options:ON/OFF]]
                          --inference [MIVisionX Neural Net Inference Dependency Install - optional (default:ON) [options:ON/OFF]]
                          --developer [Setup Developer Options - optional (default:OFF) [options:ON/OFF]]
                          --reinstall [Remove previous setup and reinstall (default:OFF)[options:ON/OFF]]
                          --backend   [MIVisionX Dependency Backend - optional (default:HIP) [options:HIP/OCL/CPU]]
                          --rocm_path [ROCm Installation Path - optional (default:/opt/rocm ROCm Installation Required)]
  • Install ROCm before running the setup script

  • This script only needs to be executed once

  • ROCm upgrade requires the setup script to be rerun

Using MIVisionX-setup.py#

  • Clone MIVisionX git repository

git clone https://github.com/ROCm/MIVisionX.git

Note

MIVisionX supports two GPU backends: HIP and OPENCL. Refer to the following instructions for installing with HIP backend. Refer to OPENCL GPU backend for instructions on installing with OpenCL backend.

Instructions for building MIVisionX with the HIP GPU backend (default backend)#

  1. Run the setup script to install all the dependencies required by the HIP GPU backend:

    cd MIVisionX
    python MIVisionX-setup.py
    
  2. Run the following commands to build MIVisionX with the HIP GPU backend:

    mkdir build-hip
    cd build-hip
    cmake ../
    make -j8
    sudo make install
    
  3. Run tests - test option instructions

    make test
    

Windows#

  • Windows SDK

  • Visual Studio 2019 or later

  • Install the latest AMD drivers

  • Install OpenCL SDK

  • Install OpenCV 4.6.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

Using Visual Studio#

Use MIVisionX.sln to build for x64 platform

Important

Some modules in MIVisionX are only supported on Linux

macOS#

Refer to macOS build instructions

Important

macOS only supports MIVisionX CPU backend

Verify installation#

Linux / macOS#

The installer will copy:

  • Executables into /opt/rocm/bin

  • Libraries into /opt/rocm/lib

  • Header files into /opt/rocm/include/mivisionx

  • Apps, & Samples folder into /opt/rocm/share/mivisionx

  • Documents folder into /opt/rocm/share/doc/mivisionx

  • Model Compiler, and Toolkit folder into /opt/rocm/libexec/mivisionx

Verify with sample application#

Canny Edge Detection

Canny Image
export PATH=$PATH:/opt/rocm/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib
runvx /opt/rocm/share/mivisionx/samples/gdf/canny.gdf

Note

  • More samples are available at ../samples/README.md#samples

  • For macOS use export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/rocm/lib

Verify with mivisionx-test package#

Test package will install ctest module to test MIVisionX. Use the following steps to test package install:

mkdir mivisionx-test && cd mivisionx-test
cmake /opt/rocm/share/mivisionx/test/
ctest -VV

Windows#

  • MIVisionX.sln builds the libraries & executables in the folder MIVisionX/x64

  • Use RunVX to test the build

./runvx.exe ADD_PATH_TO/MIVisionX/samples/gdf/skintonedetect.gdf

Docker#

MIVisionX provides developers with docker images for Ubuntu 20.04 / 22.04. 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.

For more information about the Docker files used to build MIVisionX containers and a suggested workflow, see MIVisionX Docker documentation.

MIVisionX docker#

Tested configurations#

  • Windows 10 or 11

  • Linux distribution

    • Ubuntu - 20.04 or 22.04

    • CentOS - 7

    • RHEL - 8 or 9

    • SLES - 15-SP4

  • ROCm: rocm-core - 6.1.0.60100

  • RPP - 1.5.0.60100

  • miopen-hip - 3.1.0.60100

  • migraphx - 2.9.0.60100

  • OpenCV - 4.6.0

  • FFMPEG - n4.4.2

  • Dependencies for all the above packages

  • MIVisionX Setup Script - V2.7.0

Known issues#

  • OpenCV 4.X support for some apps missing

  • MIVisionX Package install requires manual prerequisites installation

MIVisionX dependency map#

Docker Image:
sudo docker build -f docker/ubuntu20/{DOCKER_LEVEL_FILE_NAME}.dockerfile -t {mivisionx-level-NUMBER} .

  • Green Square New component added to the level

  • Blue Square Existing component from the previous level

Build Level

MIVisionX Dependencies

Modules

Libraries and Executables

Docker Tag

Level_1

cmake
gcc
g++

amd_openvx
utilities

Green Square libopenvx.so - OpenVX Lib - CPU
Green Square libvxu.so - OpenVX immediate node Lib - CPU
Green Square runvx - OpenVX Graph Executor - CPU with Display OFF

Ubuntu 18.04 Level 1

Level_2

ROCm HIP
+Level 1

amd_openvx
amd_openvx_extensions
utilities

Green Square libopenvx.so - OpenVX Lib - CPU/GPU
Green Square libvxu.so - OpenVX immediate node Lib - CPU/GPU
Green Square runvx - OpenVX Graph Executor - Display OFF

Ubuntu 18.04 Level 1

Level_3

OpenCV
FFMPEG
+Level 2

amd_openvx
amd_openvx_extensions
utilities

Blue Square libopenvx.so - OpenVX Lib
Blue Square libvxu.so - OpenVX immediate node Lib
Green Square libvx_amd_media.so - OpenVX Media Extension
Green Square libvx_opencv.so - OpenVX OpenCV InterOp Extension
Green Square mv_compile - Neural Net Model Compile
Green Square runvx - OpenVX Graph Executor - Display ON

Ubuntu 18.04 Level 1

Level_4

MIOpen
MIGraphX
ProtoBuf
+Level 3

amd_openvx
amd_openvx_extensions
apps
utilities

Blue Square libopenvx.so - OpenVX Lib
Blue Square libvxu.so - OpenVX immediate node Lib
Blue Square libvx_amd_media.so - OpenVX Media Extension
Blue Square libvx_opencv.so - OpenVX OpenCV InterOp Extension
Blue Square mv_compile - Neural Net Model Compile
Blue Square runvx - OpenVX Graph Executor - Display ON
Green Square libvx_nn.so - OpenVX Neural Net Extension

Ubuntu 18.04 Level 1

Level_5

AMD_RPP
RPP deps
+Level 4

amd_openvx
amd_openvx_extensions
apps
AMD VX RPP
utilities

Blue Square libopenvx.so - OpenVX Lib
Blue Square libvxu.so - OpenVX immediate node Lib
Blue Square libvx_amd_media.so - OpenVX Media Extension
Blue Square libvx_opencv.so - OpenVX OpenCV InterOp Extension
Blue Square mv_compile - Neural Net Model Compile
Blue Square runvx - OpenVX Graph Executor - Display ON
Blue Square libvx_nn.so - OpenVX Neural Net Extension
Green Square libvx_rpp.so - OpenVX RPP Extension

Ubuntu 18.04 Level 1

Note

OpenVX and the OpenVX logo are trademarks of the Khronos Group Inc.