Skip to content

Instantly share code, notes, and snippets.

@sohnryang
Last active April 26, 2024 11:16
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save sohnryang/ca5d2512f7c6e0bab87843dbf1a3708f to your computer and use it in GitHub Desktop.
Save sohnryang/ca5d2512f7c6e0bab87843dbf1a3708f to your computer and use it in GitHub Desktop.
Vivado on ARM64 Mac using Rosetta 2

Running Vivado on ARM64 Mac using Rosetta 2

macOS Ventura supports running x86-64 binaries on Linux VMs. However, even with Rosetta installing Vivado is not a simple one-click process. This guide covers some workarounds and tricks to get Vivado up and running on ARM64 Mac.

  1. Make sure you're running macOS Ventura or higher.
  2. Install UTM and create a Debian VM with Rosetta according to their guide.
    • Other distributions should also work, but commands will be different.
  3. Install x86-64 version of java and libtinfo. Vivado depends on them.
$ sudo apt install default-jdk:amd64 libtinfo5:amd64
  1. Download a copy of self-extracting web installer from Xilinx website.
  2. Run the installer with --confirm flag.
$ /path/to/vivado/installer --confirm
  1. The installer will print something like About to extract 40 KB in /tmp/selfgzXXXX ... Proceed ?. Check the path /tmp/selfgzXXXX, and proceed.
  2. After extracting, the installer will ask about running ./xsetup. Before pressing y, open /tmp/selfgzXXXX/xsetup in your editor and delete architecture checking code which looks like this:
# ERROR out if this installation is running on 32 bit OS 
# and does not support 32 bit installation 
if [ "$(uname -m)" != "x86_64" ]; then
    ...
fi
  1. Save the file and press y in the installer. Continue with installation as usual.
  2. Patch the loader. Open /path/to/xilinx/Vivado/2022.2/bin/loader in your editor, where /path/to/xilinx is the path to Xilinx software suite installation. Remove architecture checking code as you did on step 6.
@dhilanr
Copy link

dhilanr commented Jan 9, 2023

Are you able to run any simulations? I keep getting an error that I haven't been able to fix by adding memory / swap files. It mentions permissions, but that is not the issue. In compile.log I see the following:

assertion failed [metadata != nullptr]: request to change permissions for interval that isn't tracked
(VMAllocationTracker.cpp:469 change_permissions)
/tools/Xilinx/Vivado/2022.2/bin/rdiArgs.sh: line 312: 3424 Trace/breakpoint trap "$RDI_PROG" "$@"

This happens when I run the xvlog command manually, too.

@sohnryang
Copy link
Author

Sadly the simulation doesn't work. 😢

@pftbest
Copy link

pftbest commented Jan 20, 2023

I get the same error when trying to run xvlog. I had to switch back to running Vivado in Windows 11 on Parallels, but it's much slower than Rosetta :(

@shahbaazlokh
Copy link

I installed as per the steps provided above,
when i try to create block design in vivado, it gives following error:-

is there any fix for this
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
Error in glXCreateNewContext, remote GLX is likely disabled

@MartinCova
Copy link

I get the same error when trying to run xvlog. I had to switch back to running Vivado in Windows 11 on Parallels, but it's much slower than Rosetta :(

Can you detail how you manage to install Vivado on Win11 on Parallels? Can you detail how you manage to install Vivado on Win11 on Parallels ?

@pftbest
Copy link

pftbest commented Feb 23, 2023

@MartinCova Just install it normally, no changes needed.

@MartinCova
Copy link

@MartinCova Just install it normally, no changes needed.

I tried, but Vivado crashes when I run a VHDL simulation. What version of Vivado and windows are you using?
Thanks in advance.

@pftbest
Copy link

pftbest commented Feb 24, 2023

@MartinCova

Windows 11 21H2

Vivado 2021.2

You may need to force single core for xsim.exe and other binaries that cause problems.
Screenshot 2023-02-24 at 09 48 36

@plegaspi
Copy link

You may need to force single core for xsim.exe and other binaries that cause problems. Screenshot 2023-02-24 at 09 48 36

@pftbest Where can I find this setting? Sorry, I'm new to Vivado and am trying to install it on my Mac for a college class.

@pftbest
Copy link

pftbest commented Mar 10, 2023

@plegaspi It's just file properties -> Compatibility -> Change Emulation Settings

@JordanSavoie
Copy link

Does this sort of installation support USB pass-through? Is there any way I can use this to program my board? I tried running lsusb and my board didn't come up.

@ichi4096
Copy link

