diff --git a/base.dockerfile b/base.dockerfile index 4893ba4..854d047 100644 --- a/base.dockerfile +++ b/base.dockerfile @@ -1,23 +1,54 @@ FROM ubuntu:22.04 ARG ROCM_VERSION="5.7.1" +ARG ROCM_APT_CODE_NAME="jammy" ARG ROCBLAS_BRANCH="release/rocm-rel-5.7" ARG DEBIAN_FRONTEND="noninteractive" -RUN apt-get update \ -&& apt-get install -y wget git \ -&& rm -rf /var/lib/apt/lists/* -WORKDIR /root -RUN wget -O amdgpu-install.deb https://repo.radeon.com/amdgpu-install/${ROCM_VERSION}/ubuntu/jammy/amdgpu-install_5.7.50701-1_all.deb -RUN dpkg -i amdgpu-install.deb -RUN amdgpu-install -y --no-dkms --usecase=rocm -RUN git clone -b ${ROCBLAS_BRANCH} https://github.com/ROCmSoftwarePlatform/rocBLAS.git -WORKDIR /root/rocBLAS -RUN rm -rf library/src/blas3/Tensile/Logic/asm_full/r9nano/ -# gfx803 as single target will cause error -RUN sed -i -e 's/rmake.py --install/rmake.py -a="gfx803;gfx900" --install/g' install.sh +# Install essentials +RUN < /dev/null +bash -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${ROCM_VERSION} ${ROCM_APT_CODE_NAME} main" > "/etc/apt/sources.list.d/rocm.list"' +bash -c 'echo -e "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600" | tee /etc/apt/preferences.d/rocm-pin-600' +EOF + +# Install ROCm +RUN < /etc/sudoers.d/sudo-nopasswd +useradd --create-home -G sudo,video --shell /bin/bash rocm +EOF +USER rocm +WORKDIR /home/rocm +ENV PATH="${PATH}:/opt/rocm/bin" + +# Default to login shell +CMD [ "bash", "-l" ]