AMD has released a tutorial demonstrating how developers can build a high-performance video inference pipeline using ROCm libraries. The guide highlights the use of three key libraries: rocDecode for video decoding, HIP for custom kernel development, and MIGraphX for efficient model inference. The pipeline processes HEVC streams, performs color space conversion, and runs inference using ResNet-18 on each frame, all while leveraging GPU acceleration for optimal performance and energy efficiency. The tutorial emphasizes the importance of GPU utilization in applications that require high computational throughput, particularly for tasks like video processing and machine learning inference.

The tutorial provides detailed steps for setting up the development environment, including hardware and software requirements. Developers are encouraged to use AMD GPUs, with RDNA 3.5 integrated graphics in desktop or laptop systems being sufficient for the tutorial. Software-wise, the guide focuses on Ubuntu 24.04 and recommends using Docker to simplify the setup and manage multiple ROCm versions. It also outlines the necessary components, such as installing AMD GPU drivers, ROCm version 7.2.1, and specific tools for building rocDecode and MIGraphX libraries. The Dockerfile provided in the tutorial helps replicate the environment, ensuring compatibility and avoiding conflicts with standard Linux repositories.

The tutorial explains how to build and run the pipeline, including the use of a custom LLVM toolchain and the setup of a specific build environment. It also highlights some non-obvious details, such as the need to adjust GPU-target parameters for different architectures and the importance of explicitly providing paths to LLVM compilers. The final step involves running the application with a prepared video file in H.265 format and a ResNet-18 model in ONNX format. The guide concludes by emphasizing the benefits of using ROCm libraries to perform most manipulations on the GPU, minimizing data transfers to system memory.

Source: amd