Dockerfile.mlu 2.3 KB
Newer Older
F
fwenguang 已提交
1
# A image for building paddle binaries
C
cifar10 已提交
2
# Update CNTOOLKIT_VERSION, CNNL_VERSION, CNCL_VERSION and MLUOPS_VERSION if using other versions
F
fwenguang 已提交
3 4
#
# Build:
C
cifar10 已提交
5 6 7 8
# - CNTOOLKIT_VERSION 3.0.2-1
# - CNNL_VERSION 1.13.0-1
# - CNCL_VERSION 1.2.1-1
# - MLUOPS_VERSION 0.2.0-1
F
fwenguang 已提交
9 10
#
# Download three packages from FTP (need to connect cambricon AE to get FTP url)
C
cifar10 已提交
11 12 13 14
# - cntoolkit_3.0.2-1.ubuntu18.04_amd64.deb
# - cnnl_1.13.0-1.ubuntu18.04_amd64.deb
# - cncl_1.2.1-1.ubuntu18.04_amd64.deb
# - mluops_0.2.0-1.ubuntu18.04_amd64.deb
F
fwenguang 已提交
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)
C
cifar10 已提交
24
# (get mluops pkg)
F
fwenguang 已提交
25 26
#
# docker build -f Dockerfile.mlu  \
C
cifar10 已提交
27 28 29 30
# --build-arg CNTOOLKIT_VERSION=3.0.2-1 \
# --build-arg CNNL_VERSION=1.13.0-1 \
# --build-arg CNCL_VERSION=1.2.1-1 \
# --build-arg MLUOPS_VERSION=0.2.0-1 \
F
fwenguang 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
# -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

C
cifar10 已提交
47 48 49 50
ARG CNTOOLKIT_VERSION=3.0.2-1
ARG CNNL_VERSION=1.13.0-1
ARG CNCL_VERSION=1.2.1-1
ARG MLUOPS_VERSION=0.2.0-1
F
fwenguang 已提交
51 52 53
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
C
cifar10 已提交
54
ARG MLUOPS_PKG=mluops_$MLUOPS_VERSION.ubuntu18.04_amd64.deb
F
fwenguang 已提交
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

# 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

C
cifar10 已提交
76 77 78 79 80
# install mluops
COPY $MLUOPS_PKG ./
RUN dpkg -i $MLUOPS_PKG && \
    rm -f $MLUOPS_PKG

F
fwenguang 已提交
81 82 83 84
# Clean
RUN apt-get clean -y

EXPOSE 22