Skip to content
Kiriti Gowda edited this page Jan 28, 2023 · 6 revisions

Linux Build Instructions

Identify Linux Components

  • Linux Version Info

    • Ubuntu
    cat /etc/lsb-release && uname -a
    
    • CentOS / RedHat / SLES
    cat /etc/os-release && uname -a
    
  • Linux CPU & GPU Info

    • Ubuntu
    cat /proc/cpuinfo && lspci  -v -s  $(lspci | grep ' VGA ' | cut -d" " -f 1)
    
    • CentOS / RedHat / SLES
    cat /proc/cpuinfo && /sbin/lsmod | grep gpu
    

Prerequisites

  • Linux distribution
    • Ubuntu - 20.04 / 22.04
    • CentOS - 7 / 8
    • RedHat - 8 / 9
    • SLES - 15-SP3
  • Install ROCm
  • CMake 2.8 or newer download
  • ROCm MIOpen for Neural Net Extensions (vx_nn)
  • Qt Creator for Cloud Inference Client
  • Protobuf for inference generator & model compiler
    • install libprotobuf-dev and protobuf-compiler needed for vx_nn
  • OpenCV 4.6
    • Set OpenCV_DIR environment variable to OpenCV/build folder
  • FFMPEG n4.4.2 - Optional
    • FFMPEG is required for amd_media & mv_deploy modules
  • RALI Prerequisites

Build and Install

Using apt-get / yum

  • ROCm supported hardware
  • Install ROCm
  • On Ubuntu
    sudo apt-get install mivisionx
    
  • On CentOS / RedHat
    sudo yum install mivisionx
    
  • On SLES
    sudo zypper install mivisionx
    
    Note:
    • vx_winml is not supported on linux
    • source code will not available with apt-get / yum install
    • the installer will copy
      • executables into /opt/rocm/mivisionx/bin
      • libraries into /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

  • ROCm supported hardware

  • Install ROCm

  • Use the below commands to set up and build MIVisionX

    • Clone MIVisionX
    git clone https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX.git
    cd MIVisionX
    
    • Run Setup
    python MIVisionX-setup.py
    
    mkdir build
    cd build
    cmake ../
    make -j8
    sudo make install
    

    Note: vx_winml is not supported on Linux

Verify the Installation

  • The installer will copy

    • executables into /opt/rocm/bin
    • libraries into /opt/rocm/lib
    • OpenVX and OpenVX module header files into /opt/rocm/include/mivisionx
    • Apps, Samples, Documents, Model Compiler, and Toolkit are placed into /opt/rocm/libexec/mivisionx
  • Run the below sample to verify the installation

    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 in samples folder