Dockerfile 3.1 KB
Newer Older
1
FROM ubuntu:18.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
8

# Support multiarch
RUN dpkg --add-architecture i386

# Add rocm repository
Paul Fultz II's avatar
Paul Fultz II committed
9
RUN sh -c 'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/.apt_3.7/ xenial main > /etc/apt/sources.list.d/rocm.list'
Paul's avatar
Paul committed
10

Paul's avatar
Paul committed
11
12
13
14
15
16
17
18
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
    apt-utils \
    build-essential \
    clang-format-5.0 \
    cmake \
    curl \
    doxygen \
19
    g++-5 \
Paul's avatar
Paul committed
20
    g++-7 \
Paul's avatar
Paul committed
21
    gdb \
Paul's avatar
Paul committed
22
23
    git \
    lcov \
Paul Fultz II's avatar
Paul Fultz II committed
24
25
    locales \
    pkg-config \
Paul Fultz II's avatar
Paul Fultz II committed
26
27
28
    python \
    python-dev \
    python-pip \
kahmed10's avatar
kahmed10 committed
29
30
31
    python3 \
    python3-dev \
    python3-pip \
Paul's avatar
Paul committed
32
    software-properties-common \
Paul's avatar
Paul committed
33
    wget \
Paul Fultz II's avatar
Paul Fultz II committed
34
35
36
    rocm-device-libs \
    miopen-hip \
    rocblas \
Paul's avatar
Paul committed
37
    zlib1g-dev && \
Paul's avatar
Paul committed
38
39
40
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

Paul Fultz II's avatar
Paul Fultz II committed
41
42
43
44
45
# 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
46

Paul Fultz II's avatar
Paul Fultz II committed
47
48
49
RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8

Paul's avatar
Paul committed
50
51
52
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

Paul Fultz II's avatar
Paul Fultz II committed
53
54
# Install rbuild
RUN pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
Paul's avatar
Paul committed
55

kahmed10's avatar
kahmed10 committed
56
# Install yapf
kahmed10's avatar
kahmed10 committed
57
RUN pip3 install yapf==0.28.0
kahmed10's avatar
kahmed10 committed
58

Paul's avatar
Paul committed
59
60
61
62
# Install doc requirements
ADD doc/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt

63
64
RUN pip3 install onnx==1.7.0 numpy==1.18.5 typing==3.7.4 pytest==6.0.1

65
66
67
68
69
# Download real models to run onnx unit tests
ENV ONNX_HOME=$HOME
COPY ./tools/download_models.sh /
RUN chmod +x /download_models.sh && /download_models.sh && rm /download_models.sh

Paul Fultz II's avatar
Paul Fultz II committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Install dependencies
ADD dev-requirements.txt /dev-requirements.txt
ADD requirements.txt /requirements.txt
# Manually ignore rocm dependencies
RUN cget -p $PREFIX ignore \
    RadeonOpenCompute/clang-ocl \
    ROCm-Developer-Tools/HIP \
    ROCmSoftwarePlatform/MIOpen \
    ROCmSoftwarePlatform/MIOpenGEMM \
    ROCmSoftwarePlatform/rocBLAS
RUN cget -p $PREFIX init --cxx /opt/rocm/llvm/bin/clang++
RUN cget -p $PREFIX install -f dev-requirements.txt
RUN cget -p $PREFIX install oneapi-src/oneDNN@v1.7

# Install latest ccache version
RUN cget -p $PREFIX install facebook/zstd@v1.4.5 -X subdir -DCMAKE_DIR=build/cmake
RUN cget -p $PREFIX install ccache@v4.1

Paul Fultz II's avatar
Paul Fultz II committed
88
89
90
91
92
# Install newer cmake for onnx runtime
RUN cget -p /opt/cmake install kitware/cmake@v3.13.0

ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG ONNXRUNTIME_BRANCH=master
93
ARG ONNXRUNTIME_COMMIT=24f1bd6156cf5968bbc76dfb0e801a9b9c56b9fc
Paul Fultz II's avatar
Paul Fultz II committed
94
95
96
97
98
99
100
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
    cd onnxruntime && \
    git checkout ${ONNXRUNTIME_COMMIT} && \
    /bin/sh dockerfiles/scripts/install_common_deps.sh

ADD tools/build_and_test_onnxrt.sh /onnxruntime/build_and_test_onnxrt.sh

101
102
103
ENV MIOPEN_FIND_DB_PATH=/tmp/miopen/find-db
ENV MIOPEN_USER_DB_PATH=/tmp/miopen/user-db

Paul's avatar
Paul committed
104
105
ENV LD_LIBRARY_PATH=$PREFIX/lib

Paul's avatar
Paul committed
106
107
108
# 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