Skip to content

Commit

Permalink
Update wheel build scripts for ROCm5.5 (#1413)
Browse files Browse the repository at this point in the history
* Fix lib search logic and lib list

* Add libhipsolver.so dependency for upstream Pytorch (needed since PyTorch PR 97370)

* Add MIOpen db files to share path only for ROCm5.5 and above
  • Loading branch information
jithunnair-amd authored Jun 9, 2023
1 parent 3f9562d commit 1a3174e
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions manywheel/build_rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,13 @@ ROCM_SO_FILES=(
"libhipblas.so"
"libhipfft.so"
"libhiprand.so"
"libhipsolver.so"
"libhipsparse.so"
"libhsa-runtime64.so"
"libamd_comgr.so"
"libmagma.so"
"librccl.so"
"librocblas.so"
"librocfft-device-0.so"
"librocfft-device-1.so"
"librocfft-device-2.so"
"librocfft-device-3.so"
"librocfft.so"
"librocm_smi64.so"
"librocrand.so"
Expand All @@ -97,6 +94,13 @@ ROCM_SO_FILES=(
"libroctx64.so"
)

if [[ $ROCM_INT -lt 50500 ]]; then
ROCM_SO_FILES+=("librocfft-device-0.so")
ROCM_SO_FILES+=("librocfft-device-1.so")
ROCM_SO_FILES+=("librocfft-device-2.so")
ROCM_SO_FILES+=("librocfft-device-3.so")
fi

if [[ $ROCM_INT -ge 50400 ]]; then
ROCM_SO_FILES+=("libhiprtc.so")
fi
Expand Down Expand Up @@ -164,6 +168,10 @@ do
if [[ -z $file_path ]]; then
file_path=($(find $ROCM_HOME/ -name "$lib")) # Then search in ROCM_HOME
fi
if [[ -z $file_path ]]; then
echo "Error: Library file $lib is not found." >&2
exit 1
fi
ROCM_SO_PATHS[${#ROCM_SO_PATHS[@]}]="$file_path" # Append lib to array
done

Expand All @@ -179,16 +187,19 @@ DEPS_SONAME=(

DEPS_AUX_SRCLIST=(
"${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_SRC/}"
"${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_SRC/}"
"/opt/amdgpu/share/libdrm/amdgpu.ids"
)

DEPS_AUX_DSTLIST=(
"${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_DST/}"
"${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_DST/}"
"share/libdrm/amdgpu.ids"
)

if [[ $ROCM_INT -ge 50500 ]]; then
DEPS_AUX_SRCLIST[${#DEPS_AUX_SRCLIST[@]}]="${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_SRC/}"
DEPS_AUX_DSTLIST[${#DEPS_AUX_DSTLIST[@]}]="${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_DST/}"
fi

echo "PYTORCH_ROCM_ARCH: ${PYTORCH_ROCM_ARCH}"

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
Expand Down

0 comments on commit 1a3174e

Please sign in to comment.