Intel Quartus Prime in Docker
Intel FPGAs use the Quartus Prime software for synthesis and on Linux, the supported OS is Red Hat Enterprise Linux. It is possible to run Quartus Prime on Ubuntu too with some extra steps, but this is not supported by Intel. By installing Quartus Prime into a Docker image, we can make it easy to quickly deploy the tools to other systems including laptops and continuous integration jobs.
This container image is based on Ubuntu 16.04 and defaults to Quartus Prime 16.04. Quartus Prime bundles several libraries that are also distributed inside Ubuntu and there are incompatibilities between these versions. Removing the Intel bundled versions will fix segmentation faults when starting Quartus Prime.
Note that Quartus Prime downloads are large, and so if you plan on rebuilding this image it is worth creating a local mirror do avoid downloading the images each time.
To build the container:
docker build --build-arg MIRROR=http://localhost/quartus -t quartus-build .
The Quartus Prime installation process takes a while to decompress the device image files and install, so grab a coffee whilst you’re waiting for the build.
Once the build is complete, enter the container, adding your project as a volume somewhere:
docker run --rm -it -v /sys:/sys:ro -v $(pwd):/build quartus-build /bin/bash
Note that /sys
needs to be bind mounted into the container to avoid a
segmentation fault in libudev when performing license checks.
FROM ubuntu:xenial
MAINTAINER Jamie Iles <jamie@jamieiles.com>
ENV DEBIAN_FRONTEND=noninteractive
ARG MIRROR=http://download.altera.com/akdlm/software/acdsinst/16.1/196/ib_installers/
ARG QUARTUS=QuartusLiteSetup-16.1.0.196-linux.run
ARG QUARTUS_UPDATE=QuartusSetup-16.1.2.203-linux.run
ARG DEVICE_FILES="cyclonev-16.1.0.196.qdz cyclone-16.1.0.196.qdz"
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get install --no-install-recommends -y \
ca-certificates \
lib32ncurses5-dev \
libc6:i386 \
libcrypto++9v5 \
libfontconfig1 \
libglib2.0-0 \
libncurses5:i386 \
libsm6 \
libssl-dev \
libstdc++6:i386 \
libxext6:i386 \
libxft2:i386 \
libxrender1 \
libzmq3-dev \
locales \
make \
openjdk-8-jdk \
pkg-config \
unixodbc-dev \
wget \
xauth \
xvfb
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN cd /tmp && wget -q $MIRROR$QUARTUS && \
wget -q $MIRROR$QUARTUS_UPDATE && \
chmod +x $QUARTUS_UPDATE && \
for DEV_FILE in $DEVICE_FILES; do wget -q $MIRROR$DEV_FILE; done && \
chmod +x $QUARTUS && \
./$QUARTUS --mode unattended --installdir /opt/altera/ && \
rm /tmp/* /opt/altera/uninstall -rf
# These files conflict with the Ubuntu versions and cause random segfaults.
RUN rm /opt/altera/quartus/linux64/libccl_curl_drl.so \
/opt/altera/quartus/linux64/libcrypto.so.1.0.0 \
/opt/altera/quartus/linux64/libcurl.so.4 \
/opt/altera/quartus/linux64/libssl.so.1.0.0