5 ms·
At least some aspects of this issue are getting better as we speak. The latest Mac OS (in beta) supports virtualizing ARM Linux but also enables the ARM Linux
by dev_tty01 4y ago
At least some aspects of this issue are getting better as we speak. The latest Mac OS (in beta) supports virtualizing ARM Linux but also enables the ARM Linux system to use Apple's speedy Rosetta 2 x86 binary compiler and JIT compiler to run x86 programs within the ARM Linux VM. Based on descriptions, it seems that the rest of the hypervisor VM framework has also matured substantially this release.
https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta https://developer.apple.com/documentation/virtualization/run...
https://developers.apple.com/videos/play/wwdc2022/10002/ https://developers.apple.com/videos/play/wwdc2022/10002/
If you are not familiar, Rosetta is how Apple Silicon Macs run existing Mac x86 binaries and it is highly performant. It does binary pre-compilation and cacheing. It also works with JIT systems. They are now making that available within Linux VMs running on Macs.
- azinman2 4y agoMy understanding is the AOT won’t be available to Linux; it’s JIT only.
- dev_tty01 4y agoInteresting. Where did you see that? I'm still trying to get a handle on the latest changes.
- azinman2 4y agoSays so here, which was posted earlier this week. I cannot verify it’s accuracy. I do work for Apple but not at all on related stuff. https://threedots.ovh/blog/2022/06/quick-look-at-rosetta-on-linux/ https://threedots.ovh/blog/2022/06/quick-look-at-rosetta-on-...
- runjake 4y agoThe WWDC video is unclear but seems to imply that it works the exact same as on macOS. Hopefully, this is the right timestamp: https://developer.apple.com/videos/play/wwdc2022/10002/?time=1212 https://developer.apple.com/videos/play/wwdc2022/10002/?time...
- mdp2021 4y ago> highly performant Last thing I read, 70% of the native performance was shown by running GeekBench through Rosetta (with a few odd results noted). If somebody has better info... Edit: I see that Nov 2020 checks returned an 80% performance, and there was discussion on HN at (at least) https://news.ycombinator.com/item?id=25105597 https://news.ycombinator.com/item?id=25105597
- dev_tty01 4y agoHere are my numbers for the original M1 (not Pro or Max) soon after release: ARM Geekbench single core on M1 MacOS is 1734. ARM Geekbench single core on WinARM in VM on M1 is 1550. x86 single core on i9 MB Pro MacOS is 1138. x86 in emulation on M1 MacOS is 1254. Yes, 72% x86 Rosetta vs. M1 Native. However, x86 Rosetta on M1 was faster than the previous i9 2019 Macbook Pro x86 native. I consider that to be performant for running code that was compiled for a very different architecture.
- philistine 4y agoWhen you compare with the sad-trombone sound that Windows has produced for its ARM os, it is speedy.
- epolanski 4y agoThose are terrific numbers for emulation. Anyway I can say that my colleagues M1 using rosetta is faster or equal to my MBP i9 2020.
- teilo 4y agoThat's because it's not emulation. It's binary translation, which is vastly more performant.
- sircastor 4y agoThis might be an unpopular opinion, but I really think people should ignore bench scores and run the processes they need themselves. See what it feels like, and how comfortable you are with that. Benchmarks are good for bragging rights and maybe convincing over-zealous accounting to approve a purchase (but even then that’s probably not all there is to it.)
- watermelon0 4y agoI have benchmarked x86 on ARM Linux VM with Rosetta, and while Geekbench 5 shows similar performance between ARM and x86 version (for both single and multi core), this does not translate to the actual real world use cases. When benchmarking x86 and ARM containers, our application seems to be around ~5x slower with x86-rosetta, and similarly can be observed for mysql-server or just doing `apt install`. This is still significantly better than using qemu emulation, but it's not really usable in our case. I've also encountered segmentation faults when running x86 `npm` inside Docker, so couldn't even install packages, but didn't dig further as to what's the cause. (Note: I've created a simple macOS app using Virtualization framework, enabled Rosetta, and loaded Ubuntu Focal. I've installed the latest version of Docker, which automatically used `rosetta` when encountering x86 executables. Maybe this setup is not ideal.)
- bjornsing 4y ago> It does binary pre-compilation and cacheing. It also works with JIT systems. Much more impressively it also leverages a custom hardware x86-like memory model unique to the M1/Apple ARM chips. That's where most of the performance really comes from, as I understand it.
- saagarjha 4y agoNot really; you can skip the barriers as Windows does and get mostly-decent emulation.