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.
Note
The published documentation is available at rocJPEG 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
- YUV 4:4:4
- YUV 4:4:0
- YUV 4:2:2
- YUV 4:2:0
- YUV 4:0:0
- Linux
- Ubuntu -
22.04/24.04 - RedHat -
8/9 - SLES -
15 SP7
- Ubuntu -
Important
gfx908or higher GPU required
- Install ROCm
6.3.0or later with amdgpu-install: Required usecase:rocm
Important
sudo amdgpu-install --usecase=rocm
- AMD Clang++ Version 18.0.0 or later - installed with ROCm
-
CMake Version
3.10or latersudo apt install cmake
-
Video Acceleration API -
libva-amdgpu-devis an AMD implementation for VA-APIsudo apt install libva-amdgpu-dev
Note
- RPM Packages for
RHEL/SLES-libva-amdgpu-devel libva-amdgpuis strongly recommended over systemlibvaas it is used for building mesa-amdgpu-va-driver
- AMD VA Drivers
sudo apt install libva2-amdgpu libva-amdgpu-drm2 libva-amdgpu-wayland2 libva-amdgpu-x11-2 mesa-amdgpu-va-drivers
Note
RPM Packages for RHEL/SLES - libva-amdgpu mesa-amdgpu-va-drivers
- HIP
sudo apt install hip-dev
Important
- Required compiler support
- C++17
- Threads
- On Ubuntu 22.04 - Additional package required: libstdc++-12-dev
sudo apt install libstdc++-12-devNote
- All package installs are shown with the
aptpackage manager. Use the appropriate package manager for your operating system.
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.
The installation process uses the following steps:
-
ROCm-supported hardware install verification
-
Install ROCm
6.3.0or later with amdgpu-install with--usecase=rocm
Important
Use either package install or source install as described below.
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
sudo apt install rocjpeg rocjpeg-dev rocjpeg-testsudo yum install rocjpeg rocjpeg-devel rocjpeg-testsudo zypper install rocjpeg rocjpeg-devel rocjpeg-testNote
Package install auto installs all dependencies.
git clone https://github.com/ROCm/rocJPEG.git
cd rocJPEG
mkdir build && cd build
cmake ../
make -j8
sudo make installmake testNOTE: run tests with verbose option make test ARGS="-VV"
sudo make packageThe 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
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.jpgTo verify your installation using the rocjpeg-test package, run:
mkdir rocjpeg-test && cd rocjpeg-test
cmake /opt/rocm/share/rocjpeg/test/
ctest -VVThe 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.
You can find rocJPEG Docker containers in our GitHub repository.
