ROCm / rocAL

The AMD rocAL 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.
https://rocm.docs.amd.com/projects/rocAL/en/develop/
MIT License
11 stars 13 forks source link

MIT licensed

The AMD ROCm Augmentation Library (rocAL) 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. rocAL currently provides C API. For more details, go to rocAL user guide page.

Supported Operations

rocAL can be currently used to perform the following operations either with randomized or fixed parameters:

Blend Blur (Gaussian 3x3) Brightness Color Temperature
ColorTwist Contrast Crop Crop Mirror Normalization
CropResize Exposure Modification Fisheye Lens Flip (Horizontal, Vertical and Both)
Fog Gamma Hue Jitter
Lens Correction Pixelization Raindrops Random Crop
Resize Resize Crop Mirror Rotation Salt And Pepper Noise
Saturation Snowflakes Vignette Warp Affine

Prerequisites

[!IMPORTANT]

  • Compiler features required
    • OpenMP
    • C++17

[!NOTE]

  • All package installs are shown with the apt package manager. Use the appropriate package manager for your operating system.

Prerequisites setup script

For your convenience, we provide the setup script,rocAL-setup.py, which installs all required dependencies. Run this script only once.

python rocAL-setup.py --directory [setup directory - optional (default:~/)]
                      --rocm_path [ROCm Installation Path - optional (default:/opt/rocm)]
                      --backend   [rocAL Dependency Backend - optional (default:HIP) [options:OCL/HIP]]
                      --ffmpeg    [FFMPEG Installation - optional (default:OFF)[options:ON/OFF]]
                      --reinstall [Reinstall - optional (default:OFF)[options:ON/OFF]]

Installation instructions

The installation process uses the following steps:

Package install

Install rocAL runtime, development, and test packages.

Ubuntu

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

CentOS/RedHat

  sudo yum install rocal rocal-devel rocal-test

SLES

  sudo zypper install rocal rocal-devel rocal-test

[!NOTE]

  • Package install requires TurboJPEG and RapidJSON manual install
  • CentOS/RedHat/SLES requires additional FFMPEG Dev package manual install

Source install

To build rocAL from source and install, follow the steps below:

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

Note: rocAL has support for two GPU backends: OPENCL and HIP:

HIP Backend

[!IMPORTANT]

  • Use -D PYTHON_VERSION_SUGGESTED=3.x with cmake for using a specific Python3 version if required.
  • Use -D AUDIO_SUPPORT=ON to enable Audio features, Audio support will be enabled by default with ROCm versions > 6.2

[!NOTE] To run tests with verbose option, use make test ARGS="-VV".

OpenCL 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

Verify with rocal-test package

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

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

[!NOTE]

  • Make sure all rocAL required libraries are in your PATH
  • RHEL/SLES - Export FFMPEG libraries into your PATH
    • export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64/:/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
      export PATH=$PATH:/opt/rocm/bin
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib

      Documentation

Run the steps below to build documentation locally.

Technical support

Please email mivisionx.support@amd.com for questions, and feedback on rocAL.

Please submit your feature requests, and bug reports on the GitHub issues page.

Release notes

Latest release version

GitHub tag (latest SemVer)

Changelog

Review all notable changes with the latest release

Tested Configurations