From 9e0f39375eea353c164515f17ca32b2c35a5f6e4 Mon Sep 17 00:00:00 2001 From: Kiriti Nagesh Gowda Date: Fri, 2 Sep 2022 13:44:54 -0700 Subject: [PATCH 1/2] Docker - Ubuntu 20.04 Docker File --- docker/README.md | 13 +++++++ docker/zen_dnn_aocc_install.dockerfile | 49 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 docker/README.md create mode 100644 docker/zen_dnn_aocc_install.dockerfile diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..aba79c9b --- /dev/null +++ b/docker/README.md @@ -0,0 +1,13 @@ +# Zen DNN Docker + +## Build - dockerfiles + +``` +sudo docker build -f {DOCKER_FILE_NAME}.dockerfile -t {DOCKER_IMAGE_NAME} . +``` + +## Run - docker + +``` +sudo docker run -it --cap-add=SYS_RAWIO --network host --env DISPLAY=unix$DISPLAY --privileged --volume $XAUTH:/root/.Xauthority --volume /tmp/.X11-unix/:/tmp/.X11-unix {DOCKER_IMAGE_NAME} +``` diff --git a/docker/zen_dnn_aocc_install.dockerfile b/docker/zen_dnn_aocc_install.dockerfile new file mode 100644 index 00000000..cca4401f --- /dev/null +++ b/docker/zen_dnn_aocc_install.dockerfile @@ -0,0 +1,49 @@ +# ZenDNN supported OS +FROM ubuntu:20.04 + +# Deps Directory +ENV ZEN_DNN_DEPS_ROOT=/opt/zen-dnn-deps +WORKDIR $ZEN_DNN_DEPS_ROOT + +# set symbolic links to sh to use bash +RUN rm /bin/sh && ln -s /bin/bash /bin/sh + +# Update Docker Image +RUN apt-get update -y + +# install base dependencies +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ cmake pkg-config git sudo wget + +# install ZEN DNN Deps - AOCC & AOCL +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget unzip python3-dev dmidecode && \ + wget https://developer.amd.com/wordpress/media/files/aocl-linux-aocc-3.0-6.tar.gz && \ + tar -xvf aocl-linux-aocc-3.0-6.tar.gz && cd aocl-linux-aocc-3.0-6/ && \ + tar -xvf aocl-blis-linux-aocc-3.0-6.tar.gz && cd ../ && \ + wget https://developer.amd.com/wordpress/media/files/aocc-compiler-3.2.0.tar && \ + tar -xvf aocc-compiler-3.2.0.tar && cd aocc-compiler-3.2.0 && bash install.sh + +# Install Zen DNN required Packages +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install numactl libnuma-dev hwloc +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install hwloc-nox ccache libopenblas-dev + +# set environment variable +ENV ZENDNN_AOCC_COMP_PATH=/opt/mivisionx-deps/aocc-compiler-3.2.0 +ENV ZENDNN_BLIS_PATH=/opt/mivisionx-deps/aocl-linux-aocc-3.0-6/amd-blis +ENV ZENDNN_LIBM_PATH=/usr/lib/x86_64-linux-gnu + +# Working Directory +ENV ZEN_DNN_WORKING_ROOT=/workspace +WORKDIR $ZEN_DNN_WORKING_ROOT + +# set OMP variables +RUN echo "export OMP_NUM_THREADS=$(grep -c ^processor /proc/cpuinfo)" >> ~/.profile +RUN echo "export GOMP_CPU_AFFINITY=\"0-$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')\"" >> ~/.profile + +# set environment variable +ENV ZENDNN_GIT_ROOT=/workspace/ZenDNN + +# install Zen DNN +RUN DEBIAN_FRONTEND=noninteractive git clone https://github.com/amd/ZenDNN.git && cd ZenDNN && make clean && \ + source scripts/zendnn_aocc_build.sh + +ENTRYPOINT source ~/.profile && /bin/bash From 34a045a97d7dae5231b95bdf4ec80c2fb8e75cd6 Mon Sep 17 00:00:00 2001 From: Kiriti Nagesh Gowda Date: Mon, 5 Sep 2022 23:04:19 -0700 Subject: [PATCH 2/2] Zen DNN - Docker Updates --- docker/zen_dnn_aocc_install.dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/zen_dnn_aocc_install.dockerfile b/docker/zen_dnn_aocc_install.dockerfile index cca4401f..115349e6 100644 --- a/docker/zen_dnn_aocc_install.dockerfile +++ b/docker/zen_dnn_aocc_install.dockerfile @@ -27,8 +27,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install numactl libnuma-dev hwloc RUN DEBIAN_FRONTEND=noninteractive apt-get -y install hwloc-nox ccache libopenblas-dev # set environment variable -ENV ZENDNN_AOCC_COMP_PATH=/opt/mivisionx-deps/aocc-compiler-3.2.0 -ENV ZENDNN_BLIS_PATH=/opt/mivisionx-deps/aocl-linux-aocc-3.0-6/amd-blis +ENV ZENDNN_AOCC_COMP_PATH=$ZEN_DNN_DEPS_ROOT/aocc-compiler-3.2.0 +ENV ZENDNN_BLIS_PATH=$ZEN_DNN_DEPS_ROOT/aocl-linux-aocc-3.0-6/amd-blis ENV ZENDNN_LIBM_PATH=/usr/lib/x86_64-linux-gnu # Working Directory @@ -40,7 +40,7 @@ RUN echo "export OMP_NUM_THREADS=$(grep -c ^processor /proc/cpuinfo)" >> ~/.prof RUN echo "export GOMP_CPU_AFFINITY=\"0-$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')\"" >> ~/.profile # set environment variable -ENV ZENDNN_GIT_ROOT=/workspace/ZenDNN +ENV ZENDNN_GIT_ROOT=$ZEN_DNN_WORKING_ROOT/ZenDNN # install Zen DNN RUN DEBIAN_FRONTEND=noninteractive git clone https://github.com/amd/ZenDNN.git && cd ZenDNN && make clean && \