Skip to content
Snippets Groups Projects
Unverified Commit c8a6caab authored by auphelia's avatar auphelia Committed by GitHub
Browse files

Merge pull request #643 from fionnodonohoe-xlnx/feature/vitisbuild

Feature/vitisbuild
parents 6fcc87d2 81fefd99
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,12 @@ WORKDIR /workspace
ENV TZ="Europe/Dublin"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Make sure the XRT_DEB_VERSION --build-arg was passed to this script
ARG XRT_DEB_VERSION
RUN if [ -z "$XRT_DEB_VERSION" ]; then \
echo "XRT_DEB_VERSION is not set, exiting now" ; exit 1 ; \
fi
RUN apt-get update && \
apt-get install -y \
build-essential \
......@@ -60,10 +66,26 @@ RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
RUN locale-gen "en_US.UTF-8"
# install XRT
ARG XRT_DEB_VERSION
RUN wget https://www.xilinx.com/bin/public/openDownload?filename=$XRT_DEB_VERSION.deb -O /tmp/$XRT_DEB_VERSION.deb
RUN apt install -y /tmp/$XRT_DEB_VERSION.deb
RUN rm /tmp/$XRT_DEB_VERSION.deb
RUN if [ ! -f "/opt/xilinx/xrt/include/version.h" ]; then \
echo "ERROR: XRT not installed. Please install XRT" ; exit 1 ; \
fi ;
# Inherit the xrt_supported_versions arg, a file, and copy it to docker
ARG xrt_supported_versions
ADD $xrt_supported_versions ./
ARG XILINX_VERSION
RUN echo "XRT installed. proceeding to check version compatibility" ; \
xrt_build_ver="$XILINX_VERSION:"$(grep 'xrt_build_version_hash\[\]' /opt/xilinx/xrt/include/version.h | sed 's/";//' | sed 's/^.*"//') ; \
if grep -Fxq "$xrt_build_ver" $xrt_supported_versions ; then \
echo "XRT version $xrt_build_ver is supported." ; \
echo "XRT Runtime setup Done" ; \
else \
echo "ERROR: $xrt_build_ver does not match supported versions" ; \
exit 1 ; \
fi ;
# versioned Python package requirements for FINN compiler
# these are given in requirements.txt
......
......@@ -178,7 +178,11 @@ if [ "$FINN_DOCKER_PREBUILT" = "0" ]; 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 .
docker build -f docker/Dockerfile.finn --build-arg XILINX_VERSION=$FINN_XILINX_VERSION --build-arg XRT_DEB_VERSION=$XRT_DEB_VERSION --build-arg xrt_supported_versions=xrt_supported_versions.txt --tag=$FINN_DOCKER_TAG .
if [ "$?" -ne 0 ]; then
echo "Error occurred during docker build, exiting"
exit 1
fi
cd $OLD_PWD
fi
# Launch container with current directory mounted
......
2022.1:f5505e402c2ca1ffe45eb6d3a9399b23a0dc8776
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment