|
7 | 7 | RUN groupadd -g 1000 HwHiAiUser && \
|
8 | 8 | useradd -u 1000 -g 1000 -m -d /home/HwHiAiUser HwHiAiUser
|
9 | 9 |
|
10 |
| -# copy /etc/ascend_install.info to current dir fist |
11 |
| -COPY ascend_install.info /etc/ascend_install.info |
12 |
| - |
13 |
| -# copy /usr/local/Ascend/driver/version.info to current dir fist |
14 | 10 | RUN mkdir -p /usr/local/Ascend/driver
|
15 |
| -COPY version.info /usr/local/Ascend/driver/version.info |
16 |
| - |
17 |
| -# Download packages from https://www.hiascend.com/software/cann/community |
18 | 11 | WORKDIR /usr/local/Ascend
|
19 | 12 | ARG CANN_VERSION
|
| 13 | +ARG SYSTEM |
20 | 14 |
|
21 | 15 | # install CANN requirement
|
22 | 16 | # https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/700alpha003/softwareinstall/instg/instg_0026.html
|
23 | 17 | RUN apt-get update -y && apt-get install -y zlib1g zlib1g-dev libsqlite3-dev openssl libssl-dev libffi-dev libbz2-dev \
|
24 | 18 | libxslt1-dev unzip pciutils net-tools libblas-dev gfortran libblas3 liblapack-dev liblapack3 libopenblas-dev
|
25 | 19 |
|
26 |
| -# install CANN requirement |
27 |
| -# https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/700alpha003/softwareinstall/instg/instg_0026.html |
28 |
| -RUN pip install --upgrade pip setuptools wheel |
29 |
| -RUN pip install 'numpy>=1.19.2' 'decorator>=4.4.0' 'sympy>=1.5.1' 'cffi>=1.12.3' 'protobuf>=3.13.0' |
30 |
| -RUN pip install attrs pyyaml pathlib2 scipy requests psutil absl-py |
| 20 | +RUN pip3.8 install --upgrade pip setuptools wheel && \ |
| 21 | + pip3.9 install --upgrade pip setuptools wheel && \ |
| 22 | + pip3.10 install --upgrade pip setuptools wheel |
| 23 | + |
| 24 | +RUN pip3.8 install 'numpy>=1.19.2' 'decorator>=4.4.0' 'sympy>=1.5.1' 'cffi>=1.12.3' 'protobuf>=3.13.0' && \ |
| 25 | + pip3.9 install 'numpy>=1.19.2' 'decorator>=4.4.0' 'sympy>=1.5.1' 'cffi>=1.12.3' 'protobuf>=3.13.0' && \ |
| 26 | + pip3.10 install 'numpy>=1.19.2' 'decorator>=4.4.0' 'sympy>=1.5.1' 'cffi>=1.12.3' 'protobuf>=3.13.0' |
| 27 | + |
| 28 | +RUN pip3.8 install attrs pyyaml pathlib2 scipy requests psutil absl-py && \ |
| 29 | + pip3.9 install attrs pyyaml pathlib2 scipy requests psutil absl-py && \ |
| 30 | + pip3.10 install attrs pyyaml pathlib2 scipy requests psutil absl-py |
31 | 31 |
|
32 | 32 | # update envs for driver
|
33 | 33 | ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64:$LD_LIBRARY_PATH
|
34 | 34 | ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64/common:$LD_LIBRARY_PATH
|
35 | 35 | ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64/driver:$LD_LIBRARY_PATH
|
36 | 36 |
|
37 | 37 | # Install Ascend toolkit
|
38 |
| -COPY Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run /usr/local/Ascend/ |
39 |
| -RUN chmod +x Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run && \ |
| 38 | +RUN wget -q https://paddle-ascend.bj.bcebos.com/cvmodel/ascend-materials/Ascend-cann-toolkit_${CANN_VERSION}_linux-${SYSTEM}.run --no-check-certificate && \ |
| 39 | + chmod +x Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run && \ |
40 | 40 | ./Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run --install --quiet && \
|
| 41 | + echo "source /usr/local/Ascend/ascend-toolkit/set_env.sh" >>~/.bashrc && \ |
41 | 42 | rm -rf Ascend-cann-toolkit_${CANN_VERSION}_linux-*.run
|
42 |
| -# udpate envs for toolkit |
43 |
| -RUN echo "source /usr/local/Ascend/ascend-toolkit/set_env.sh" >> /root/.bashrc |
44 | 43 |
|
45 | 44 | # Install Ascend Kernels
|
46 |
| -ARG ASCEND_KLS=Ascend-cann-kernels-910*_${CANN_VERSION}_linux.run |
47 |
| -COPY ${ASCEND_KLS} /usr/local/Ascend/ |
48 |
| -RUN chmod +x ${ASCEND_KLS} && ./${ASCEND_KLS} --install --quiet && rm -rf ${ASCEND_KLS} |
| 45 | +ARG ASCEND_KLS=Ascend-cann-kernels-910b_${CANN_VERSION}_linux.run |
| 46 | +RUN wget -q https://paddle-ascend.bj.bcebos.com/cvmodel/ascend-materials/${ASCEND_KLS} --no-check-certificate && \ |
| 47 | + chmod +x ${ASCEND_KLS} && ./${ASCEND_KLS} --install --quiet && rm -rf ${ASCEND_KLS} |
| 48 | + |
| 49 | +# Install Ascend nnal |
| 50 | +RUN wget -q https://paddle-ascend.bj.bcebos.com/cvmodel/ascend-materials/Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run --no-check-certificate && \ |
| 51 | + chmod +x Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run && \ |
| 52 | + . /usr/local/Ascend/ascend-toolkit/set_env.sh && \ |
| 53 | + ./Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run --install --quiet &&\ |
| 54 | + rm -rf Ascend-cann-nnal_${CANN_VERSION}_linux-${SYSTEM}.run |
49 | 55 |
|
50 | 56 | # Install Ascend Transformer Boost
|
51 |
| -ARG ASCEND_ATB=Ascend-mindie-atb*linux*_abi1.run |
52 |
| -COPY ${ASCEND_ATB} /usr/local/Ascend/ |
53 |
| -RUN . /usr/local/Ascend/ascend-toolkit/set_env.sh && \ |
| 57 | +ARG ASCEND_ATB=Ascend-cann-atb_${CANN_VERSION}_linux-${SYSTEM}.run |
| 58 | +RUN wget -q https://paddle-ascend.bj.bcebos.com/atb/${ASCEND_ATB} --no-check-certificate && \ |
| 59 | + . /usr/local/Ascend/ascend-toolkit/set_env.sh && \ |
54 | 60 | chmod +x ${ASCEND_ATB} && ./${ASCEND_ATB} --install --quiet && rm -rf ${ASCEND_ATB}
|
| 61 | + |
| 62 | + |
55 | 63 | # fix accuracy to turn off memory optim and cache by default
|
56 | 64 | RUN sed -i "s/ATB_OPSRUNNER_SETUP_CACHE_ENABLE=[0-9]/ATB_OPSRUNNER_SETUP_CACHE_ENABLE=0/g" /usr/local/Ascend/atb/set_env.sh && \
|
57 | 65 | sed -i "s/ATB_WORKSPACE_MEM_ALLOC_GLOBAL=[0-9]/ATB_WORKSPACE_MEM_ALLOC_GLOBAL=0/g" /usr/local/Ascend/atb/set_env.sh && \
|
58 | 66 | sed -i "s/ATB_WORKSPACE_MEM_ALLOC_ALG_TYPE=[0-9]/ATB_WORKSPACE_MEM_ALLOC_ALG_TYPE=0/g" /usr/local/Ascend/atb/set_env.sh && \
|
59 | 67 | echo "source /usr/local/Ascend/atb/set_env.sh" >> /root/.bashrc
|
60 | 68 |
|
61 | 69 | # install post process ops
|
62 |
| -COPY code-share /usr/local/Ascend/code-share/ |
63 |
| -RUN . /usr/local/Ascend/ascend-toolkit/set_env.sh && \ |
64 |
| - cd code-share/build && bash build_ops.sh > /dev/null && \ |
| 70 | +RUN wget -q https://paddle-ascend.bj.bcebos.com/code-share-master.zip --no-check-certificate && \ |
| 71 | + . /usr/local/Ascend/ascend-toolkit/set_env.sh && \ |
| 72 | + unzip code-share-master.zip && \ |
| 73 | + cd code-share-master/build && bash build_ops.sh > /dev/null && \ |
65 | 74 | chmod +x aie_ops.run && ./aie_ops.run --extract=/usr/local/Ascend/ && \
|
66 |
| - rm -rf /usr/local/Ascend/code-share |
| 75 | + rm -rf /usr/local/Ascend/code-share-master |
67 | 76 | # update env for ascendc
|
68 | 77 | ENV ASCEND_CUSTOM_OPP_PATH=/usr/local/Ascend/vendors/aie_ascendc
|
69 | 78 |
|
|
0 commit comments