Skip to content

ROCm/rocCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT licensed doc

Note

The published rocCV documentation is available here in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the docs folder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see Contribute to ROCm documentation.

rocCV is an efficient GPU-accelerated library for image pre- and post-processing, powered by AMD's HIP platform.

Note

rocCV is currently only available as a source install.

As rocCV is in early preview with ROCm 7.0.0, pre-built packages are not yet provided. Packages will be made available with the ROCm 7.1.x release.

Latest release

GitHub tag (latest SemVer)

Prerequisites

  • Linux distribution

    • Ubuntu - 22.04 / 24.04
    • RHEL - 9
    • SLES - 15 SP5
  • ROCm-supported hardware

    [!IMPORTANT] gfx908 or higher GPU required

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

    [!IMPORTANT] sudo amdgpu-install --usecase=rocm

  • CMake Version 3.15 or later

    sudo apt install cmake
  • AMD Clang++ Version 18.0.0 or later - installed with ROCm

  • HIP

    sudo apt install hip-dev
  • Python3 and Python3 PIP

    sudo apt install python3-dev python3-pip

Important

The following compiler features are required:

  • C++20

Samples and tests

To be able to build/run the samples and tests for both the rocCV C++ library and the python module, additional dependencies are required.

Python Samples/Tests

  • OpenCV: Python module required for loading test images. Sample applications also use OpenCV to load and write images.

  • Pytest: Required for running the tests.

  • Numpy: Required as OpenCV loads its data into numpy arrays.

    sudo apt install python3-pytest python3-opencv python3-numpy

C++ Samples/Tests

  • OpenCV: Development package required for loading test images. Sample applications also use OpenCV to load and write images.

    sudo apt install libopencv-dev

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,roccv-setup.py, which installs all required dependencies. Run this script only once.

python roccv-setup.py --rocm_path [ROCm Installation Path - optional (default:/opt/rocm)]

Installation instructions

The installation process uses the following steps:

Important

Use either package install or source install as described below.

Package install

Install rocCV runtime, development, and test packages.

  • Runtime package - roccv only provides the dynamic libraries
  • Development package - roccv-dev/roccv-devel provides the libraries, executables, header files, and samples
  • Test package - roccv-test provides ctest to verify installation

Ubuntu

sudo apt-get install roccv roccv-dev roccv-test

CentOS/RedHat

sudo yum install roccv roccv-devel roccv-test

SLES

sudo zypper install roccv roccv-devel roccv-test

Important

To use the rocCV python module, PYTHONPATH must be set appropriately to point to its install location in the ROCm directory:

export PYTHONPATH=/opt/rocm/lib:$PYTHONPATH

Source install

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

  • Clone rocCV source code and cd into the project:
git clone https://github.com/ROCm/rocCV.git
cd rocCV
  • Initialize and update submodules (for pybind11 and dlpack dependencies)
git submodule init
git submodule update

Note

To ensure all dependencies are installed, a python script for setup is included for your convenience.

python3 roccv-setup.py

Build the project using CMake

mkdir -p build
cd build
cmake ../
cmake --build . --parallel

Install the C++ and Python libraries

Both the C++ and Python libraries can be installed using the following make target:

sudo make install

Make package

sudo make package

Build Options

rocCV has a number of build options which may be set through cmake flags.

  • -D TESTS=ON: Builds unit and integration tests.
  • -D SAMPLES=ON: Builds sample applications.
  • -D BUILD_PYPACKAGE=ON: Builds rocpycv, the Python wrapper for rocCV.

Testing

After building, running ctest in the build directory will run tests for the C++ library.

Verify installation

The installer copies:

  • Libraries into /opt/rocm/lib
  • Header files into /opt/rocm/include/roccv
  • Samples folder into /opt/rocm/share/roccv
  • Documents folder into /opt/rocm/share/doc/roccv

Note

Ensure the required ROCm directories are added to your paths:

export PATH=$PATH:/opt/rocm/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib

Verify rocCV C++ API with roccv-test package

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

mkdir roccv-cpp-test && cd roccv-cpp-test
cmake /opt/rocm/share/roccv/test/cpp
make -j8
ctest -VV

Verify rocCV PyBind with roccv-test package

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

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

Note

Make sure all rocCV PyBind libraries are in your Python PATH

export PYTHONPATH=/opt/rocm/lib:$PYTHONPATH

About

rocCV is an efficient GPU-accelerated library for image pre- and post-processing, powered by AMD's HIP platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8