Building and installing MIVisionX on Linux from source code

Building and installing MIVisionX on Linux from source code#

Before building and installing MIVisionX, ensure that ROCm has been installed with the AMDGPU installer and the rocm usecase:

sudo amdgpu-install --usecase=rocm

The MIVisionX source code is available from ROCm/MIVisionX. Use the version of MIVisionX that corresponds to the installed version of ROCm.

MIVisionX on Linux supports both the HIP and OpenCL backends.

MIVisionX is installed in the ROCm installation directory by default. If MIVisionX for both HIP and OpenCL backends will be installed on the system, each version must be installed in its own custom directory and not in the default directory.

You can choose to use the MIVisionX-setup.py Python script to install most prerequisites:

python3 MIVisionX-setup.py

To build and install MIVisionX for the HIP backend, create the build_hip directory under the MIVisionX root directory. Change directory to build_hip:

mkdir build-hip
cd build-hip

Use cmake to generate a makefile:

cmake ../

If MIVisionX will be built for both the HIP and OpenCL backends, use the -DCMAKE_INSTALL_PREFIX CMake directive to set the installation directory. For example:

cmake -DCMAKE_INSTALL_PREFIX=/opt/hip_backend/

Run make and make install :

make
make install

To build and install MIVisionX for the OpenCL backend, run cmake with -DBACKEND=OPENCL:

mkdir build-ocl
cd build-ocl
cmake -DBACKEND=OPENCL ../
make
sudo make install

If MIVisionX is being built for both the HIP and OpenCL backends, use -DCMAKE_INSTALL_PREFIX to set the installation directory for the OpenCL backend as well.

After installation, the MIVisionX files will be found under /opt/rocm/ unless -DCMAKE_INSTALL_PREFIX was specified. If -DCMAKE_INSTALL_PREFIX was specified, the MIVisionX files will be installed under the specified directory.

To make and run tests, use make test.