The current methods to run an Intel FPGA workflow on Apple Silicon involve two possibile approaches:
- Using a WoA Virtual Machine: Performance is terrible (already in amd64 Windows platforms is terrible, adding a virtualization layer on top of it leads to eternal compilation times) + space wasted for all the Microsoft bloatware
- Using a Docker Container: Performance is better than WoA, but the USB drivers are not working
Running Ubuntu on UTM with Rosetta enabled should tackle these problems
- Download UTM
- Download the latest nightly build of Ubuntu Desktop 22.04 LTS for ARM64 (also Debian works, with minor workarounds for multiarch repos)
- Download the desired Quartus installer for Linux (e.g. the Lite edition)
- Create a new virtual machine that utilizes the Apple Virtualization Framework, enabling Rosetta
- Note: To use USB, please use QEMU with Total Store Ordering enabled and install the Rosetta environment in alternative ways. To enhance synthesis time, set NUM_PARALLEL_PROCESSORS to 1 in your QSF file.
- Install Ubuntu
- Create the required directory for the Rosetta mount:
sudo mkdir /media/rosetta- Create a new file in the home directory (e.g. rosetta.sh) and copy the following script:
#!/bin/sh
sudo mount -t virtiofs rosetta /media/rosetta
sudo /usr/sbin/update-binfmts --install rosetta /media/rosetta/rosetta \
--magic "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00" \
--mask "\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
--credentials yes --preserve no --fix-binary yes- Create a new service file for the Rosetta service on /etc/systemd/system/rosetta.service:
[Unit]
Description=Enable Rosetta 2 Translation Layer
[Service]
Type=oneshot
ExecStart=/bin/sh /home/[your username]/rosetta.sh
[Install]
WantedBy=multi-user.target
- Enable the Rosetta service on boot:
systemctl enable rosetta.service- Reboot the virtual machine
- Edit /etc/apt/sources.list file and add multiarch repositories
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security main restricted
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security multiverse- Install the required libraries for Quartus
sudo apt update
sudo apt install libbz2-1.0:amd64 binutils:amd64 libglib2.0-0:amd64 libnsl-dev:amd64 g++-multilib:amd64 libfontconfig:amd64 libx11-xcb1:amd64 libxext6:amd64 libsm6:amd64 libdbus-1-3:amd64 libxft2:amd64 libxtst6:amd64 libxi6:amd64 libgtk2.0-0:amd64These libraries where tested for Quartus 23.1std, if for other versions Quartus crashes (cli outputs aborted (core dumped)), use strace to debug for missing libraries
The installation script for Quartus checks if SSE3 instruction are supported on the current CPU, the main problem is that this script doesn't run on the Rosetta environment, failing the checks.
- Run the Quartus installer with the following arguments:
./qinst-lite-linux-23.1std.1-993.run --confirm - When asked to run the installer, DO NOT ENTER ANYTHING, copy the extracted installer located in
/tmpin a known directory - Select to not run the installer, the script should clean the tmp directory
- Edit the script located in
./adm/qenv.shand add the following before the line containing# We don't support processors without SSE extensions (e.g. Pentium II and older CPUs).
if test `uname -m` = "aarch64" ; then
export QUARTUS_BIT_TYPE=64
fi- In the current terminal window, run this command to skip CPU checks during installation:
export QUARTUS_CPUID_BYPASS=1 - Run the installation script, a GUI window should appear
After the installation has completed, open the installation directory (should be located in the home directory) and edit ./23.1std/quartus/adm/qenv.sh:
- Add the following before the line containing
# We don't support processors without SSE extensions (e.g. Pentium II and older CPUs).
if test `uname -m` = "aarch64" ; then
export QUARTUS_BIT_TYPE=64
fi- Comment out the lines between
# We don't support processors without SSE extensions (e.g. Pentium II and older CPUs).and##### Determine what bitness executables we should use
- Obtain all the required licenses for the current setup from the Self-Service portal
- Copy the generated license file in a known directory
- Edit .bashrc, adding the following contents at the end of the file:
export LM_LICENSE_FILE='/home/[your username]/[your_license_file].dat'
export PATH=$PATH:/home/[your username]/intelFPGA_lite/23.1std/questa_fse/linux_x86_64/ Now Quartus can be run from the desktop shortcut, while Questa can be run by using vsim on a terminal window.
The same project was compiled on different machines (a VHDL digital filter), obtaining the following compilation times:
- Windows on i7 10th gen host: 3min 23s
- Macbook Air M2 - WoA + Parallels: 6min 18s
- Macbook Air M2 - Docker: 2min 02s
- Macbook Air M2 - Ubuntu + Rosetta: 1min 24s