-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
92 lines (66 loc) · 3.38 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
FROM rocm/rocm-terminal:1.3.0
MAINTAINER Wen-Heng (Jack) Chung <[email protected]>
# Update apt cache
RUN sudo apt-get update
# Install g++-4.8
RUN sudo apt-get -y install g++-4.8 g++-4.8-multilib gcc-4.8 lib32stdc++-4.8-dev libx32stdc++-4.8-dev lib32gcc-4.8-dev libx32gcc-4.8-dev lib32asan0 libx32asan0 cpp-4.8 libcloog-isl4
# Install misc dev packages
RUN sudo apt-get -y install unzip git cmake
# Install prerequisites for HIPBLAS from binary
RUN sudo apt-get -y install libblas-dev
# Install prerequisites for HICAFFE from binary
RUN sudo apt-get -y install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev libblas-dev libgflags-dev libgoogle-glog-dev liblmdb-dev libboost-all-dev
# Install prerequisites for HCC from binary
RUN sudo apt-get -y install libc++1 libc++-dev libc++abi1 libc++abi-dev elfutils
# Install wget
RUN sudo apt-get -y install wget
# Install vim and other goodies
RUN sudo apt-get -y install vim tig tmux
# Install ROCm-Device-Libs
RUN cd ~ && wget http://github.com/RadeonOpenCompute/hcc/releases/download/roc-1.4.0-rc3/rocm-device-libs-0.0.1401-Linux.deb && sudo dpkg -i ~/rocm-device-libs-0.0.1401-Linux.deb
# Install HCC
RUN cd ~ && wget http://github.com/RadeonOpenCompute/hcc/releases/download/roc-1.4.0-rc3/hcc_lc-1.0.16490-Linux.deb && sudo dpkg -i ~/hcc_lc-1.0.16490-Linux.deb
# Download OpenCL
RUN cd ~ && wget http://github.com/RadeonOpenCompute/hcc/releases/download/roc-1.4.0-rc3/OpenCL_Linux_x86_64_Release_1346668_artifacts.zip \
&& unzip ~/OpenCL_Linux_x86_64_Release_1346668_artifacts.zip
# Download HIP from source
RUN cd ~ && git clone -b sonoma-v1 https://github.com/whchung/HIP.git
# Build HIPBLAS from source and install it
RUN cd ~ && git clone -b sonoma-v1 https://bitbucket.org/multicoreware/hcblas.git
# Build HIPRNG from source and install it
RUN cd ~ && git clone -b sonoma-v1 https://github.com/whchung/hcrng.git
# Download patch for libc++
RUN cd ~ && git clone -b sonoma-v1 https://github.com/whchung/misc.git
# Patch libc++
RUN sudo cp ~/misc/string /usr/include/c++/v1/
# Build HIP
RUN cd ~/HIP && mkdir build && cd build \
&& cmake .. \
&& make -j$(nproc) \
&& sudo make install
# Build HIPBLAS
RUN cd ~/hcblas && sh ./build.sh \
&& sudo dpkg -i build/hcblas-master-*.deb
# Build HIPRNG
RUN cd ~/hcblas && sh ./build.sh \
&& sudo dpkg -i build/hcblas-master-*.deb
# Build MIOpen from source and install it
#RUN git clone -b sonoma-v1 https://github.com/whchung/MLOpen.git -C ~ \
# && cd ~/MLOpen && mkdir build && cd build \
# && cmake -DMLOPEN_BACKEND=HIP .. \
# && make -j$(nproc) \
# && sudo make install
# Build HIPCAFFE from source
#RUN git clone -b sonoma3 https://bitbucket.org/multicoreware/hipcaffe.git -C ~ \
# && sudo ln /dev/null /dev/raw1394 \
# && cd ~/hipcaffe \
# && make -j$(nproc)
# Get CIFAR10
#RUN cd ~/hipcaffe && ./data/cifar10/get_cifar10.sh && ./examples/cifar10/create_cifar10.sh
# Setup environment variables
#RUN export AOC_PATH=~/opencl/bin/x86_64/aoc2 && export LD_LIBRARY_PATH=~/opencl/lib/x86_64
# Run CIFAR10
# cd ~/hipcaffe && build/tools/caffe train --solver=examples/cifar10/cifar10_quick_solver.prototxt
# Run convent benchmark
# git clone https://github.com/soumith/convnet-benchmarks.git \
# && cd hipcaffe && build/tools/caffe time --model=../convnet-benchmarks/caffe/imagenet_winners/alexnet.prototxt --iterations 2 --gpu 0