-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (49 loc) · 2.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM ubuntu:20.04
ARG ROCM_VERSION=4.5.2
ARG AMDGPU_VERSION=21.40.2
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl gnupg && \
curl -sL http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \
sh -c 'echo deb [arch=amd64] https://repo.radeon.com/rocm/apt/$ROCM_VERSION/ ubuntu main > /etc/apt/sources.list.d/rocm.list' && \
sh -c 'echo deb [arch=amd64] https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/ubuntu focal main > /etc/apt/sources.list.d/amdgpu.list' && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
sudo \
libelf1 \
libnuma-dev \
build-essential \
git \
vim-nox \
cmake-curses-gui \
kmod \
file \
python3 \
python3-pip \
libjpeg-dev \
zlib1g-dev \
rocm-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
mkdir /pip_tmp && \
export TMPDIR=/pip_tmp && \
pip3 install --no-cache-dir virtualenv && \
pip3 install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm4.5.2 && \
unset TMPDIR && \
rm -rf /pip_tmp
# Grant members of 'sudo' group passwordless privileges
# Comment out to require sudo
COPY sudo-nopasswd /etc/sudoers.d/sudo-nopasswd
# This is meant to be used as an interactive developer container
# Create user rocm-user as member of sudo group
# Append /opt/rocm/bin to the system PATH variable
RUN useradd --create-home -G sudo,video --shell /bin/bash -u 1000 rocm-user
# sed --in-place=.rocm-backup 's|^\(PATH=.*\)"$|\1:/opt/rocm/bin"|' /etc/environment
USER rocm-user
WORKDIR /home/rocm-user
ENV PATH "${PATH}:/opt/rocm/bin"
# The following are optional enhancements for the command-line experience
# Uncomment the following to install a pre-configured vim environment based on http://vim.spf13.com/
# 1. Sets up an enhanced command line dev environment within VIM
# 2. Aliases GDB to enable TUI mode by default
#RUN curl -sL https://j.mp/spf13-vim3 | bash && \
# echo "alias gdb='gdb --tui'\n" >> ~/.bashrc
# Default to a login shell
CMD ["bash", "-l"]