Skip to content
Merged
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
16 changes: 16 additions & 0 deletions packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,21 @@ else
pip install "auditwheel<6.3.0"
fi

# Build the image extension without rocJPEG on ROCm. setup.py enables rocJPEG
# whenever $ROCM_HOME/include/rocjpeg/rocjpeg.h exists, which links
# torchvision/image_stable.so against librocjpeg.so.1. That library is neither
# bundled into the torchvision wheel (the repair step omits it) nor shipped in
# the torch wheel, so the extension fails to dlopen at import and every
# torchvision.io image op silently disappears -- CPU jpeg/png/webp included.
# Written to BUILD_ENV_FILE because this script runs as a subprocess; the build
# steps source that file.
if [[ "${CU_VERSION:-}" == rocm* ]]; then
echo "Disabling rocJPEG support for ${CU_VERSION}"
export TORCHVISION_USE_ROCJPEG=0
if [[ -n "${BUILD_ENV_FILE:-}" ]]; then
echo "export TORCHVISION_USE_ROCJPEG=0" >> "${BUILD_ENV_FILE}"
fi
fi

pip install numpy pyyaml future ninja
pip install --upgrade setuptools==72.1.0
Loading