Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker - Ubuntu 20.04 Docker File #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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}
```
49 changes: 49 additions & 0 deletions docker/zen_dnn_aocc_install.dockerfile
Original file line number Diff line number Diff line change
@@ -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=$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
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=$ZEN_DNN_WORKING_ROOT/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