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.
-
Linux distribution
- Ubuntu -
22.04/24.04 - RHEL -
9 - SLES -
15 SP5
- Ubuntu -
Important
gfx908 or higher GPU required
- Install ROCm
7.0.0or later with amdgpu-install: Required usecase - rocm
Important
sudo amdgpu-install --usecase=rocm
-
CMake Version
3.15or latersudo apt install cmake
-
AMD Clang++ Version
18.0.0or later - installed with ROCm -
sudo apt install rocm-hip-runtime-dev
-
sudo apt install libdlpack-dev
-
Python3 and Python3 PIP
sudo apt install python3-dev python3-pip
-
Python: PyBind11
pip3 install pybind11
-
Python: Wheel
pip3 install wheel
Important
The following compiler features are required:
- C++20
To be able to build/run the samples and tests for both the rocCV C++ library and the python module, additional dependencies are required.
-
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
-
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.
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)]The installation process uses the following steps:
-
ROCm-supported hardware install verification
-
Install ROCm
7.0.0or later with amdgpu-install with--usecase=rocm
Important
Use either package install or source install as described below.
Install rocCV runtime, development, and test packages.
- Runtime package -
roccvonly provides the dynamic libraries - Development package -
roccv-dev/roccv-develprovides the libraries, executables, header files, and samples - Test package -
roccv-testprovides ctest to verify installation
sudo apt-get install roccv roccv-dev roccv-testsudo yum install roccv roccv-devel roccv-testsudo zypper install roccv roccv-devel roccv-testImportant
RedHat/SLES requires an additional manual installation of the OpenCV and DLPack dev packages.
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:$PYTHONPATHTo build rocCV from source and install, follow the steps below:
- Clone rocCV source code
git clone https://github.com/ROCm/rocCV.gitNote
To ensure all dependencies are installed, a python script for setup is included for your convenience.
python3 roccv-setup.pymkdir -p build
cd build
cmake ../
cmake --build . --parallelBoth the C++ and Python libraries can be installed using the following make target:
sudo make installsudo make packagerocCV 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:Buildsrocpycv, the Python wrapper for rocCV.
After building, running ctest in the build directory will run tests for the C++ library.
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/libTest 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 -VVNote
Make sure all rocCV required libraries are in your PATH
export PATH=$PATH:/opt/rocm/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib
export PYTHONPATH=/opt/rocm/lib:$PYTHONPATH