forked from NVIDIA/gbm-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
132 lines (126 loc) · 3.66 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
ARG CUDA_VERSION
FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu18.04
SHELL ["/bin/bash", "-c"]
# Install conda (and use python 3.7)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
doxygen \
git \
graphviz \
libcurl4-openssl-dev \
libboost-all-dev \
make \
tar \
unzip \
wget \
zlib1g-dev && \
rm -rf /var/lib/apt/*
RUN curl -o /opt/miniconda.sh \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x /opt/miniconda.sh && \
/opt/miniconda.sh -b -p /opt/conda && \
/opt/conda/bin/conda update -n base conda && \
rm /opt/miniconda.sh
ENV PATH /opt/conda/bin:$PATH
RUN conda install -c conda-forge -c rapidsai -c nvidia -c defaults \
bokeh \
cmake>=3.14 \
h5py \
ipython \
ipywidgets \
jupyter \
kaggle \
matplotlib \
nose \
numpy \
pandas \
Pillow \
pydot \
pylint\
psutil\
scikit-learn \
scipy \
six \
dask \
distributed \
tqdm \
cudf=0.18.0 \
dask-cuda \
rmm \
librmm \
rapids-xgboost \
cuml=0.18 && \
conda clean -ya
# lightgbm
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
bzip2 \
ca-certificates \
curl \
git \
libblas-dev \
libboost-dev \
libboost-filesystem-dev \
libboost-system-dev \
libbz2-dev \
libc6 \
libglib2.0-0 \
liblapack-dev \
libsm6 \
libxext6 \
libxrender1 \
make \
tar \
unzip \
wget && \
rm -rf /var/lib/apt/*
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
ENV OPENCL_LIBRARIES /usr/local/cuda/lib64
ENV OPENCL_INCLUDE_DIR /usr/local/cuda/include
RUN git config --global http.sslVerify false && \
git clone --recursive https://github.com/Microsoft/LightGBM /opt/LightGBM && \
cd /opt/LightGBM && \
mkdir build && \
cd build && \
cmake .. \
-DUSE_GPU=1 \
-DOpenCL_LIBRARY=$OPENCL_LIBRARIES/libOpenCL.so \
-DOpenCL_INCLUDE_DIR=$OPENCL_INCLUDE_DIR && \
make OPENCL_HEADERS="/usr/local/cuda/targets/x86_64-linux/include" \
LIBOPENCL="/usr/local/cuda/targets/x86_64-linux/lib" -j4 && \
cd ../python-package && \
python setup.py install --precompile
# catboost
RUN if [ "`echo $CUDA_VERSION | sed -e 's/[.].*//'`" -lt "11" ]; then git config --global http.sslVerify false && \
git clone --recursive "https://github.com/catboost/catboost" /opt/catboost && \
cd /opt/catboost && \
cd catboost/python-package/catboost && \
../../../ya make \
-r \
-o ../../.. \
-DUSE_ARCADIA_PYTHON=no \
-DUSE_SYSTEM_PYTHON=3.7\
-DPYTHON_CONFIG=python3-config \
-DCUDA_ROOT=$(dirname $(dirname $(which nvcc))); \
fi
ENV if [ "`echo $CUDA_VERSION | sed -e 's/[.].*//'`" -lt "11" ]; then PYTHONPATH=$PYTHONPATH:/opt/catboost/catboost/python-package; fi
# xgboost
RUN git config --global http.sslVerify false && \
git clone --recursive https://github.com/dmlc/xgboost /opt/xgboost && \
cd /opt/xgboost && \
mkdir build && \
cd build && \
RMM_ROOT=/opt/conda cmake .. \
-DUSE_CUDA=ON \
-DUSE_NCCL=ON \
-DPLUGIN_RMM=ON && \
make -j4 && \
cd ../python-package && \
pip uninstall -y xgboost && \
python setup.py install