|
#!/bin/bash |
|
|
|
export http_proxy="http://192.168.1.104:10809" |
|
export https_proxy="http://192.168.1.104:10809" |
|
export ALL_PROXY="socks5://192.168.1.104:10808" |
|
|
|
|
|
# |
|
# setup environment |
|
# |
|
export DEBIAN_FRONTEND=noninteractive |
|
export CUDA_HOME="/usr/local/cuda" |
|
export PATH="/usr/local/cuda/bin:${PATH}" |
|
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}" |
|
export LLVM_CONFIG="/usr/bin/llvm-config-9" |
|
export MAKEFLAGS=-j6 |
|
|
|
|
|
|
|
# |
|
# apt packages |
|
# |
|
apt-get update && \ |
|
apt-get install -y --no-install-recommends \ |
|
python3-pip \ |
|
python3-dev \ |
|
python3-matplotlib \ |
|
build-essential \ |
|
gfortran \ |
|
git \ |
|
cmake \ |
|
libopenblas-dev \ |
|
liblapack-dev \ |
|
libblas-dev \ |
|
libhdf5-serial-dev \ |
|
hdf5-tools \ |
|
libhdf5-dev \ |
|
zlib1g-dev \ |
|
zip \ |
|
libjpeg8-dev \ |
|
libopenmpi2 \ |
|
openmpi-bin \ |
|
openmpi-common \ |
|
nodejs \ |
|
npm \ |
|
protobuf-compiler \ |
|
libprotoc-dev \ |
|
llvm-9 \ |
|
llvm-9-dev \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
# |
|
# python packages from TF/PyTorch containers |
|
# |
|
|
|
|
|
# |
|
# python pip packages |
|
# |
|
pip3 install pybind11 --ignore-installed |
|
pip3 install onnx --verbose |
|
pip3 install scipy --verbose |
|
pip3 install scikit-learn --verbose |
|
pip3 install pandas --verbose |
|
pip3 install pycuda --verbose |
|
pip3 install numba --verbose |
|
|
|
|
|
# |
|
# restore missing cuDNN headers |
|
# |
|
#RUN ln -s /usr/include/aarch64-linux-gnu/cudnn_v8.h /usr/include/cudnn.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_version_v8.h /usr/include/cudnn_version.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_backend_v8.h /usr/include/cudnn_backend.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_adv_infer_v8.h /usr/include/cudnn_adv_infer.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_adv_train_v8.h /usr/include/cudnn_adv_train.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_cnn_infer_v8.h /usr/include/cudnn_cnn_infer.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_cnn_train_v8.h /usr/include/cudnn_cnn_train.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_ops_infer_v8.h /usr/include/cudnn_ops_infer.h && \ |
|
# ln -s /usr/include/aarch64-linux-gnu/cudnn_ops_train_v8.h /usr/include/cudnn_ops_train.h && \ |
|
# ls -ll /usr/include/cudnn* |
|
|
|
|
|
# |
|
# CuPy |
|
# |
|
export CUPY_NVCC_GENERATE_CODE="arch=compute_53,code=sm_53;arch=compute_62,code=sm_62;arch=compute_72,code=sm_72" |
|
export CUB_PATH="/opt/cub" |
|
#ARG CFLAGS="-I/opt/cub" |
|
#ARG LDFLAGS="-L/usr/lib/aarch64-linux-gnu" |
|
|
|
git clone https://github.com/NVlabs/cub "$CUB_PATH" && \ |
|
git clone -b v8.0.0b4 https://github.com/cupy/cupy cupy && \ |
|
cd cupy && \ |
|
pip3 install fastrlock && \ |
|
python3 setup.py install --verbose && \ |
|
cd ../ && \ |
|
rm -rf cupy |
|
|
|
#RUN pip3 install cupy --verbose |
|
|
|
|
|
# |
|
# JupyterLab |
|
# |
|
pip3 install jupyter jupyterlab --verbose |
|
#RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager@2 |
|
|
|
jupyter lab --generate-config |
|
python3 -c "from notebook.auth.security import set_password; set_password('nvidia', '/root/.jupyter/jupyter_notebook_config.json')" |
|
|
|
/bin/bash -c "jupyter lab --ip 0.0.0.0 --port 8888 --allow-root &> /var/log/jupyter.log" & \ |
|
echo "allow 10 sec for JupyterLab to start @ http://localhost:8888 (password nvidia)" && \ |
|
echo "JupterLab logging location: /var/log/jupyter.log (inside the container)" && \ |
|
/bin/bash |