Skip to content

Commit 72a6741

Browse files
authored
RHAIENG-1602: fix(Dockerfile.rocm): create *.so symbolic links for ROCm 6.3.4 TensorFlow compatibility (opendatahub-io#2611)
1 parent a615068 commit 72a6741

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

jupyter/rocm/tensorflow/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,9 @@ RUN echo "Installing softwares and packages" && \
158158

159159
COPY ${JUPYTER_REUSABLE_UTILS}/usercustomize.pth ${JUPYTER_REUSABLE_UTILS}/monkey_patch_protobuf_6x.py /opt/app-root/lib/python3.12/site-packages/
160160

161+
USER 0
162+
COPY ${TENSORFLOW_SOURCE_CODE}/utils/link-solibs.sh /tmp/link-solibs.sh
163+
RUN /tmp/link-solibs.sh && rm /tmp/link-solibs.sh
164+
USER 1001
165+
161166
WORKDIR /opt/app-root/src
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -Eeuo pipefail
3+
4+
# TensorFlow-ROCm wants to link with `*.so` libraries without version suffixes.
5+
# This would require us to install the -devel packages, but that's cumbersome with AIPCC bases.
6+
# Therefore, simply create symlinks to the versioned libraries and (IMPORTANT!) run ldconfig afterwards.
7+
8+
ROCM_PATH=/opt/rocm-6.3.4
9+
find "$ROCM_PATH/lib" -name '*.so.*' -type f -print0 |
10+
while IFS= read -r -d '' f; do
11+
dir=${f%/*} # /opt/rocm-6.3.4/lib (or sub-dir)
12+
bn=${f##*/} # libMIOpen.so.1.0.60304
13+
base=${bn%%.so*} # libMIOpen
14+
soname=$base.so # libMIOpen.so
15+
link=$dir/$soname # /opt/rocm-6.3.4/lib/libMIOpen.so
16+
[[ -e $link ]] && continue
17+
echo "ln -s $bn$link"
18+
ln -s "$bn" "$link"
19+
done
20+
21+
# Run ldconfig to update the cache.
22+
ldconfig

0 commit comments

Comments
 (0)