Install Xilinx Vivado using Docker

Setup and configure the Xilinx Vivado software inside a Docker container.

Install Xilinx Vivado using Docker

Setup and configure the Xilinx Vivado software inside a Docker container.

Set up and configure a Xilinx Vivado instance using Docker with xserver forward.

Table of Contents

  1. Requirements
  2. The Dockerfile
  3. Build the container
  4. Run the container

Requirements

The requirements are quite simple, all you need is a current xserver version and a current docker installation. You also have to download Vivado Design Suite - HLx Editions and Vivado Design Suite - HLx Editions Update 1, you can find those files here.

The Dockerfile

Next, the Dockerfile is created. For this purpose the following must be copied into a file with the name Dockerfile.

FROM ubuntu:20.04

ARG VIVADO_TAR_FILE
ARG VIVADO_PATCH_TAR_FILE

RUN mkdir /xilinx
RUN mkdir /xilinx/data

RUN apt-get update -y
RUN apt-get install -y  libxext-dev \
                        libxrender-dev \
                        libxtst-dev \
                        libtinfo-dev \
                        libtinfo5 \
                        build-essential

# Install Xilinx 2020.1
COPY ${VIVADO_TAR_FILE}.tar.gz /xilinx/
RUN cd /xilinx/ && tar xzf ${VIVADO_TAR_FILE}.tar.gz
RUN /xilinx/${VIVADO_TAR_FILE}/xsetup -l /tools/Xilinx/ --agree XilinxEULA,3rdPartyEULA,WebTalkTerms --batch Add -e "Vivado HL WebPACK" -p "Vivado"
RUN rm -rf /xilinx/${VIVADO_TAR_FILE}.tar.gz

#Install Patch
COPY ${VIVADO_PATCH_TAR_FILE}.tar.gz /xilinx/
RUN cd /xilinx/ && tar xzf ${VIVADO_PATCH_TAR_FILE}.tar.gz
RUN /xilinx/${VIVADO_PATCH_TAR_FILE}/xsetup --batch ADD -e "Vivado HL WebPACK" -l /tools/Xilinx/
RUN rm -rf /xilinx/${VIVADO_PATCH_TAR_FILE}.tar.gz

RUN echo 'export PATH=/tools/Xilinx/Vivado/2020.1/bin:$PATH' >> /root/.bashrc
RUN echo "source /tools/Xilinx/Vivado/2020.1/settings64.sh" >> /root/.bashrc

ENTRYPOINT [ "/tools/Xilinx/Vivado/2020.1/bin/vivado" ]

As you can see you need two build arguments to build the Dockerfile. More about this later.

Build the container

To build the Dockerfile both Xilinx files must be in the same folder as the Dockerfile. If you execute an ls then it should look like this.

sh-5.0$ ls
Dockerfile  Xilinx_Unified_2020.1_0602_1208.tar.gz  Xilinx_Vivado_Vitis_Update_2020.1.1_0805_2247.tar.gz
sh-5.0$

Now the actual building of the Dockerfile begins. For this we need the two build-arguments.

  • VIVADO_TAR_FILE is the file name without the .tar.gz extension of the normal Xilinx installation
  • VIVADO_PATCH_TAR_FILE is the file name of the update file without the extension .tar.gz

The actual build command looks liks this in my case (don’t foreget to enter the name of your files!):

docker build -t xilinx:latest  --build-arg VIVADO_TAR_FILE=Xilinx_Unified_2020.1_0602_1208 --build-arg VIVADO_PATCH_TAR_FILE=Xilinx_Vivado_Vitis_Update_2020.1.1_0805_2247 .

Let’s wait until it is ready, that can take about half an hour.

Run the container

Since the container is now finished, we can start it. Please note that we have to forward the Xserver so that Vivado appears on the screen of our host. We also need a folder inside docker that is shared with the host, so we can copy our files from the container to the host and vice versa. Do not forget to replace /home/p4ck3t0/rub/cryptoaufhardware/data/ in the command below, with the path on your host where you want to store your Xilinx projects.

xhost + 'local:docker@' && docker run -dit --rm --name xilinx -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/p4ck3t0/rub/cryptoaufhardware/data/:/xilinx/data/ xilinx:latest

If everything worked, Xilinx should open up. Everything you do, you save under /xilinx/data/. Then the files are also available under your supplied path on the host.


See also