Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/linux_rocm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.10']
rocm-version: ['7.1']
rocm-version: ['7.2']
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
permissions:
id-token: write
Expand Down Expand Up @@ -144,6 +144,32 @@ jobs:
bash packaging/install_rocjpeg.sh
echo '::endgroup::'

echo '::group::VA-API and DRM diagnostics'
# libva libraries present in the container
ldconfig -p | grep -E "libva|libdrm" || true
# DRM render nodes - permissions and group ownership
ls -la /dev/dri/ || true
# Current user and groups (container user must be in video/render group)
id
# Check whether mesa-amdgpu-va-drivers was actually installed
# (install_rocjpeg.sh silently falls back and skips it if AMD repo is absent)
rpm -q mesa-amdgpu-va-drivers libva-amdgpu rocjpeg 2>&1 || true
# Find VA driver .so files - if amdgpu_drv_video.so is missing, vaInit will fail
find /usr -name "*drv_video*" 2>/dev/null || true
# Try vainfo on every render node (no-sudo: true so we can't install vainfo)
if command -v vainfo &>/dev/null; then
for node in /dev/dri/renderD*; do
echo "--- vainfo on ${node} ---"
vainfo --display drm --device "${node}" 2>&1 || true
done
else
echo "vainfo not installed, skipping VA-API smoke test"
fi
# Show which VA driver is selected
echo "LIBVA_DRIVER_NAME=${LIBVA_DRIVER_NAME:-<not set>}"
echo "LIBVA_DRIVERS_PATH=${LIBVA_DRIVERS_PATH:-<not set>}"
echo '::endgroup::'

echo '::group::Install torchcodec from the wheel'
python -m pip install "${RUNNER_ARTIFACT_DIR}"/*.whl -vvv
echo '::endgroup::'
Expand Down
20 changes: 18 additions & 2 deletions packaging/install_rocjpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ set -euo pipefail
# test runners). On the plain build image that repo is absent; there we only need
# to *compile* against rocjpeg.h/librocjpeg.so, so fall back to installing just
# those with --nodeps (base libva provides the libva.so.2 soname we link).
#
# ROCm >= 7.14 distributes the full ROCm stack (including rocJPEG) as pip wheels
# (_rocm_sdk_core / _rocm_sdk_devel site-packages). In that case librocjpeg.so
# and rocjpeg.h are already present and the dnf packages don't exist, so we
# skip the install entirely.
install_rocjpeg_build_only() {
dnf install -y --refresh libva
dnf install -y "dnf-command(download)" >/dev/null 2>&1 || dnf install -y dnf-plugins-core
Expand All @@ -28,5 +33,16 @@ install_rocjpeg_build_only() {
rpm -Uvh --nodeps "${rpm_dir}"/rocjpeg*.rpm
}

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