Skip to content

Commit 7f42e27

Browse files
Skip dnf rocjpeg install when already present via ROCm 7.14 pip wheels
ROCm >= 7.14 distributes the full ROCm stack (including rocJPEG) as pip wheels (_rocm_sdk_core / _rocm_sdk_devel site-packages) rather than system RPMs. The rocjpeg-devel, libva-amdgpu and mesa-amdgpu-va-drivers DNF packages therefore don't exist on the ROCm 7.14 builder image and the install was failing with "No package rocjpeg available". Check for librocjpeg.so under /opt/conda (pip-wheel install path) and /opt/rocm (classic RPM install path) before attempting dnf install. If already present, skip the install entirely. The existing dnf path is preserved for ROCm 7.2 and earlier where RPMs are the only source. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6811de8 commit 7f42e27

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

packaging/install_rocjpeg.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ set -euo pipefail
2020
# test runners). On the plain build image that repo is absent; there we only need
2121
# to *compile* against rocjpeg.h/librocjpeg.so, so fall back to installing just
2222
# those with --nodeps (base libva provides the libva.so.2 soname we link).
23+
#
24+
# ROCm >= 7.14 distributes the full ROCm stack (including rocJPEG) as pip wheels
25+
# (_rocm_sdk_core / _rocm_sdk_devel site-packages). In that case librocjpeg.so
26+
# and rocjpeg.h are already present and the dnf packages don't exist, so we
27+
# skip the install entirely.
2328
install_rocjpeg_build_only() {
2429
dnf install -y --refresh libva
2530
dnf install -y "dnf-command(download)" >/dev/null 2>&1 || dnf install -y dnf-plugins-core
@@ -28,5 +33,16 @@ install_rocjpeg_build_only() {
2833
rpm -Uvh --nodeps "${rpm_dir}"/rocjpeg*.rpm
2934
}
3035

31-
dnf install -y --refresh rocjpeg-devel libva-amdgpu mesa-amdgpu-va-drivers \
32-
|| install_rocjpeg_build_only
36+
# Check if librocjpeg is already available (e.g. via ROCm 7.14+ pip wheels).
37+
if python3 -c "
38+
import glob, sys
39+
# _rocm_sdk_core and _rocm_sdk_devel are the pip-wheel-based ROCm installs
40+
hits = (glob.glob('/opt/conda/**/librocjpeg.so*', recursive=True) +
41+
glob.glob('/opt/rocm/lib/librocjpeg.so*'))
42+
sys.exit(0 if hits else 1)
43+
" 2>/dev/null; then
44+
echo "librocjpeg already present (ROCm pip-wheel install); skipping dnf install."
45+
else
46+
dnf install -y --refresh rocjpeg-devel libva-amdgpu mesa-amdgpu-va-drivers \
47+
|| install_rocjpeg_build_only
48+
fi

0 commit comments

Comments
 (0)