Installation#

This chapter provides information about the installation of rocAL and related packages.

Prerequisites#

  • Linux distribution

    • Ubuntu 20.04 or 22.04

    • CentOS 7

    • RedHat 8 or 9

    • SLES 15-SP5

  • ROCm-supported hardware

  • Install ROCm 6.1.0 or later with amdgpu-install: Required usecase - rocm

  • CMake

  • AMD Clang++

  • HIP

  • RPP

  • MIVisionX

  • rocDecode

  • Half-precision floating-point (HALF) library

  • Google Protobuf

  • LMBD Library

  • Python3 and Python3 PIP

  • Python Wheel

  • PyBind11

  • Turbo JPEG

  • RapidJSON

  • Optional: FFMPEG

  • Optional: OpenCV

IMPORTANT * Compiler features required

  • OpenMP

  • C++17

Installation instructions#

The installation process uses the following steps:

Package install#

Install rocAL runtime, development, and test packages.

  • Runtime package - rocal only provides the dynamic libraries

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

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

On Ubuntu#

sudo apt-get install rocal rocal-dev rocal-test

On CentOS/RedHat#

sudo yum install rocal rocal-devel rocal-test

On SLES#

sudo zypper install rocal rocal-devel rocal-test

Note

  • Package install requires Turbo JPEG, PyBind 11 v2.10.4 and Protobuf V3.12.4 manual install

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

Source Install#

For your convenience the rocAL-setup.py setup script is provided for Linux installations. This script will install all the dependencies required for the rocAL API.

Note

This script only needs to be executed once. However, upgrading the ROCm version also requires rerunning the rocAL-setup.py script.

The process for installing with the setup script is as follows:

  1. Clone rocAL source code

    git clone https://github.com/ROCm/rocAL.git
    
  2. Use either flow depending on the backend:

Running the rocAL-setup.py setup script#

Prerequisites:

Using rocAL-setup.py script:

python rocAL-setup.py       --directory [setup directory - optional (default:~/)]
                            --opencv    [OpenCV Version - optional (default:4.6.0)]
                            --pybind11  [PyBind11 Version - optional (default:v2.10.4)]
                            --reinstall [Remove previous setup and reinstall (default:OFF)[options:ON/OFF]]
                            --backend   [rocAL Dependency Backend - optional (default:HIP) [options:OCL/HIP]]
                            --rocm_path [ROCm Installation Path - optional (default:/opt/rocm) - ROCm Installation Required]

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

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

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

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

make test

Note

  • PyPackageInstall used for rocal_pybind installation

  • sudo required for pybind installation

Instructions for building rocAL with OpenCL GPU backend#

Find instructions on building rocAL for use with the OpenCL backend on OPENCL GPU Backend.

Note

  • rocAL_pybind is not supported on OPENCL backend

  • rocAL cannot be installed for both GPU backends in the same default folder (i.e., /opt/rocm/)

  • If an app interested in installing rocAL with both GPU backends, then add -DCMAKE_INSTALL_PREFIX in the cmake commands to install rocAL with OPENCL and HIP backends into two separate custom folders.

Verify installation#

The installer will copy:

  • Executables into /opt/rocm/bin

  • Libraries into /opt/rocm/lib

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

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

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

Verify with rocal-test package#

Test package will install ctest module to test rocAL. Follow below steps to test package install

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