I made a tool that makes Vivado run on Arm-based Macs and adresses the USB pass-through issue: https://github.com/ichi4096/vivado-on-silicon-mac

@jdevng
Copy link

jdevng commented Jul 1, 2023

"There is a bug present in Linux virtual machines on Ventura and the base M1 chip which causes the virtual machine to kernel panic and freeze up randomly. Unfortunately, this means that base M1 users should avoid Apple Virtualization backend until Apple or Linux maintainers provide a fix."

@hsuan1117
Copy link

@plegaspi It's just file properties -> Compatibility -> Change Emulation Settings

Sorry, where's the xsim.exe file located?

@Michele-Agosti
Copy link

Hi,
I'm trying to follow the procedure, but during the installation, after step 6, I get the following error message:

OK to execute: ./xsetup ? [Y/n] y
This is a fresh install.
INFO Could not detect the display scale (hDPI).
If you are using a high resolution monitor, you can set the insaller scale factor like this:
export XINSTALLER_SCALE=2
setenv XINSTALLER_SCALE 2
./xsetup: riga 100: /tmp/selfgz10857/tps/lnx64/jre17.0.7_7/bin/java: cannot execute binary file

What could I do? Thanks for helping!
Michele Agosti

@lajosdenes
Copy link

OK to execute: ./xsetup ? [Y/n] y This is a fresh install. INFO Could not detect the display scale (hDPI). If you are using a high resolution monitor, you can set the insaller scale factor like this: export XINSTALLER_SCALE=2 setenv XINSTALLER_SCALE 2 ./xsetup: riga 100: /tmp/selfgz10857/tps/lnx64/jre17.0.7_7/bin/java: cannot execute binary file

@Michele-Agosti

Hi!

I just ran into the same problem. In my case, it was due to the fact that I didn't install the amd64 versions of the packages, and with the arm64 versions I received the very same error messages. (You should verify that you have successfully set up Rosetta.)

After fixing that mistake, I think I had to install the libtinfo-dev:amd64 package as well, because without it, during the last part of the installation the installer froze and crashed. Finally, I ran the installer as root and the installer was able to finish the task.

During the cleanup procedure, there were some error messages with certain Vivado tools. (Execution of Pre/Post Installation Tasks Failed) I was able to circumvent that problem by patching the loader (step 8.) and executing these final commands by hand.

@parthokr
Copy link

image Any luck?

@AmrtanshuBharadwaj
Copy link

@plegaspi It's just file properties -> Compatibility -> Change Emulation Settings

Sorry, where's the xsim.exe file located?

Were you able to find anything?

@AmrtanshuBharadwaj
Copy link

@MartinCova Just install it normally, no changes needed.

I'm using Vivado 2021.2 on Windows 11 using Parallels only, but the software crashes when I run simulation. Any way to avoid that?

@elipsitz
Copy link

elipsitz commented Apr 13, 2024

I'm experiencing this problem installing Vivado 2023.3 on Debian 12.5, with macOS 14.4.1

assertion failed [rem_idx != -1]: Unable to find existing allocation for shared memory segment to unmap
(VMAllocationTracker.cpp:745 remove_shared_mem)
 ./xsetup: line 106:  2530 Trace/breakpoint trap   ${X_JAVA_HOME}/bin/java ${ARGS} -cp ${X_CLASS_PATH} -splash:${root}/data/images/splash.png com.xilinx.installer.api.InstallerLauncher
The program './xsetup' returned an error code (133)

Has anyone else gotten it to work on macOS 14.4.1?

@Qyt0109
Copy link

Qyt0109 commented Apr 26, 2024

I'm experiencing this problem installing Vivado 2023.3 on Debian 12.5, with macOS 14.4.1

assertion failed [rem_idx != -1]: Unable to find existing allocation for shared memory segment to unmap
(VMAllocationTracker.cpp:745 remove_shared_mem)
 ./xsetup: line 106:  2530 Trace/breakpoint trap   ${X_JAVA_HOME}/bin/java ${ARGS} -cp ${X_CLASS_PATH} -splash:${root}/data/images/splash.png com.xilinx.installer.api.InstallerLauncher
The program './xsetup' returned an error code (133)

Has anyone else gotten it to work on macOS 14.4.1?

I'm facing the same issue, any update for this? I really need some help here 😥

@elipsitz
Copy link

@Qyt0109: I was able to get this working with only minor adjustments: https://github.com/ichi4096/vivado-on-silicon-mac — perhaps there’s something different about how Docker creates the VM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment