Skip to content

Commit 35d3345

Browse files
authored
#1994: remove unnecessary ROCm dependencies across Dockerfiles (#1995)
1 parent ff92e85 commit 35d3345

File tree

4 files changed

+146
-2
lines changed

4 files changed

+146
-2
lines changed

base-images/rocm/6.2/c9s-python-3.12/Dockerfile.rocm

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,25 @@ RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
3232
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
3333
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
3434
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
35-
dnf install -y rocm-developer-tools rocm-ml-sdk rocm-opencl-sdk rocm-openmp-sdk rocm-utils && \
35+
dnf install -y \
36+
rocm-core hip-runtime-amd \
37+
# system utilities
38+
rocm-smi-lib rocminfo \
39+
rocblas rocsolver rocfft rocrand rocsparse miopen-hip rccl \
40+
# HIP (Heterogeneous-compute Interface for Portability)
41+
hipblas hipblaslt hipfft hipsparse hiprand hipsolver \
42+
# suitesparse's /lib64/libspqr.so.2.0.9 needs libtbb.so.2
43+
tbb && \
3644
dnf clean all && rm -rf /var/cache/yum
3745

46+
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
47+
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
48+
/opt/rocm/lib
49+
/opt/rocm/lib64
50+
EOF
51+
52+
RUN ldconfig
53+
3854
# Restore user workspace
3955
USER 1001
4056
WORKDIR /opt/app-root/src

base-images/rocm/6.2/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,25 @@ RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
3232
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
3333
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
3434
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
35-
dnf install -y rocm-developer-tools rocm-ml-sdk rocm-opencl-sdk rocm-openmp-sdk rocm-utils && \
35+
dnf install -y \
36+
rocm-core hip-runtime-amd \
37+
# system utilities
38+
rocm-smi-lib rocminfo \
39+
rocblas rocsolver rocfft rocrand rocsparse miopen-hip rccl \
40+
# HIP (Heterogeneous-compute Interface for Portability)
41+
hipblas hipblaslt hipfft hipsparse hiprand hipsolver \
42+
# suitesparse's /lib64/libspqr.so.2.0.9 needs libtbb.so.2
43+
tbb && \
3644
dnf clean all && rm -rf /var/cache/yum
3745

46+
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
47+
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
48+
/opt/rocm/lib
49+
/opt/rocm/lib64
50+
EOF
51+
52+
RUN ldconfig
53+
3854
# Restore user workspace
3955
USER 1001
4056
WORKDIR /opt/app-root/src
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
####################
2+
# base #
3+
####################
4+
FROM quay.io/sclorg/python-312-c9s:c9s AS base
5+
6+
WORKDIR /opt/app-root/bin
7+
8+
########################
9+
# rocm-base #
10+
########################
11+
FROM base AS rocm-base
12+
13+
USER 0
14+
WORKDIR /opt/app-root/bin
15+
16+
# Please keep in sync with ROCm/python3.12 dependent images
17+
ARG ROCM_VERSION=6.4.3
18+
ARG AMDGPU_VERSION=6.4.3
19+
20+
# Install the ROCm rpms
21+
# ref: https://github.com/ROCm/ROCm-docker/blob/master/dev/Dockerfile-centos-7-complete
22+
# Note: Based on 6.4 above new package mivisionx is a pre-requistes, which bring in more dependent packages
23+
# so we are only installing meta packages of rocm
24+
# ref: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/reference/package-manager-integration.html#packages-in-rocm-programming-models
25+
RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
26+
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo && \
27+
echo "baseurl=https://repo.radeon.com/rocm/rhel9/$ROCM_VERSION/main" >> /etc/yum.repos.d/rocm.repo && \
28+
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo && \
29+
echo "gpgcheck=0" >> /etc/yum.repos.d/rocm.repo && \
30+
echo "[amdgpu]" > /etc/yum.repos.d/amdgpu.repo && \
31+
echo "name=amdgpu" >> /etc/yum.repos.d/amdgpu.repo && \
32+
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
33+
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
34+
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
35+
dnf install -y \
36+
rocm-core hip-runtime-amd \
37+
# system utilities
38+
rocm-smi-lib rocminfo \
39+
rocblas rocsolver rocfft rocrand rocsparse miopen-hip rccl \
40+
# HIP (Heterogeneous-compute Interface for Portability)
41+
hipblas hipblaslt hipfft hipsparse hiprand hipsolver \
42+
# suitesparse's /lib64/libspqr.so.2.0.9 needs libtbb.so.2
43+
tbb && \
44+
dnf clean all && rm -rf /var/cache/yum
45+
46+
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
47+
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
48+
/opt/rocm/lib
49+
/opt/rocm/lib64
50+
EOF
51+
52+
RUN ldconfig
53+
54+
# Restore user workspace
55+
USER 1001
56+
WORKDIR /opt/app-root/src
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
####################
2+
# base #
3+
####################
4+
FROM registry.access.redhat.com/ubi9/python-312:latest AS base
5+
6+
WORKDIR /opt/app-root/bin
7+
8+
########################
9+
# rocm-base #
10+
########################
11+
FROM base AS rocm-base
12+
13+
USER 0
14+
WORKDIR /opt/app-root/bin
15+
16+
# Please keep in sync with ROCm/python3.12 dependent images
17+
ARG ROCM_VERSION=6.4.3
18+
ARG AMDGPU_VERSION=6.4.3
19+
20+
# Install the ROCm rpms
21+
# ref: https://github.com/ROCm/ROCm-docker/blob/master/dev/Dockerfile-centos-7-complete
22+
# Note: Based on 6.4 above new package mivisionx is a pre-requistes, which bring in more dependent packages
23+
# so we are only installing meta packages of rocm
24+
# ref: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/reference/package-manager-integration.html#packages-in-rocm-programming-models
25+
RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
26+
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo && \
27+
echo "baseurl=https://repo.radeon.com/rocm/rhel9/$ROCM_VERSION/main" >> /etc/yum.repos.d/rocm.repo && \
28+
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo && \
29+
echo "gpgcheck=0" >> /etc/yum.repos.d/rocm.repo && \
30+
echo "[amdgpu]" > /etc/yum.repos.d/amdgpu.repo && \
31+
echo "name=amdgpu" >> /etc/yum.repos.d/amdgpu.repo && \
32+
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
33+
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
34+
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
35+
dnf install -y \
36+
rocm-core hip-runtime-amd \
37+
# system utilities
38+
rocm-smi-lib rocminfo \
39+
rocblas rocsolver rocfft rocrand rocsparse miopen-hip rccl \
40+
# HIP (Heterogeneous-compute Interface for Portability)
41+
hipblas hipblaslt hipfft hipsparse hiprand hipsolver \
42+
# suitesparse's /lib64/libspqr.so.2.0.9 needs libtbb.so.2
43+
tbb && \
44+
dnf clean all && rm -rf /var/cache/yum
45+
46+
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
47+
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
48+
/opt/rocm/lib
49+
/opt/rocm/lib64
50+
EOF
51+
52+
RUN ldconfig
53+
54+
# Restore user workspace
55+
USER 1001
56+
WORKDIR /opt/app-root/src

0 commit comments

Comments
 (0)