forked from ROCm/MIOpen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
102 lines (85 loc) · 3.51 KB
/
Dockerfile
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM ubuntu:16.04
ARG PREFIX=/opt/rocm
# Support multiarch
RUN dpkg --add-architecture i386
# Add rocm repository
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl apt-utils wget
RUN curl https://raw.githubusercontent.com/RadeonOpenCompute/ROCm-docker/develop/add-rocm.sh | bash
# Install dependencies required to build hcc
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
apt-utils \
build-essential \
clang-3.8 \
clang-format-3.8 \
clang-tidy-3.8 \
cmake \
curl \
doxygen \
g++-mingw-w64 \
g++-mingw-w64-x86-64 \
g++-multilib \
git \
hsa-rocr-dev \
hsakmt-roct-dev \
libelf-dev \
libncurses5-dev \
libpthread-stubs0-dev \
libunwind-dev \
mingw-w64 \
mingw-w64-tools \
nsis \
python \
python-dev \
python-pip \
rocm-opencl \
rocm-opencl-dev \
software-properties-common \
wget \
wine \
xvfb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 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
# Install cget
RUN pip install cget
# Add the windows toolchain
ADD cmake/mingw-toolchain.cmake $PREFIX/x86_64-w64-mingw32/cmake/toolchain.cmake
RUN cget -p $PREFIX/x86_64-w64-mingw32 init -t $PREFIX/x86_64-w64-mingw32/cmake/toolchain.cmake
# Build hcc
RUN git clone --depth 1 https://github.com/RadeonOpenCompute/hcc.git -b roc-1.6.x /hcc && \
cd hcc && \
git submodule init && \
git submodule foreach --recursive 'git rev-parse HEAD | xargs -I {} git fetch --depth=1 origin {} && git reset --hard FETCH_HEAD' && \
git submodule update --recursive && \
git clone --depth 1 https://github.com/RadeonOpenCompute/clang-tools-extra.git -b roc-1.6.x clang/tools/extra && \
cget -p $PREFIX install hcc,. && cd .. && rm -rf /hcc
# This is a workaround for broken installations
RUN ln -s $PREFIX /opt/rocm/hip
RUN ln -s $PREFIX /opt/rocm/hcc
# Build using hcc
RUN cget -p $PREFIX init --cxx $PREFIX/bin/hcc
# Install hip
RUN cget -p $PREFIX install ROCm-Developer-Tools/HIP@660061c3b43ba704018ba5353746cedf7d6ec1a9
RUN cget -p $PREFIX install pfultz2/rocm-recipes
# Install dependencies
ADD dev-requirements.txt /dev-requirements.txt
RUN cget -p $PREFIX install -f /dev-requirements.txt
RUN cget -p $PREFIX install RadeonOpenCompute/clang-ocl@2f118b5b6b05f0b17467ef07a8bd3b8e5d8b3aac
# Install doc requirements
ADD doc/requirements.txt /doc-requirements.txt
RUN pip install -r /doc-requirements.txt
# Install windows opencl
RUN cget -p $PREFIX/x86_64-w64-mingw32/opencl init -t $PREFIX/x86_64-w64-mingw32/cmake/toolchain.cmake
RUN cget install -p $PREFIX/x86_64-w64-mingw32/opencl KhronosGroup/OpenCL-Headers@master -X header -DINCLUDE_DIR=opencl22
RUN cget install -p $PREFIX/x86_64-w64-mingw32/opencl pfultz2/OpenCL-ICD-Loader@master
# Install windows dependencies
RUN cget -p $PREFIX/x86_64-w64-mingw32 install pfultz2/rocm-recipes
RUN cget -p $PREFIX/x86_64-w64-mingw32 install -X header meganz/mingw-std-threads@dad05201ad4e096c5d1b2043081f412aeb8f5efb
RUN ln -s $PREFIX/x86_64-w64-mingw32/include/mingw.thread.h $PREFIX/x86_64-w64-mingw32/include/thread
RUN CXXFLAGS='-I $PREFIX/x86_64-w64-mingw32/include' AMDAPPSDKROOT=$PREFIX/x86_64-w64-mingw32/opencl cget -p $PREFIX/x86_64-w64-mingw32 install -f /dev-requirements.txt
# Setup wine
RUN mkdir -p /jenkins
RUN chmod 777 /jenkins
RUN WINEDEBUG=-all DISPLAY=:55.0 wineboot; wineserver -w