feat: basic

This commit is contained in:
2024-09-08 19:28:59 -07:00
parent 66d8631e9b
commit 74b9c38908
+46 -15
View File
@@ -1,23 +1,54 @@
FROM ubuntu:22.04 FROM ubuntu:22.04
ARG ROCM_VERSION="5.7.1" ARG ROCM_VERSION="5.7.1"
ARG ROCM_APT_CODE_NAME="jammy"
ARG ROCBLAS_BRANCH="release/rocm-rel-5.7" ARG ROCBLAS_BRANCH="release/rocm-rel-5.7"
ARG DEBIAN_FRONTEND="noninteractive" 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 # Install essentials
RUN sed -i -e 's/rmake.py --install/rmake.py -a="gfx803;gfx900" --install/g' install.sh RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends wget git ca-certificates curl gnupg sudo libelf1 libnuma-dev build-essential vim-nox cmake-curses-gui kmod file
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
RUN ./install.sh -d --cmake_install # Add ROCm apt repo
WORKDIR /root RUN <<EOF
mkdir --parents --mode=0755 /etc/apt/keyrings
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /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 <<EOF
apt-get update
apt-get install -y --no-install-recommends rocm-dev
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
# WORKDIR /root
# 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
# RUN ./install.sh -d --cmake_install
# WORKDIR /root
## need to fix broken version ## need to fix broken version
CMD [ "/bin/bash" ]
# Create non-root user
RUN <<EOF
echo "%sudo ALL=(ALL) NOPASSWD:ALL" > /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" ]