"tools/dataset_converters/update_infos_to_v2.py" did not exist on "583c4accbbf8e37b15638820b7b781f4475c6bde"
Dockerfile 3.62 KB
Newer Older
1
FROM ubuntu:20.04
Paul's avatar
Paul committed
2

Paul's avatar
Paul committed
3
ARG PREFIX=/usr/local
Paul's avatar
Paul committed
4
5
6
7

# Support multiarch
RUN dpkg --add-architecture i386

8
9
# Install rocm key
RUN apt-get update && apt-get install -y gnupg2 --no-install-recommends curl && \
10
    curl -sL http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add -
11

Paul's avatar
Paul committed
12
# Add rocm repository
13
RUN sh -c 'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/5.6/ focal main > /etc/apt/sources.list.d/rocm.list'
Paul's avatar
Paul committed
14

15
16
17
# From docs.amd.com for installing rocm. Needed to install properly
RUN sh -c "echo 'Package: *\nPin: release o=repo.radeon.com\nPin-priority: 600' > /etc/apt/preferences.d/rocm-pin-600"

Paul's avatar
Paul committed
18
19
20
21
22
23
24
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
    apt-utils \
    build-essential \
    cmake \
    curl \
    doxygen \
Paul's avatar
Paul committed
25
    g++-7 \
Paul's avatar
Paul committed
26
    gdb \
Paul's avatar
Paul committed
27
28
    git \
    lcov \
Paul Fultz II's avatar
Paul Fultz II committed
29
30
    locales \
    pkg-config \
kahmed10's avatar
kahmed10 committed
31
32
33
    python3 \
    python3-dev \
    python3-pip \
Paul's avatar
Paul committed
34
    software-properties-common \
Paul's avatar
Paul committed
35
    wget \
Paul Fultz II's avatar
Paul Fultz II committed
36
    rocm-device-libs \
37
38
    hip-base \
    libnuma-dev \
Paul Fultz II's avatar
Paul Fultz II committed
39
40
    miopen-hip \
    rocblas \
41
42
43
44
45
46
47
48
49
50
51
52
53
54
    hipfft \
    rocthrust \
    rocrand \
    hipsparse \
    rccl \
    rccl-dev \
    rocm-smi-lib \
    rocm-dev \
    roctracer-dev \
    hipcub  \
    hipblas  \
    hipify-clang \
    half \
    libssl-dev \
Paul's avatar
Paul committed
55
    zlib1g-dev && \
Paul's avatar
Paul committed
56
57
58
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

59

60
# add this for roctracer dependancies
61
RUN pip3 install CppHeaderParser
62

Paul Fultz II's avatar
Paul Fultz II committed
63
64
65
66
67
# Workaround broken rocm packages
RUN ln -s /opt/rocm-* /opt/rocm
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
68

Paul Fultz II's avatar
Paul Fultz II committed
69
70
71
RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8

Paul's avatar
Paul committed
72
73
74
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

Shucai Xiao's avatar
Shucai Xiao committed
75
76
77
# Install dependencies
ADD dev-requirements.txt /dev-requirements.txt
ADD requirements.txt /requirements.txt
78
ADD rbuild.ini /rbuild.ini
Shucai Xiao's avatar
Shucai Xiao committed
79
80
81

COPY ./tools/install_prereqs.sh /
RUN /install_prereqs.sh /usr/local / && rm /install_prereqs.sh
82
RUN test -f /usr/local/hash || exit 1
Paul's avatar
Paul committed
83

kahmed10's avatar
kahmed10 committed
84
# Install yapf
kahmed10's avatar
kahmed10 committed
85
RUN pip3 install yapf==0.28.0
kahmed10's avatar
kahmed10 committed
86

Paul's avatar
Paul committed
87
# Install doc requirements
Chris Austen's avatar
Chris Austen committed
88
ADD docs/.sphinx/requirements.txt /doc-requirements.txt
Paul's avatar
Paul committed
89
90
RUN pip3 install -r /doc-requirements.txt

91
# Download real models to run onnx unit tests
92
ENV ONNX_HOME=/.onnx
93
COPY ./tools/download_models.sh /
Shucai Xiao's avatar
Shucai Xiao committed
94
RUN /download_models.sh && rm /download_models.sh
95

Paul Fultz II's avatar
Paul Fultz II committed
96
97
# Install latest ccache version
RUN cget -p $PREFIX install facebook/zstd@v1.4.5 -X subdir -DCMAKE_DIR=build/cmake
98
RUN cget -p $PREFIX install ccache@v4.1 -DENABLE_TESTING=OFF
99
100
RUN cget -p /opt/cmake install kitware/cmake@v3.26.4

Paul Fultz II's avatar
Paul Fultz II committed
101

102
COPY ./test/onnx/.onnxrt-commit /
Paul Fultz II's avatar
Paul Fultz II committed
103
104

ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
105
ARG ONNXRUNTIME_BRANCH=main
106
ARG ONNXRUNTIME_COMMIT
107

Paul Fultz II's avatar
Paul Fultz II committed
108
109
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
    cd onnxruntime && \
110
111
    if [ -z "$ONNXRUNTIME_COMMIT" ] ; then git checkout $(cat /.onnxrt-commit) ; else git checkout ${ONNXRUNTIME_COMMIT} ; fi && \
    /bin/sh /onnxruntime/dockerfiles/scripts/install_common_deps.sh
112
113


Paul Fultz II's avatar
Paul Fultz II committed
114
115
ADD tools/build_and_test_onnxrt.sh /onnxruntime/build_and_test_onnxrt.sh

116
117
# Use the /opt/cmake install because LLVM/MLIR need cmake >= 3.20
RUN env PATH=/opt/cmake/bin:$PATH cget -p /usr/local install ROCmSoftwarePlatform/rocMLIR@1ad9d6df32acc6d29d58e8ed6710e36746d0a4d6 -DBUILD_FAT_LIBROCKCOMPILER=On
118

119
120
ENV MIOPEN_FIND_DB_PATH=/tmp/miopen/find-db
ENV MIOPEN_USER_DB_PATH=/tmp/miopen/user-db
Paul's avatar
Paul committed
121
122
ENV LD_LIBRARY_PATH=$PREFIX/lib

Paul's avatar
Paul committed
123
124
125
# Setup ubsan environment to printstacktrace
ENV UBSAN_OPTIONS=print_stacktrace=1
ENV ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
Paul Fultz II's avatar
Paul Fultz II committed
126
RUN ln -s /opt/rocm/llvm/bin/llvm-symbolizer /usr/bin/llvm-symbolizer