Dockerfile.mlu 2.0 KB
Newer Older
F
fwenguang 已提交
1 2 3 4
# A image for building paddle binaries
# Update CNTOOLKIT_VERSION, CNNL_VERSION and CNCL_VERSION if using other versions
#
# Build:
5 6 7
# - CNTOOLKIT_VERSION 3.0.0-1
# - CNNL_VERSION 1.11.0-1
# - CNCL_VERSION 1.2.0-1
F
fwenguang 已提交
8 9
#
# Download three packages from FTP (need to connect cambricon AE to get FTP url)
10 11 12
# - cntoolkit_3.0.0-1.ubuntu18.04_amd64.deb
# - cnnl_1.11.0-1.ubuntu18.04_amd64.deb
# - cncl_1.2.0-1.ubuntu18.04_amd64.deb
F
fwenguang 已提交
13 14 15 16 17 18 19 20 21 22 23
# copy them to current directory first, then run build commands
#
# For example:
#
# cd Paddle/tools/dockerfile
#
# (get cntoolkit pkg)
# (get cnnl pkg)
# (get cncl pkg)
#
# docker build -f Dockerfile.mlu  \
24 25 26
# --build-arg CNTOOLKIT_VERSION=3.0.0-1 \
# --build-arg CNNL_VERSION=1.11.0-1 \
# --build-arg CNCL_VERSION=1.2.0-1 \
F
fwenguang 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
# -t paddlepaddle/paddle:latest-dev-mlu .
#
# without mlu device:
# docker run -it --network=host --pids-limit 409600 \
# paddlepaddle/paddle:latest-dev-mlu /bin/bash
#
# with mlu device:
# docker run -it --network=host --pids-limit 409600 \
# --device=/dev/cambricon_ctl --device=/dev/cambricon_dev0 \
# paddlepaddle/paddle:latest-dev-mlu /bin/bash

FROM registry.baidubce.com/paddlepaddle/paddle:latest-dev
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>

ENV WITH_GPU=OFF

43 44 45
ARG CNTOOLKIT_VERSION=3.0.0-1
ARG CNNL_VERSION=1.11.0-1
ARG CNCL_VERSION=1.2.0-1
F
fwenguang 已提交
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
ARG CNTOOLKIT_PKG=cntoolkit_$CNTOOLKIT_VERSION.ubuntu18.04_amd64.deb
ARG CNNL_PKG=cnnl_$CNNL_VERSION.ubuntu18.04_amd64.deb
ARG CNCL_PKG=cncl_$CNCL_VERSION.ubuntu18.04_amd64.deb

# install cntoolkit
COPY $CNTOOLKIT_PKG ./
RUN dpkg -i $CNTOOLKIT_PKG && \
    apt-get update && \
    apt-get install -y cnrt cnperf cnpapi cnlicense cngdb cndrv cndev cncodec cncc cnas cnbin cnstudio cnrtc cnpx && \
    rm -f $CNTOOLKIT_PKG

ENV NEUWARE_HOME=/usr/local/neuware
ENV LD_LIBRARY_PATH=$NEUWARE_HOME/lib64:$LD_LIBRARY_PATH

# install cnnl
COPY $CNNL_PKG ./
RUN dpkg -i $CNNL_PKG && \
    rm -f $CNNL_PKG

# install cncl
COPY $CNCL_PKG ./
RUN dpkg -i $CNCL_PKG && \
    rm -f $CNCL_PKG

# Clean
RUN apt-get clean -y

EXPOSE 22