"profiler/vscode:/vscode.git/clone" did not exist on "37a8c1f756f94e95b996fc3c26ff39fcf4e435c5"
Dockerfile 6.08 KB
Newer Older
1
FROM ubuntu:20.04
Illia Silin's avatar
Illia Silin committed
2
ARG DEBIAN_FRONTEND=noninteractive
3
ARG ROCMVERSION=6.2
4
ARG compiler_version=""
5
ARG compiler_commit=""
6
ARG CK_SCCACHE=""
JD's avatar
JD committed
7
8
9
10

RUN set -xe

ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/.apt_$ROCMVERSION/
Illia Silin's avatar
Illia Silin committed
11
RUN useradd -rm -d /home/jenkins -s /bin/bash -u 1004 jenkins
JD's avatar
JD committed
12
# Add rocm repository
Illia Silin's avatar
Illia Silin committed
13
RUN chmod 1777 /tmp
JD's avatar
JD committed
14
RUN apt-get update
Illia Silin's avatar
Illia Silin committed
15
RUN apt-get install -y --allow-unauthenticated apt-utils wget gnupg2 curl
16
17
18
19

ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
RUN curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/rocm-keyring.gpg

20
21
22
RUN if [ "$ROCMVERSION" != "6.3" ]; then \
        sh -c "wget https://repo.radeon.com/amdgpu-install/$ROCMVERSION/ubuntu/focal/amdgpu-install_6.2.60200-1_all.deb  --no-check-certificate" && \
        apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated ./amdgpu-install_6.2.60200-1_all.deb && \
23
24
25
26
        wget -qO - http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \
        sh -c "echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] $DEB_ROCM_REPO focal main > /etc/apt/sources.list.d/rocm.list" && \
        sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/amdgpu/$ROCMVERSION/ubuntu focal main > /etc/apt/sources.list.d/amdgpu.list'; \
    fi
Illia Silin's avatar
Illia Silin committed
27

28
RUN sh -c "echo deb http://mirrors.kernel.org/ubuntu focal main universe | tee -a /etc/apt/sources.list"
29
RUN amdgpu-install -y --usecase=rocm --no-dkms
JD's avatar
JD committed
30

31
## Sccache binary built from source for ROCm, only install if CK_SCCACHE is defined
32
33
34
ARG SCCACHE_REPO_URL=http://compute-artifactory.amd.com/artifactory/rocm-generic-experimental/rocm-sccache
ENV SCCACHE_INSTALL_LOCATION=/usr/local/.cargo/bin
ENV PATH=$PATH:${SCCACHE_INSTALL_LOCATION}
35
36
37
38
39
40
ENV CK_SCCACHE=$CK_SCCACHE
RUN if [ "$CK_SCCACHE" != "" ]; then \
        mkdir -p ${SCCACHE_INSTALL_LOCATION} && \
        curl ${SCCACHE_REPO_URL}/portable/0.2.16/sccache-0.2.16-alpha.1-rocm --output ${SCCACHE_INSTALL_LOCATION}/sccache && \
        chmod +x ${SCCACHE_INSTALL_LOCATION}/sccache; \
    fi
41

JD's avatar
JD committed
42
43
44
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
    build-essential \
45
    cmake \
JD's avatar
JD committed
46
47
    git \
    hip-rocclr \
48
    iputils-ping \
JD's avatar
JD committed
49
50
51
52
53
54
    jq \
    libelf-dev \
    libncurses5-dev \
    libnuma-dev \
    libpthread-stubs0-dev \
    llvm-amdgpu \
55
    net-tools \
JD's avatar
JD committed
56
    pkg-config \
57
    python \
58
    python3 \
JD's avatar
JD committed
59
60
    python3-dev \
    python3-pip \
61
    redis \
Illia Silin's avatar
Illia Silin committed
62
    sshpass \
63
    stunnel \
JD's avatar
JD committed
64
65
    software-properties-common \
    vim \
66
    nano \
JD's avatar
JD committed
67
    zlib1g-dev \
