rocJPEG is a high performance JPEG decode SDK for AMD GPUs. Using the rocJPEG API, you can access the JPEG decoding features available on your GPU.
Supported JPEG chroma subsampling
- YUV 4:4:4
- YUV 4:2:2
- YUV 4:2:0
- YUV 4:0:0
Prerequisites
-
Linux distribution
- Ubuntu -
20.04/22.04 - RHEL -
8/9 - SLES -
15-SP5
- Ubuntu -
Important
gfx908or higher GPU required
- Install ROCm
6.1.0or later with amdgpu-install: Required usecase - rocm
Important
sudo amdgpu-install --usecase=rocm
- Video Acceleration API Version
1.5.0+-Libvais an implementation for VA-APIsudo apt install libva-dev
Note
RPM Packages for
RHEL/SLES-libva-devel
-
AMD VA Drivers
sudo apt install mesa-amdgpu-va-drivers -
CMake
3.5or latersudo apt install cmake -
sudo apt install pkg-config
Important
- If using Ubuntu 22.04, you must install
libstdc++-12-devsudo apt install libstdc++-12-dev
- Additional RPM Packages required for
RHEL/SLES-libdrm-amdgpu mesa-amdgpu-dri-drivers
Note
- All package installs are shown with the
aptpackage manager. Use the appropriate package manager for your operating system.- To install rocJPEG with minimum requirements, follow the quick-start instructions
Prerequisites setup script for Linux
For your convenience, we provide the setup script, rocJPEG-setup.py which installs all required dependencies. Run this script only once.
Usage:
python rocJPEG-setup.py --rocm_path [ ROCm Installation Path - optional (default:/opt/rocm)]
NOTE: This script only needs to be executed once.
Installation instructions
The installation process uses the following steps:
-
ROCm-supported hardware install verification
-
Install ROCm
6.1.0or later with amdgpu-install with--usecase=rocm -
Use either Package install or Source install as described below.
Package install
Install rocJPEG runtime, development, and test packages.
- Runtime package -
rocjpegonly provides the rocjpeg librarylibrocjpeg.so - Development package -
rocjpeg-dev/rocjpeg-develprovides the library, header files, and samples - Test package -
rocjpeg-testprovides CTest to verify installation
Ubuntu
sudo apt install rocjpeg rocjpeg-dev rocjpeg-test
RHEL
sudo yum install rocjpeg rocjpeg-devel rocjpeg-test
SLES
sudo zypper install rocjpeg rocjpeg-devel rocjpeg-test
Note
Package install auto installs all dependencies.
Source install
git clone https://github.com/ROCm/rocJPEG.git
cd rocJPEG
mkdir build && cd build
cmake ../
make -j8
sudo make install
Run tests
make test
NOTE: run tests with verbose option make test ARGS="-VV"
Make package
sudo make package
Verify installation
The installer will copy
- Libraries into
/opt/rocm/lib - Header files into
/opt/rocm/include/rocjpeg - Samples folder into
/opt/rocm/share/rocjpeg - Documents folder into
/opt/rocm/share/doc/rocjpeg
Using sample application
To verify your installation using a sample application, run:
mkdir rocjpeg-sample && cd rocjpeg-sample
cmake /opt/rocm/share/rocjpeg/samples/jpegDecode/
make -j8
./jpegdecode -i /opt/rocm/share/rocjpeg/images/mug_420.jpg
Using test package
To verify your installation using the rocjpeg-test package, run:
mkdir rocjpeg-test && cd rocjpeg-test
cmake /opt/rocm/share/rocjpeg/test/
ctest -VV
Samples
The tool provides a few samples to decode JPEG images here. Please refer to the individual folders to build and run the samples. You can access samples to decode your images in our GitHub repository. Refer to the individual folders to build and run the samples.
Docker
You can find rocJPEG Docker containers in our GitHub repository.
Documentation
Run the following code to build our documentation locally.
cd docs
pip3 install -r sphinx/requirements.txt
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
For more information on documentation builds, refer to the Building documentation page.
Tested configurations
- Linux
- Ubuntu -
20.04/22.04 - RHEL -
8/9 - SLES -
15-SP5
- Ubuntu -
- ROCm:
- rocm-core -
6.1.0.60100-62 - amdgpu-core -
1:6.1.60100-1741643
- rocm-core -
- libva-dev -
2.7.0-2/2.14.0-1 - mesa-amdgpu-va-drivers -
1:24.1.0 - mesa-amdgpu-dri-drivers -
24.1.0.60200 - rocJPEG Setup Script -
V1.2.0
