Skip to content

Commit 17ed9dd

Browse files
authored
Fix the rocm installation (ROCm#172)
[ROCm/rocprofiler-systems commit: f03dce5]
1 parent bb4ed0b commit 17ed9dd

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

projects/rocprofiler-systems/docker/Dockerfile.opensuse

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ RUN zypper --non-interactive update -y && \
2828
python3 -m pip install 'cmake==3.21'
2929

3030
ARG ROCM_VERSION=0.0
31-
ARG AMDGPU_RPM=6.2/sle/15.6/amdgpu-install-6.2.60200-1.noarch.rpm
3231

3332
RUN if [ "${ROCM_VERSION}" != "0.0" ]; then \
34-
OS_VERSION_MINOR=$(cat /etc/os-release | grep 'VERSION_ID' | sed 's/=/ /1' | awk '{print $NF}' | sed 's/"//g' | sed 's/\./ /g' | awk '{print $2}') && \
35-
zypper --non-interactive addrepo https://download.opensuse.org/repositories/devel:languages:perl/15.${OS_VERSION_MINOR}/devel:languages:perl.repo && \
36-
zypper --non-interactive --no-gpg-checks install -y https://repo.radeon.com/amdgpu-install/${AMDGPU_RPM} && \
33+
OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"') && \
34+
OS_VERSION_MAJOR=$(echo "$OS_VERSION" | cut -d'.' -f1) && \
35+
OS_VERSION_MINOR=$(echo "$OS_VERSION" | cut -d'.' -f2) && \
36+
ROCM_MAJOR=$(echo "${ROCM_VERSION}" | sed 's/\./ /g' | awk '{print $1}') && \
37+
ROCM_MINOR=$(echo "${ROCM_VERSION}" | sed 's/\./ /g' | awk '{print $2}') && \
38+
ROCM_VERSN=$(( ("${ROCM_MAJOR}"*10000)+("${ROCM_MINOR}"*100) )) && \
39+
zypper --non-interactive addrepo https://download.opensuse.org/repositories/devel:languages:perl/15.6/devel:languages:perl.repo && \
40+
zypper --non-interactive --no-gpg-checks install -y https://repo.radeon.com/amdgpu-install/${ROCM_VERSION}/sle/${OS_VERSION}/amdgpu-install-${ROCM_MAJOR}.${ROCM_MINOR}.${ROCM_VERSN}-1.noarch.rpm && \
3741
zypper --non-interactive --gpg-auto-import-keys refresh && \
3842
zypper --non-interactive install -y rocm-dev rccl-devel libpciaccess0 && \
3943
zypper --non-interactive clean --all; \

projects/rocprofiler-systems/docker/Dockerfile.rhel

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ RUN yum groupinstall -y "Development Tools" && \
2222
python3 -m pip install 'perfetto'
2323

2424
ARG ROCM_VERSION=0.0
25-
ARG AMDGPU_RPM=6.2/rhel/9.4/amdgpu-install-6.2.60202-1.el9.noarch.rpm
2625

2726
RUN if [ "${ROCM_VERSION}" != "0.0" ]; then \
28-
OS_VERSION_MAJOR=$(cat /etc/os-release | grep 'VERSION_ID' | sed 's/=/ /1' | awk '{print $NF}' | sed 's/"//g' | sed 's/\./ /g' | awk '{print $1}') && \
27+
OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"') && \
28+
OS_VERSION_MAJOR=$(echo "$OS_VERSION" | cut -d'.' -f1) && \
29+
RPM_TAG=".el${OS_VERSION_MAJOR}" && \
30+
ROCM_MAJOR=$(echo "${ROCM_VERSION}" | sed 's/\./ /g' | awk '{print $1}') && \
31+
ROCM_MINOR=$(echo "${ROCM_VERSION}" | sed 's/\./ /g' | awk '{print $2}') && \
32+
ROCM_VERSN=$(( ("${ROCM_MAJOR}"*10000)+("${ROCM_MINOR}"*100) )) && \
2933
if [ "${OS_VERSION_MAJOR}" -eq 8 ]; then PERL_REPO=powertools; else PERL_REPO=crb; fi && \
3034
dnf -y --enablerepo=${PERL_REPO} install perl-File-BaseDir && \
31-
yum install -y https://repo.radeon.com/amdgpu-install/${AMDGPU_RPM} && \
35+
yum install -y https://repo.radeon.com/amdgpu-install/${ROCM_VERSION}/rhel/${OS_VERSION}/amdgpu-install-${ROCM_MAJOR}.${ROCM_MINOR}.${ROCM_VERSN}-1${RPM_TAG}.noarch.rpm && \
3236
yum install -y rocm-dev && \
3337
yum clean all; \
3438
fi

0 commit comments

Comments
 (0)