68
    zip \
JD's avatar
JD committed
69
    openssh-server \
70
    clang-format-12 \
JD's avatar
JD committed
71
    kmod && \
JD's avatar
JD committed
72
73
74
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

75
76
77
78
# hipTensor requires rocm-llvm-dev for rocm versions > 6.0.1
RUN if [ "$ROCMVERSION" = "6.1" ]; then \
        sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated rocm-llvm-dev"; \
    fi
79
80
81
# Update the cmake to version 3.27.5
RUN pip install --upgrade cmake==3.27.5

82
83
84
85
#Install latest ccache
RUN git clone https://github.com/ccache/ccache.git && \
    cd ccache && mkdir build && cd build && cmake .. && make install

Illia Silin's avatar
Illia Silin committed
86
#Install ninja build tracing tools
87
88
89
90
RUN wget -qO /usr/local/bin/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip
RUN gunzip /usr/local/bin/ninja.gz
RUN chmod a+x /usr/local/bin/ninja
RUN git clone https://github.com/nico/ninjatracing.git
91

Illia Silin's avatar
Illia Silin committed
92
93
94
95
96
#Install latest cppcheck
RUN git clone https://github.com/danmar/cppcheck.git && \
    cd cppcheck && mkdir build && cd build && cmake .. && cmake --build .
WORKDIR /

JD's avatar
JD committed
97
98
99
100
101
102
103
104
105
# Setup ubsan environment to printstacktrace
RUN ln -s /usr/bin/llvm-symbolizer-3.8 /usr/local/bin/llvm-symbolizer
ENV UBSAN_OPTIONS=print_stacktrace=1

# Install an init system
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb
RUN dpkg -i dumb-init_*.deb && rm dumb-init_*.deb

ARG PREFIX=/opt/rocm
106
107
# Install packages for processing the performance results
RUN pip3 install --upgrade pip
Illia Silin's avatar
Illia Silin committed
108
RUN pip3 install sqlalchemy==1.4.46
109
RUN pip3 install pymysql
110
RUN pip3 install pandas==2.0.3
111
RUN pip3 install setuptools-rust
112
RUN pip3 install sshtunnel==0.4.0
JD's avatar
JD committed
113
114
115
116
117
118
# Setup ubsan environment to printstacktrace
ENV UBSAN_OPTIONS=print_stacktrace=1

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN groupadd -f render
119
120

# Install the new rocm-cmake version
121
RUN git clone -b master https://github.com/ROCm/rocm-cmake.git  && \
122
123
  cd rocm-cmake && mkdir build && cd build && \
  cmake  .. && cmake --build . && cmake --build . --target install
124
125
126
127

WORKDIR /

ENV compiler_version=$compiler_version
128
ENV compiler_commit=$compiler_commit
129
RUN sh -c "echo compiler version = '$compiler_version'"
130
RUN sh -c "echo compiler commit = '$compiler_commit'"
131

132
RUN if ( [ "$compiler_version" = "amd-staging" ] || [ "$compiler_version" = "amd-mainline-open" ] ) && [ "$compiler_commit" = "" ]; then \
133
        git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
134
        cd llvm-project && mkdir build && cd build && \
135
        cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
136
137
138
139
        make -j 8 ; \
    else echo "using the release compiler"; \
    fi

140
RUN if ( [ "$compiler_version" = "amd-staging" ] || [ "$compiler_version" = "amd-mainline-open" ] ) && [ "$compiler_commit" != "" ]; then \
141
        git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
142
        cd llvm-project && git checkout "$compiler_commit" && echo "checking out commit $compiler_commit" && mkdir build && cd build && \
143
        cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
144
145
146
147
        make -j 8 ; \
    else echo "using the release compiler"; \
    fi

148
149
#clean-up the deb package
RUN sh -c "rm -rf amdgpu-install*"
150

151
152
#ENV HIP_CLANG_PATH='/llvm-project/build/bin'
#RUN sh -c "echo HIP_CLANG_PATH = '$HIP_CLANG_PATH'"