Dockerfile 3.11 KB
Newer Older
Paul's avatar
Paul committed
1
FROM ubuntu:xenial-20180417
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's avatar
Paul committed
9
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl apt-utils wget software-properties-common
Paul's avatar
Paul committed
10
RUN curl https://raw.githubusercontent.com/RadeonOpenCompute/ROCm-docker/master/add-rocm.sh | bash
Paul's avatar
Paul committed
11

Paul's avatar
Paul committed
12
13
14
# Add ubuntu toolchain
RUN apt-get update && add-apt-repository ppa:ubuntu-toolchain-r/test -y

Paul's avatar
Paul committed
15
16
17
18
19
20
21
22
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
    apt-utils \
    build-essential \
    clang-5.0 \
    clang-format-5.0 \
    clang-tidy-5.0 \
    cmake \
Paul's avatar
Paul committed
23
    comgr \
Paul's avatar
Paul committed
24
25
    curl \
    doxygen \
Paul's avatar
Paul committed
26
    g++-7 \
Paul's avatar
Paul committed
27
    gdb \
Paul's avatar
Paul committed
28
    git \
Paul's avatar
Paul committed
29
30
    hsa-rocr-dev \
    hsakmt-roct-dev \
Paul's avatar
Paul committed
31
    lcov \
Paul's avatar
Paul committed
32
    libelf-dev \
Paul Fultz II's avatar
Paul Fultz II committed
33
    libfile-which-perl \
Paul's avatar
Paul committed
34
    libncurses5-dev \
Paul's avatar
Paul committed
35
    libnuma-dev \
Paul's avatar
Paul committed
36
    libpthread-stubs0-dev \
Paul's avatar
Paul committed
37
    libssl-dev \
Paul Fultz II's avatar
Paul Fultz II committed
38
39
    locales \
    pkg-config \
kahmed10's avatar
kahmed10 committed
40
41
42
    python3 \
    python3-dev \
    python3-pip \
Paul's avatar
Paul committed
43
44
    python-pip \
    python-dev \
Paul's avatar
Paul committed
45
    rocm-device-libs \
Paul's avatar
Paul committed
46
47
48
    rocm-opencl \
    rocm-opencl-dev \
    software-properties-common \
Paul Fultz II's avatar
Paul Fultz II committed
49
    sudo \
Paul's avatar
Paul committed
50
51
    wget \
    zlib1g-dev && \
Paul's avatar
Paul committed
52
53
54
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

55
56
57
# Wokaround broken rocm packages for rocm >= 3.1 
RUN [ -d /opt/rocm ] || ln -sd $(realpath /opt/rocm-*) /opt/rocm

Paul Fultz II's avatar
Paul Fultz II committed
58
59
60
RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8

Paul's avatar
Paul committed
61
62
63
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

Paul's avatar
Paul committed
64
# Install cget
65
RUN pip3 install cget 
Paul's avatar
Paul committed
66

Paul's avatar
Paul committed
67
68
69
# Install rclone
RUN pip install https://github.com/pfultz2/rclone/archive/master.tar.gz

kahmed10's avatar
kahmed10 committed
70
# Install yapf
kahmed10's avatar
kahmed10 committed
71
RUN pip3 install yapf==0.28.0
kahmed10's avatar
kahmed10 committed
72

Paul's avatar
Paul committed
73
74
75
76
# Install doc requirements
ADD doc/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt

Paul's avatar
Paul committed
77
# Install hcc
Paul Fultz II's avatar
Paul Fultz II committed
78
RUN rclone -b roc-3.0.x -c 286651a04d9c3a8e3052dd84b1822985498cd27d https://github.com/RadeonOpenCompute/hcc.git /hcc
Paul's avatar
Paul committed
79
80
RUN cget -p $PREFIX install hcc,/hcc

Paul's avatar
Use hcc  
Paul committed
81
# Use hcc
Paul's avatar
Paul committed
82
RUN cget -p $PREFIX init --cxx $PREFIX/bin/hcc
Paul's avatar
Paul committed
83

Paul's avatar
Paul committed
84
85
86
# Workaround hip's broken cmake
RUN ln -s $PREFIX /opt/rocm/hip
RUN ln -s $PREFIX /opt/rocm/hcc
Paul's avatar
Paul committed
87
88

# Install dependencies
Paul's avatar
Use hcc  
Paul committed
89
ADD dev-requirements.txt /dev-requirements.txt
Paul's avatar
Paul committed
90
ADD requirements.txt /requirements.txt
Paul's avatar
Paul committed
91
RUN cget -p $PREFIX install -f /dev-requirements.txt -DMIOPEN_CACHE_DIR=""
Paul's avatar
Paul committed
92

93
94
RUN pip3 install onnx==1.7.0 numpy==1.18.5 typing==3.7.4 pytest==6.0.1

Paul Fultz II's avatar
Paul Fultz II committed
95
96
97
98
99
# 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
100
ARG ONNXRUNTIME_COMMIT=bfc888613f4e831d29c8b0bc17182ae061712553
Paul Fultz II's avatar
Paul Fultz II committed
101
102
103
104
105
106
107
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

108
109
110
ENV MIOPEN_FIND_DB_PATH=/tmp/miopen/find-db
ENV MIOPEN_USER_DB_PATH=/tmp/miopen/user-db

Paul's avatar
Paul committed
111
112
ENV LD_LIBRARY_PATH=$PREFIX/lib

Paul's avatar
Paul committed
113
114
115
# 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