5 ms·
Accelerating the Performance of Rosetta in Linux VMs on Apple Silicon
- therealmarv 2y agoPatching the Linux Kernel... one of the things I don't want to do ever as a normal user (even if I'm a developer).
- microtonal 2y agoI'd assume that Apple plans on upstreaming the patch, but that they it as a separate patch as long as it isn't? Edit: apparently they already tried: https://news.ycombinator.com/item?id=42074961 https://news.ycombinator.com/item?id=42074961
- saagarjha 2y ago(This also works on baremetal Linux, though Apple of course does not support that usecase.)
- commandersaki 2y agoIsn't there a haiku embedded in the rosetta binary asking for it not to be pirated?
- Aaron2222 2y agoYou might be thinking of the one in the SMC of Intel Macs that macOS uses to check that it's running on an actual Mac?
- commandersaki 2y agoIt is also a thing for Rosetta 2 for Linux: https://news.ycombinator.com/item?id=37221013 https://news.ycombinator.com/item?id=37221013
- deleted 2y ago[deleted]
- gttalbot 2y agoIs Apple going to upstream this so it's part of Linux?
- saagarjha 2y agoThey tried: https://lwn.net/Articles/969480/ https://lwn.net/Articles/969480/
- londons_explore 2y ago> This program will hang indefinitely if TSO is in use, and will crash almost immediately if it is not in use. So now we just need to solve the halting problem, and we'll have our answer...
- saagarjha 2y agoUnfortunately there’s not really a better way to detect memory models except by trying to observe reorderings :(
- mschuster91 2y agoFinally. Some long time ago I filed a ticket for UTM and QEMU if TSO (and Rosetta) could be used for VMs because x86 VMs on ARM CPUs are dog slow at the moment, but back then this wasn't on the horizon. Good to see Apple themselves are working on it.
- pixelesque 2y agoApple submitted a patch, and then Hector Martin of Asahi Linux also submitted an alternative: https://lore.kernel.org/lkml/20240411132853.GA26481@willie-the-truck/T/#m535f22236b46ba3a9e072fe8a91b0e89ec8597b7 https://lore.kernel.org/lkml/20240411132853.GA26481@willie-t... but it was rejected due to concerns of fragmentation and it being non-standard...
- adrianmoisey 2y agoAnyone know if tools like Docker or colima use this?
- speedgoose 2y agoFor colima, you can add --vm-type=vz --vz-rosetta to the start command. It's qemu by default.
- mococa 2y agoHow about OrbStack?
- deleted 2y ago[deleted]
- adrianmoisey 2y agoThat uses rosetta, but does it use this feature?
- lloeki 2y agoAFAICT no because it needs a kernel patch which is not applied in the base Linux system colima is using: $ colima ssh $ dpkg -l |grep linux-image ii linux-image-6.8.0-31-generic 6.8.0-31.31 arm64 Signed kernel image generic hi linux-image-virtual 6.8.0-31.31 arm64 Virtual Linux kernel image
- rcarmo 2y agoWell, at least the Colima developers can consider making that patch standard in their build process.
- adrianmoisey 2y agoThanks for the clarity! I hope they add it.
- physicsguy 2y agoBiggest issue I run into now with Rosetta + Linux VMs/Docker is not having support for translating the AVX vector extensions, since they're becoming more and more common in compiled binaries. For more popular things there's typically an ARM image but that's by no means guaranteed, and compiling your own to support ARM can be quite involved.
- saagarjha 2y agoRosetta has AVX2 support as of this year.
- physicsguy 2y agoHa! Well that’s my employer keeping us on 14 for now then to blame for that one.
- galad87 2y agoThe latest version of Rosetta on macOS 15 can translate up to AVX2. However I don't know if the capability is enabled by default or exposed in the Linux VMs.
- gainsurier 2y agoI just tried it, and it did not work. AVX2 f is still not support in Rosetta on macOS 15 for Linux VMs.
- commandersaki 2y agoRosetta 2 for Linux is my favourite feature of Mac at the moment. I've been working on a project for many years that had a hard dependency on a library that only compiled on amd64 architecture. So for the longest time I was dual wielding a Mac and Framework laptop. I really hated switching between the two and moreso using Linux on my Framework; just felt like a bleh experience. When Rosetta 2 for Linux came around, I immediately started using it and was fully productive developing on our Intel only projects. I don't see any perceivable speed loss, t hough we had to adjust some sleeps for a few concurrency/threading tests to accommodate Rosetta. Apple really did not have to make Rosetta 2 available for Linux. If they hadn't, it wouldn't even register a blip on the users / market share of Macs/MacOS. But it's just one of those hidden gems of the OS, and going by this article they haven't stopped improving on it.
- arghwhat 2y ago> Apple really did not have to make Rosetta 2 available for Linux. The kinda did - offering good Linux dev environments is now a fairly big feature for both of the major Desktop OS's nowadays.
- pjmlp 2y agoAnd the only way Desktop Linux will actually grow beyond the usual 1%.
- ChocolateGod 2y agoI don't think it counts as Desktop Linux if its running in a CLI-only VM targeted at developers on a different host OS.
- cassianoleal 2y agoIt works on GUI VMs as well. UTM makes it very easy to use. I agree it still doesn't help much with the desktop Linux bit though. :D
- 2y ago
- deleted 2y ago[deleted]