Skip to content

Commit

Permalink
[Deps] Introduce env var to skip xrt download
Browse files Browse the repository at this point in the history
  • Loading branch information
auphelia committed May 31, 2024
1 parent 8d6543c commit 356528f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/quicktest-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ jobs:
export FINN_ROOT=$(pwd)
export FINN_BUILD_DIR=/tmp/finn_gha
export FINN_INST_NAME=finn_gha
export FINN_SKIP_XRT_DOWNLOAD=1
./run-docker.sh quicktest
8 changes: 5 additions & 3 deletions docker/Dockerfile.finn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ FROM ubuntu:jammy-20230126
LABEL maintainer="Jakoba Petri-Koenig <[email protected]>, Yaman Umuroglu <[email protected]>"

ARG XRT_DEB_VERSION="xrt_202220.2.14.354_22.04-amd64-xrt"
ARG SKIP_XRT

WORKDIR /workspace

Expand Down Expand Up @@ -78,9 +79,10 @@ RUN cd verilator && \
make install

# install XRT
RUN wget -U 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17' "https://www.amd.com/bin/public/amdOpenDownload?filename=$XRT_DEB_VERSION.deb" -O /tmp/$XRT_DEB_VERSION.deb --debug
RUN apt install -y /tmp/$XRT_DEB_VERSION.deb
RUN rm /tmp/$XRT_DEB_VERSION.deb
RUN if [ -z "$SKIP_XRT" ];then \
wget -U 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17' "https://www.amd.com/bin/public/amdOpenDownload?filename=$XRT_DEB_VERSION.deb" -O /tmp/$XRT_DEB_VERSION.deb --debug && \
apt install -y /tmp/$XRT_DEB_VERSION.deb && \
rm /tmp/$XRT_DEB_VERSION.deb; fi

# versioned Python package requirements for FINN compiler
# these are given in requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion docker/finn_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if [ -f "$VITIS_PATH/settings64.sh" ];then
source $XILINX_XRT/setup.sh
gecho "Found XRT at $XILINX_XRT"
else
recho "XRT not found on $XILINX_XRT, did the installation fail?"
recho "XRT not found on $XILINX_XRT, did you skip the download or did the installation fail?"
exit -1
fi
else
Expand Down
3 changes: 2 additions & 1 deletion run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ SCRIPTPATH=$(dirname "$SCRIPT")
: ${NVIDIA_VISIBLE_DEVICES=""}
: ${DOCKER_BUILDKIT="1"}
: ${FINN_SINGULARITY=""}
: ${FINN_SKIP_XRT_DOWNLOAD=""}

DOCKER_INTERACTIVE=""

Expand Down Expand Up @@ -186,7 +187,7 @@ if [ "$FINN_DOCKER_PREBUILT" = "0" ] && [ -z "$FINN_SINGULARITY" ]; then
# Need to ensure this is done within the finn/ root folder:
OLD_PWD=$(pwd)
cd $SCRIPTPATH
docker build -f docker/Dockerfile.finn --build-arg XRT_DEB_VERSION=$XRT_DEB_VERSION --tag=$FINN_DOCKER_TAG $FINN_DOCKER_BUILD_EXTRA .
docker build -f docker/Dockerfile.finn --build-arg XRT_DEB_VERSION=$XRT_DEB_VERSION --build-arg SKIP_XRT=$FINN_SKIP_XRT_DOWNLOAD --tag=$FINN_DOCKER_TAG $FINN_DOCKER_BUILD_EXTRA .
cd $OLD_PWD
fi
# Launch container with current directory mounted
Expand Down

0 comments on commit 356528f

Please sign in to comment.