Skip to content

Commit dc83de0

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents c736166 + 72a6741 commit dc83de0

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
@@ -161,4 +161,9 @@ USER 1001
161161

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

164+
USER 0
165+
COPY ${TENSORFLOW_SOURCE_CODE}/utils/link-solibs.sh /tmp/link-solibs.sh
166+
RUN /tmp/link-solibs.sh && rm /tmp/link-solibs.sh
167+
USER 1001
168+
164169
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)