forked from ROCm/AMDMIGraphX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhip-clang.docker
More file actions
79 lines (66 loc) · 2.54 KB
/
Copy pathhip-clang.docker
File metadata and controls
79 lines (66 loc) · 2.54 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM ubuntu:24.04
ARG PREFIX=/usr/local
# ROCm release version (used in versioned package names, e.g. amdrocm-developer-tools7.13)
ARG ROCM_VERSION="10.0"
# GPU architecture family (e.g. gfx942, gfx120x); leave empty for arch-independent packages
ARG GPU_ARCH=""
# Install location for the prebuilt MIGraphX dependencies.
ARG PREFIX=/usr/local
# Install the MIGraphX build prerequisites (system packages + ROCm components).
# Set USE_WHL to any non-empty value to install ROCm from Python wheels instead
# of system packages (passes --whl to the prereqs script).
ARG USE_WHL=""
# pip index URL for the wheel-based ROCm install (only used when USE_WHL is set).
ARG INDEX_URL="https://stable.repo.amd.com/rocm/whl-next/"
# Support multiarch
RUN dpkg --add-architecture i386
# Install rocm key
RUN apt-get update && apt-get install -y software-properties-common gnupg2 --no-install-recommends curl && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://stable.repo.amd.com/rocm/gpg/packages.gpg | gpg --dearmor -o /etc/apt/keyrings/amdrocm.gpg
# Add rocm repository
RUN sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/keyrings/amdrocm.gpg] https://stable.repo.amd.com/rocm/core/packages/ubuntu2404 stable main > /etc/apt/sources.list.d/rocm.list'
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
apt-utils \
build-essential \
cmake \
gdb \
git \
lcov \
pkg-config \
python3 \
python3-dev \
python3-pip \
python3-full \
software-properties-common \
wget \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV PIP_BREAK_SYSTEM_PACKAGES=1
# Install dependencies
ADD dev-requirements.txt /dev-requirements.txt
ADD requirements.txt /requirements.txt
ADD rbuild.ini /rbuild.ini
COPY ./tools/install_prereqs.sh /
COPY ./tools/requirements-py.txt /requirements-py.txt
RUN ./install_prereqs.sh \
--rocm-version ${ROCM_VERSION} \
${GPU_ARCH:+--gpu ${GPU_ARCH}} \
--index-url ${INDEX_URL} \
${USE_WHL:+--whl}
RUN rm /install_prereqs.sh && rm /*.txt
RUN test -f /usr/local/hash || exit 1
# Workaround broken rocm packages
RUN echo "/opt/rocm/lib" > /etc/ld.so.conf.d/rocm.conf
RUN echo "/opt/rocm/llvm/lib" > /etc/ld.so.conf.d/rocm-llvm.conf
RUN ldconfig
# Manually remove rocm-cmake, since it shouldnt be installed in the first place
RUN rm -rf /opt/rocm/share/rocmcmakebuildtools
# Install yapf
RUN pipx install --global yapf==0.28.0
# Install clang format
RUN pipx install --global clang-format==22.1.5