Skip to content

[Issue]: rocJPEG tests fail on CI due to VA-API driver mismatch #492

Description

@daniellegillai

Problem Description

CTests for rocJPEG (basic_test_rocjpeg_gray and basic_test_rocjpeg_rgb) fail due to a mismatch between the libva2 version (VA-API 1.20) and Mesa driver in ROCm (VA-API 1.22).

rocJPEG links to the libva 1.20 runtime. It will try to dynamically load the driver at /opt/rocm/lib/rocm_sysdeps/lib/radeonsi_drv_video.so. This leads to the following libva error:
libva error: /opt/rocm/lib/rocm_sysdeps/lib/radeonsi_drv_video.so has no function __vaDriverInit_1_0.
nm shows that this driver exports __vaDriverInit_1_22.

Meanwhile, when instead rocJPEG is directed to use the driver at /usr/lib/x86_64-linux-gnu/libgallium-*.so from ffmpeg, the tests pass without an error. nm shows that this driver exports __vaDriverInit_1_20.

See "Produce more debug info" for more detail.

Operating System

Ubuntu 24.04.4 LTS (Noble Numbat)

CPU

AMD Ryzen 9 9950X 16-Core Processor

GPU

AMD Radeon RX 9070 XT

ROCm Version

7.15.0

ROCm Component

No response

Steps to Reproduce

Setup

Use the same docker image as the CI:

sudo docker run -it --rm --device /dev/kfd --device /dev/dri mivisionx/ubuntu-24.04:rocm-20260710 bash

In the container, run:

export ROCM_PATH=/opt/rocm
export LD_LIBRARY_PATH=/opt/rocm/lib
export LIBVA_DRIVERS_PATH=/opt/rocm/lib/rocm_sysdeps/lib
git clone https://github.com/rocm/rocAL.git
cd  rocAL

(Still in the container) Run the same library / dependency set up as in the CI:

apt-get update -qq
apt-get install -y --no-install-recommends build-essential cmake git python3 \
libprotobuf-dev libprotoc-dev protobuf-compiler libturbojpeg0-dev liblmdb-dev libjpeg-dev \
pkg-config ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
git clone --depth 1 https://github.com/Tencent/rapidjson.git
cd rapidjson
mkdir build
cd build
cmake ../ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_DOC=OFF
make -j$(nproc)
make install
cd ../..
git clone --depth 1 --filter=blob:none --sparse https://github.com/ROCm/rocm-libraries.git
cd rocm-libraries
git sparse-checkout set projects/rpp
cd projects/rpp
mkdir build
cd build
cmake ..
make -j$(nproc)
make install
cd ../../../../
git clone --depth 1 https://github.com/ROCm/MIVisionX.git
cd MIVisionX
mkdir build && cd build
cmake .. \
  -DBACKEND=HIP \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER="${ROCM_PATH}/bin/amdclang" \
  -DCMAKE_CXX_COMPILER="${ROCM_PATH}/bin/amdclang++"
make -j$(nproc)
make install
cd ../..
mkdir build
cd build
cmake .. -DBUILD_PYPACKAGE=OFF -DCMAKE_DISABLE_FIND_PACKAGE_rocdecode=ON
make -j$(nproc)
make install

Produce the error

Run ctest on basic_test_cpu to build the test, then run it on rocjpeg.

cd /rocAL/build
ctest -R basic_test_cpu
cd tests/cpp_api/basic_test
./basic_test ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet-val.txt 1 1 224 224 0 1 1 # basic_test_rocjpeg_gray
./basic_test ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet-val.txt 1 1 224 224 1 1 1 # basic_test_rocjpeg_rgb

Produce more debug info

Command: LIBVA_MESSAGING_LEVEL=1 ./basic_test ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet-val.txt 1 1 224 224 1 1 1 2>&1 | grep -i driver
Output: libva error: /opt/rocm/lib/rocm_sysdeps/lib/radeonsi_drv_video.so has no function __vaDriverInit_1_0

Command: nm -D /opt/rocm/lib/rocm_sysdeps/lib/radeonsi_drv_video.so | grep vaDriver
Output: 0000000000028fb0 T __vaDriverInit_1_22@@AMDROCM_SYSDEPS_1.0

Command: nm -D /usr/lib/x86_64-linux-gnu/libgallium-25.2.8-0ubuntu0.24.04.2.so | grep vaDriver
Output: 0000000000100a80 T __vaDriverInit_1_20@@libgallium-25.2.8-0ubuntu0.24.04.2.so

Command:

apt install -y vainfo
vainfo 2>&1 | grep version

Output: libva info: VA-API version 1.20.0

Command: apt-cache policy libva2
Output:

libva2:
  Installed: 2.20.0-2ubuntu0.2
  Candidate: 2.20.0-2ubuntu0.2
  Version table:
 *** 2.20.0-2ubuntu0.2 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     2.20.0-2build1 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

rocminfo --support output
Paste output here

Additional Information

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions