Linux on an M1 Mac
twitter.com
twitter.com
"- This is with software rendering. Seriously, these CPUs are good. Better than some other ARM laptop GPUs.
- Notice how it picked the right keyboard layout automatically. This was not an accident nor was it based on the locale; it's based on the hardware. Details matter! :-)"
https://mobile.twitter.com/marcan42/status/15046298186459750...
Exactly. I can only guess it will be even better if the graphics was accelerated, even faster if it was on the Mac Studio. It is still fine. We'll see.
As soon as they have a user friendly macOS installer or live USB-C installer then that will be an easy install path or try it out for many.
Overall, great progress!
I would take this more as an indictment of ARM laptops rather than any "software rendering is magically fast" statement here. Modern Linuxes on most recent-ish (<5 years old) x86-64 CPUs can quite easily software render at the same speed and quality as that demonstration.
This is a stronger statement of how far the project has come in terms of making everything operate smoothly on the M1, which is excellent (it's been what, a year?).
My prediction: AsahiLinux will start becoming the Linux benchmark king in terms of "out of the box" performance, mostly due to the console effect that Apple's M1s offer them. There's such a limited set of hardware to target they will be able to focus more on stability and performance than other distributions.
But then maybe anything is fast after using a 2012 retina MBP for almost 10 years.
Of course if I had to run a 10x suite 250 seconds, 3 minutes, would be noticeable. Or if I worked with compiled languages and had to recompile large projects.
That hardly sounds like a fair comparison: a computer from eight years ago is going to be slower than one from last year, after all.
The only fair comparison is between machines at the same or similar price points. What's the best intel/amd laptop you can buy for the M1 money, and how does that laptop compare?
Though Intel has since improved their mobile chips and the difference is likely to be much less with the new laptops this year.
I don't think I've seen any bang-per-buck comparisons; of course I have not looked very hard, so there's something for me to do later :-)
> The M1 chip is ahead in the performance/wattage,
I don't care. OP posted about performance with no regard to power efficiency, so I was wondering about the performace with no regard to power efficiency.
As long as the laptop lasts 3 hours or so it's enough. I'm not going to spend 8 hours huddled over a small screen that I am squinting into, using a reduced keyboard with limited navigation keys. I can't see myself spending even 3 hours doing that, TBH. My neck hurts after only an hour using a laptop without an external monitor or keyboard.
Since the thing is going to be plugged in for 99.9% of its use, I'm more interested in what performance difference I expect by going with the M1 over a similarly-priced Intel/AMD setup.
- Intel Alder lake has vastly better idle and low-performance task power draw than before but still not quiiite as good as M1. It can boost to slightly faster peak speeds but at a MASSIVE power draw disadvantage, like 4x more power then M1 to reach 5% more performance
- AMD which is on more comparable TSMC processes gets comparable power/performance draw, but AMD have not yet cracked idle power draw and it's still worse than even Intel
And Apple is about to release M2
I hope I’m wrong, but last I heard the Linux scheduler hasn’t caught up with 12th gen performance and efficacy cores.
—- Then there’s the whole other topic that some of us would prefer to be on arm over x86. I’m keeping an eye out for native Linux support for the latest snapdragon 8cx Gen 3 laptops that are coming out (ThinkPad X13s and friends). So far I’ve heard nothing. Which might suggest that M1 might stay ahead of the curve in terms of the community hacking to support these boards.
It will be fun to see how quickly HFI support finds it's way into Hypervisors like Xen.
[1] https://www.phoronix.com/scan.php?page=news_item&px=Intel-HF...
For example, let's say CPU A has 32 cores each capable to perform 1B instructions and costs $1000, and CPU B has 4 cores with same speed, but costs $100. Let's say typical task for a machine is browsing social network sites. If this task uses only 4 cores and a user can browse same number of web pages per unit time then effectively both A and B have the same performance, but CPU A has 10 times worse typical performance per dollar.
A metric in this case should be not the count of executed instructions, but for example, a count of web pages viewed by user per unit time, or share of time spent actually viewing pages (and not waiting for them to load).
Of course, you can make similar metrics for other uses - for example, a time taken by illustrator to draw a picture, or count of written lines of code per unit time for a programmer. All divided by hardware cost.
That's the type of comparison I would like to see. Would Apple be winning in such fair and realistic benchmark is an open question. I doubt that.
Ugh, not in Europe, especially not now
And even in the USA it seems it depends from where you live
https://www.eia.gov/electricity/monthly/epm_table_grapher.ph...
What's the break-even point where your savings from electricity offsets the extra cost of an M1? A year? Two years?
Battery life, fan noise, and throttling due to excess heat are all reasons to care about power consumption.
My assessment is that I'm not going out to buy a M1 laptop now even if there were ones not from Apple or a new Intel/AMD. I'll still wait until my current one starts dying or I have to do something it can't do. I replaced the previous one from 2006 when I started to work with VMs and containers and I needed more than 4 GB RAM. The new laptop (my current one) was 3 times faster on the same workloads and it had a HDD at the time.
I apologise. I interpreted what you said as evidence for how fast the M1 is.
> My goal was to show how much or how little a real world workload improved over the years.
Agreed. I am only now looking a desktop replacement for my 2011 first-gen i7, and the only reason is because I recently started doing Java and C# development on my personal machines, and the IDEs + compilation times are terrible.
Also, trying to run VS under Linux on this machine is a total waste of time. If it weren't for the Java and C# requirement I wouldn't even bother.
Incidentally, I don't use Chrome and don't even have it installed. My main browser is Firefox (at any given time I have 2-3 Firefox profiles open with tens of tabs) and secondary browser is Safari.
You'll then get a bunch of stack traces that show you where the process is spending time. To diagnose beachballs, the only interesting thing is the main thread (the first one).
Sometimes you can see from the method names where it's hanging.
I think that's the point of marcan42's Tweet - this is smooth even without GPU rendering, meaning the CPU is just that good.
The reason you would care about GPU rendering of the UI is mainly for battery life.
It depends on the power draw of the CPU, which for the M1 family is unusually low.
For instance, in today's Mac Studio review, Ars tested the power draw for various systems running a Handbrake encode with the CPUs running wide open.
The plain M1 system was drawing 27 watts. The M1 Max was drawing 47 watts. The M1 Ultra was drawing 87 watts. The PC desktop running Alder Lake unlocked was drawing 300 watts.
>Both the power-unlimited Core i9-12900 and the M1 Ultra performed roughly the same in our Handbrake video-encoding test, and the i9 did even better than the M1 Ultra in a handful of our CPU benchmarks. But measured at the wall, the Core i9 PC was drawing roughly 300 W of power the entire time the encoding task was running compared to the mid-80s for the M1 Ultra.
https://arstechnica.com/gadgets/2022/03/mac-studio-review-a-...
On x86 you have the CPU vendor, the chipset vendor, the hardware OEM, the storage vendor, the GPU vendor, etc. all fighting each other and it shows. No one company ends up having the motivation and control to make things tie well together.
Granted, for little things like "Asahi Linux is probably the only third party distro on the planet to autodetect your laptop's keyboard layout on first boot", yeah, it helps that we're targeting a very specific platform (and the vendor cares about these thing and left the facilities in place for us to do that). But for stuff like good battery life and power management, you just can't achieve that if the hardware isn't well integrated to begin with, and we're already getting impressive battery life numbers with minimal OS support.
The M1 Ultra, if it holds that it's just two Maxes glued together, has 48MB of L2 cache.[1]
AMD's newer 96MB VCache system in the 5800X3D is still L3 cache, with only 4MB of L2 cache.[2]
But that's a top of the line not-quite-released processor. AMD's current high-end (5950X) only has 8MB of L2 and 64MB of L3.[3] Meanwhile Intel's 12900HK only has 24MB of their Smart Cache[4], and the 12700K has 25 but with 12MB marked for L2[5].
It's not clear to me that cache is the be all and end all but it does seem to be a significant factor, especially if AMD's claims around the boost 96MB of L3 cache is going to give it are anything remotely correct.
[1]: https://www.anandtech.com/show/17024/apple-m1-max-performanc...
[2]: https://www.amd.com/en/products/cpu/amd-ryzen-7-5800x3d
[3]: https://www.amd.com/en/products/cpu/amd-ryzen-9-5950x
[4]: https://www.intel.com/content/www/us/en/products/sku/132215/...
[5]: https://www.intel.com/content/www/us/en/products/sku/134594/...
I don't think I agree with you on this. It may be easier for Asahi's developers to manage but it's not like Apple hasn't been cutting corners[1][2] in some areas either, which affects the actual users. I don't know if a power outage leading to lost data or incredibly fast SSD wear are better.
It's also only good for the use cases it's advertised for and falls drastically short in other areas.It's not close to either NVidia's or AMD's low-mid range GPUs when it comes to gaming, for example. It is excelling because it's a tool designed for a handful of specific purposes and the related audiences. It's very good to have a non-x86 competitor in the market and it would be amazing if one day I could build a comparably performant ARM-based (or heck even RISCV-based) system for home.
[1]: https://twitter.com/marcan42/status/1494213855387734019
[1] isn't cutting corners, it's just not optimizing a use case that didn't matter for iOS devices, and not realizing it to fix it when bringing that controller to Macs. I'm not saying the hardware/firmware is absolutely perfect. The part of the story about macOS defaulting to unsafe flushes is a software issue, not a hardware issue.
[2] is a macOS bug that was fixed a long time ago. It has nothing to do with hardware whatsoever. In fact, write endurance on Apple SSDs is at the high end of the market. macOS was just eating through it like butter due to a bug.
I don't really agree with [1]. "Use what we already have" is cutting corners, because it's skipping the important steps of considering the impact of those engineering decisions in a new product.
Re [2], glad to hear it's changed but the idea that it "has nothing to do with hardware" is a bit misleading because as you noted Apple controls everything. You can't pretend there's a console effect on one hand and then turn around and ignore the downsides to that. Fixed in software is a good answer but I'm struggling to see issues with modern hardware that aren't fixed in software.
AsahiLinux's Introduction to Apple Silicon - https://news.ycombinator.com/item?id=30699794 - March 2022 (5 comments)
Asahi Linux Add Support for the Broadcom FullMAC WiFi Chips Used on Apple T2/M1 - https://news.ycombinator.com/item?id=29694497 - Dec 2021 (9 comments)
Apple Helps Asahi Linux - https://news.ycombinator.com/item?id=29591578 - Dec 2021 (174 comments)
Asahi Linux for M1 Macs Progress October-November 2021 - https://news.ycombinator.com/item?id=29564384 - Dec 2021 (211 comments)
Asahi Linux for M1 Macs: progress report for September 2021 - https://news.ycombinator.com/item?id=28762744 - Oct 2021 (186 comments)
Asahi Linux for Apple M1 progress report, August 2021 - https://news.ycombinator.com/item?id=28180135 - Aug 2021 (183 comments)
Asahi Linux Progress Report: January/February 2021 - https://news.ycombinator.com/item?id=26421963 - March 2021 (65 comments)
Asahi Linux: Linux on Apple Silicon project - https://news.ycombinator.com/item?id=25649719 - Jan 2021 (405 comments)
Even my job - I write web apps, I don't need a GPU. If it can play audio through a headphone jack, and draw a window nicely without aggravating amounts of tearing (though I might work in a full-screen CLI anyway), I don't care, it's Linux!
[Edit: I'm not disputing a GPU is nice to have. I am dismissing the overly negative reply above.]
An M1 with Asahi looks fantastic to me.
Yes, the browser engine that had to be forked because Apple neglected it for so long. Brilliant example!
> and also brought us CUPS
Nope. That would be Michael Sweet. Apple later hired the main developer behind the effort, and adopted the standard as their own. Same thing happened with LLVM, so don't go around spreading those particular lies.
Got anything else? All of your examples seem to be instances where Apple has neglected Open Source or just threw money at something they were incapable of competing with.
> there's Apple code in your Linux distribution for everyday functionality, gasp!
Man, wait until you hear who contributed the POSIX APIs, SMP support, multitasking/multiuser functionality and the entire networking stack to MacOS... ;)
I do think Apple’s open source contributions are largely undersold, although they’ve probably contributed less than other technology companies their size (e.g. Google).
GUIs will essentially emulate the GPU in software and reduce battery life.
GPUs are also more power efficient at many of these things, because while they use more power while running they get done sufficiently quickly that they end up ahead. That’s before you include the power savings from rapidly dropping the power mode.
Note that this isn’t specific to AS, or even arm in general: every laptop wants to get to low power as fast as possible, because constant low-ish power is much worse than brief spikes that you can disable power between.
The only reason modern laptops have 10h+ battery life is because of GPUs. Sure, without it you can manage, your power efficiency will just massively tank.
However, this could be absolutely amazing for the new M1 desktops, or for the M1 Mac Mini. It could make a kick-ass server.
Did I mention the hardware is just that good? :-)
Seriously though, you’re all doing a very impressive work!
Then how did Integrated Graphics sell so well in the broader marketplace? You'd think with their near-useless GPUs that were weaker than M1's software rendering that nobody could use them.
Also, whatever about M2 - Apple has structured their hardware to require minimum driver changes on each release. M2 will probably just be a few patches on the core driver, not a rewrite.
The point is to delegate rendering away from the GPU, which is obviously a waste of compute no matter how you look at it. Every computer is capable of software rendering (my i5 520m can software-render for crying out loud), but we live in a more civilized age; even weak GPUs do their job to prevent the CPU from being unnecessarily bogged down with a task it's not good at. We do this so your computer doesn't insta-break when you plug in an external display, we do this so that CPU cores don't get pinned when you start scrolling a webpage, we do this because software rendering is bad. It doesn't matter if you're doing it on an i9 12900k or a first-gen Raspberry Pi; the goal is to not waste CPU cycles on it in the first place. This shouldn't even be up for debate in the first place.
This is making a lot of leaps. None of his comments say that. They have a whole page [0] dedicated to a nuanced discussion on "when will Asahi Linux be done". It's perfectly fine for him to be excited about his project and his hardware. Lots of other people are also excited, which is awesome!
[0]: https://github.com/AsahiLinux/docs/wiki/%22When-will-Asahi-L...
This is not to say GPU support is a long way away; it isn't.
> and that we may well have an M2 on store shelves before you've even got M1 support to a usable point.
You're assuming M2 will take another year. M1 Pro and Max took a week or so to bring to near feature parity, and M1 Ultra will probably take ~1 day. We aren't starting from scratch for every new chip.
I'm not saying everyone will be happy daily driving a laptop with no GPU (I wouldn't, not as my main machine). I'm saying some people will be (I would, as a carry around laptop for browsing and SSH).
>That whole "optimized for macOS" thing is a myth. Heck, we don't even have CPU deep idle support yet and people are reporting 7-10h of battery runtime on Linux. With software rendering running a composited desktop. No GPU.
The hardware is just that good.
1. There is now a completely untapped resource on your SOC
2. Your CPU is being utilized unnecessarily for things it shouldn't have to run in the first place
3. It completely rules out any hardware-accelerated applications, which is a lot of desktop use cases
If you’ve ever used a desktop PC with an Intel CPU and a dedicated GPU, you’ve also have a completely untapped resource in your machine (unless you were rocking a Xeon or some such). It’s not entirely illogical when you consider the benefits of economies of scale.
What matters is whether the experience you can get with the hardware you do use is superior to competing offerings. Have Apple Silicon Macs reached that point for Linux users? Probably not, unless you have very specific requirements and are willing to live on the bleeding edge, but the case is starting to appear for some specific needs.
And of course, they are working on drivers for the GPU and other hardware.
What does that even mean? We have a full composited desktop with shadows and transparency and everything. Software rendering doesn't mean no OpenGL. It's just software OpenGL.
USB3 and Thunderbolt are being worked on as we speak, and USB3 already works in Sven's kernel branch.
The backlight works with the DCP display driver, which is already working but just needs to be productionized so we can ship it in our main kernel branch. Soon.
And the GPU userspace work is at 90+% GLES2 spec compliance, and the hardware interface reverse engineering to write a kernel driver (which is the simpler part) has already started.
Things are moving quickly.
You should be paid by Apple for this.
Apple pays less than $500/year to BSD developers for the millions of lines of code that they poach from them. Giving back to open source developers for doing the things they should have done in the first place isn't really "their thing" so to speak.
This is unfounded. Also Apple bought the rights to BSD before FreeBSD existed, back when it was BSD4.3 and FreeBSD would not arrive for over a decade later. Apple also hired a lot of FreeBSD's programmers (including their founder) full-time and some of Apple's technologies such as LLVM have made their way back to FreeBSD.
https://freebsdfoundation.org/our-donors/donors/?donationTyp...
> This is unfounded. Also Apple bought the rights to BSD before FreeBSD existed.
You're right. But they still poach millions of lines from FreeBSD for XNU/Darwin, since the patches are largely compatible. One would think they'd be willing to give back to the developers who write their code for them, but you'd be mistaken. Much like the App Store, it would appear that Apple is interested more in squeezing value from whoever they can and throwing them aside when they no longer make a case for their value.
"The BSD portion of the OS X kernel is derived primarily from FreeBSD, a version of 4.4BSD that offers advanced networking, performance, security, and compatibility features."
https://developer.apple.com/library/archive/documentation/Da...
Some upstream kernel folks are already using Apple Silicon machines for development (to compile x86 kernels even) because they're faster than their x86 boxes, by a good margin :-). My M1 Pro laptop is about as fast at doing kernel builds as my 16-core Threadripper.
Only thing stopping me getting one of these (through work) is the OS.
Not only that, but in the F500 companies I've worked for it's not uncommon for employees to get the latest shiny new thing when their existing machine still has lots of life left. Repurposing it with Linux means I can use it.
A bunch of the power saving is also from the OS shutting things down quickly and moving everything to low power states, linux has not always been the best at that. Which does make sense given that the primary usage is still things like data centers where the primary purpose is having everything go as fast as possible essentially all the time.
I'd say x86 platforms have not always been the best at that :-)
However we can also point to Darwin as it runs on lightning cables, presumably apples high performance usb-c/thunderbolt/marketing-name-of-the-day, etc on super teeny tiny arm processors :)
However, without good GPU support, proper battery life is impossible.
If it's non-negotiable for you, I would suggest alternative options. There are now laptops with similar CPU performance and better GPU performance, with comparable battery life (I get 12 hours idle or browsing websites that aren't too demanding). It doesn't make sense to go with an M1 Mac as a Linux machine unless you really need it to be ARM.
If you really push battery saving to the very maximum, you can get power consumption with a similar setup at around 7W, which means a battery life of around 12 hours with a daily workload. However, as it is now, I am using between 7 and 9 watts, which results in a battery life of around 10 hours.
To get this to work on Arch Linux however, it was a serious headache, took me around 9 hours of work.
This seems comparable to what my friends with an M1 Pro MBP, 14", report, which is 8-9h on essentially the same workload.
I get better power consumption on Windows, however, unless I fully and completely disable the dedicated GPU (I use hybrid graphics).
https://medium.com/macoclock/how-to-install-windows-11-on-an...
The speakers technically work on all the laptops, but we need to implement safeties to make sure you don't accidentally blow your speakers, and also add DSP so they sound good. Fir now, we keep the speakers disabled.
BT will take longer though, it's not a huge priority for me so it's behind things like the GPU on the list (unless someone volunteers, of course.
Wasn't it Vista that was the first OS to even support graphics acceleration for rendering the UI? That was a long time ago, but not that long either, and I don't recall it coming alongside massive improvements in battery life.
I'm not against graphics acceleration or anything, but I don't find it at all hard to believe that a fast, power-efficient CPU like the M1 could perform adequately with software rendering.