3D games working on Apple GPU on Linux at 4K!

Asahi Lina back with a major update on the UAPI which sits between kernel and user space API. This post mostly focuses on Linux and OpenGL vs Vulkan work syncing for performance and correctness. Apparently borrowed some ideas from Intel’s Xe driver.


A fun part of the conclusion:

Since the Mesa driver no longer serializes GPU and CPU work, performance has improved a ton. Now we can run Xonotic at over 800 FPS, which is faster than macOS on the same hardware (M2 MacBook Air) at around 600*! This proves that open source reverse engineered GPU drivers really have the power to beat Apple’s drivers in real-world scenarios!
* Please don’t take the exact number tooseriously, as there are other differences too (Xonotic runs under Rosetta on macOS, but it was also rendering at a lower resolution there due to being a non-Retina app). The point is that the results are in the same league, and we will only keep improving our driver going forward!
 
Asahi Lina back with a major update on the UAPI which sits between kernel and user space API. This post mostly focuses on Linux and OpenGL vs Vulkan work syncing for performance and correctness. Apparently borrowed some ideas from Intel’s Xe driver.


A fun part of the conclusion:
1679429960359.png


https://vt.social/@lina/110062698111697307
 
1679523554896.png

 
Asahi Linux is definitely a 2023 project, with developer Asahi Lina being the prime example. She's a VTuber, with a stereotypical cute anime avatar, making random chirpy comments in the video, while working on the Linux kernel. Just watch a few seconds of her Steam adventures and you'll get my point.

 
Asahi Linux is definitely a 2023 project, with developer Asahi Lina being the prime example. She's a VTuber, with a stereotypical cute anime avatar, making random chirpy comments in the video, while working on the Linux kernel. Just watch a few seconds of her Steam adventures and you'll get my point.



I’m old 🙃 but whatever floats her boat (plus I gather she’d rather stay personally private, which is definitely understandable given how the internet can be)
 
That means that if CodeWeavers deciced to make CrossOver Apple Silicon native someday, they might be able to use part of the FEX code and actually be faster for 32-bit code than Rosetta is at the moment.
 
I can imagine that emulating x87 with good performance is not a priority for Rosetta2 (Apple deprecated it many many years ago). But an obvious reason why Asahi can't use Rosetta2 is that Rosetta2 is a proprietary macOS library while Asahi is bare-metal Linux.
 
I’m old 🙃 but whatever floats her boat (plus I gather she’d rather stay personally private, which is definitely understandable given how the internet can be)
As I said, Asahi Linux is definitely a 2023 product, that doesn't mean that the rest of us necessarily understand the marketing approach. (Although, I suspect Asahi Lina just likes doing this on Youtube.)

Then we've got Microsoft's latest product...

Windows 11 is definitely an operating system of 2023. It is used on some of the computers around. It includes features such as being an operating system, turning electricity into warm, and can outpace virtually any other version of Windows 11.
 
I can imagine that emulating x87 with good performance is not a priority for Rosetta2 (Apple deprecated it many many years ago). But an obvious reason why Asahi can't use Rosetta2 is that Rosetta2 is a proprietary macOS library while Asahi is bare-metal Linux.
Apple released a Rosetta 2 version for Linux but judging by Asahi Lina’s comment the license is for virtual Linux used on top of macOS.
 
OpenGL drivers are usually much more complex than Vulkan drivers, but in this particular case I can imagine that their OpenGL drivers are more like a proof-of-work, with performance being a low-priority target at this point. To get a high-performing Vulkan driver they will have to reverse-engineer all of the gritty details of the GPU protocol.

But again, I am just talking out of my ass here. My familiarity with this work is only superficial.

Alyssa addresses some of this in one of her latest posts:

1681066780123.png


 
Fuck yeah! Okay, I'm 83.6% convinced that I'll be staying on the Apple ranch. That would save me a lot of headaches and the annoyance and pain of building a PC. It would also be easier on my wallet, the Mac is bizarrely the value proposition for me, because I know I'd overspend on a gaming PC. The new M2 Pro Mac mini is a steal, so I'd be looking at something like that. Finally, I wouldn't have to suffer the indignity of using Windows and can keep macOS along with the muscle memory and knowledge that I've accumulated over many technological epochs.

That's assuming this all works out, but I have more confidence in the Asahi Linux team than anyone else in the industry. Thanks for the update, @dada_dave! You've been great at keeping us informed on the latest from the Asahi folks, please continue!
 
When this project kicked off my main concern was the longevity of the project and burn out of the key developers. That is still my concern but the nature of it has morphed. I use to think the problem would come in the form of having to keep pace with Apple releases, trying to RE all the fixed function hardware, etc … and while those haven’t entirely gone away, the team has been so successful and so clearly enjoy that aspect of it that I’m no longer as concerned about that.

No my concerns have more to do with Linux itself. Hector’s stated goal is to create a “Just Works” Linux Desktop environment for the AS Mac and given the limited variation in hardware that seems attainable. His original goal was to in fact upstream *everything* so all distros could benefit. But there are two problems: 1) mainline Linux Desktop has a lot of bugs and 2) kernel maintainers are not always supportive of changes. This isn’t antagonism towards Asahi per se but just making any changes at all in their fiefdoms. That means Hector while up streaming as much as possible has scaled back on up streaming everything. Further he has to spend more time than he wants just fixing problems in the Linux ecosystem rather than enabling it on the Mac hardware. A recent example wasn’t even the Linux kernel but a problem with Chromium that he (and presumably other distros?) has to put a kludgy hack in the Asahi kernel (won’t be upstreamed) to fix.

Finally he has taken a hardline, almost Apple-like approach to backwards compatibility. Basically: X11 is dead, Wayland is what will be supported going forwards and this is not popular amongst some people. I’ll admit Hector might phrased it a little more gently. But he wanted make it clear that only things that work through Xwayland will work, don’t ask us to try to keep X11 alive or support it when even other distros with large numbers of engineers are started to deprecate it.

I can tell in some of his posts he’s understandably getting aggravated by some of these issues - especially having to fix bugs in mainline Linux or even the larger Linux ecosystem that have nothing to do with running it in Apple hardware they’re just broken. I’ve highlighted only a couple of them here. I just hope he’s able to work through them before burn out sets in. Because while I won’t say it’ll be smooth sailing, support and and future growth will always come with headaches, hopefully it’ll be stuff he wants to work on rather than a slog.

While it “Just works” is a core Apple philosophy, they themselves don’t always succeed and this project has been eye opening to me about just how hard it is to even get close to doing it. There are so many little details that if they don’t work just right make the user experience that much worse.

Anyway I still think the project will succeed and be great but this has been something that I’ve seen creep in and it does worry me a bit. Then again, as I said I’m less worried about the long term reverse engineering of Apple hardware so I guess it balances out!

Example:

 
From what I've read the most burnout-inducing task is definitely dealing with some of the maintainers. I've seen some of the discussions, I wouldn't be able to have even a tenth of the patience he has.
 
Ah the Phoronix community, m7chy’s favorite site, always such a source of insight:


Okay, I've heard many ridiculous "Asahi is dumb" arguments, but this one takes the cake.

Ladies and gentlemen, the only reason to use Apple Silicon is ProRes acceleration. Nothing else matters. That is literally the only benefit. This Phoronix commenter says so.

Also lol, we already have a ProRes decoding demo [github.com]. So much for Apple having to "open up the documentation"... they just keep repeating the same story over and over again as if we haven't reverse engineered a dozen other components already.
1684006057061.png

Emphasis mine, very cool.
 
I figured that the cultural issues of the Linux community would eventually come into play with Asahi Linux. Apple users are often compared to religious fanatics, but a vocal few in Linux land really sound like cultists, and that's not hyperbole. The Asahi team is going to have to set some ground rules, and being a brand new distro, they've got an opportunity to cut out a lot of cruft. Do we really need X11 dragging itself along like an undead ghost of Linux past?

The fun part is creating something new. The bad comes in dealing with the idiosyncrasies of the Linux platform, plus the unpleasantness of some of the maintainers. In theory, Linux sounds like pure technological democracy, until you step onto someone else's fiefdom, then it devolves into petty bickering. I appreciate Linux for what it is, but would never switch to it full-time, because the chaos is too much for me.

I visit Phoronix, from time to time, along with other Linux-partisan sites like OSNews. A lot of those folks seem to live in their own bubble, where if something isn't completely open, then it isn't worthy of consideration. The belittling of Apple Silicon is a great example; just because the product isn't designed for open source, doesn't mean there aren't users who want to use Linux on it. In fact, it's the only Linux distro that I currently have an interest in. Sometimes, I wonder if some in the open-source community would rather have their software used by a few hundred people worldwide, who share their stated values, rather than reach as many users as possible. Generally, you'd think growing market share is desirable, including with Mac users.

Ideology aside, I hope that Hector and team can concentrate on doing just what they need for the project, get Asahi Linux fully functioning and stable, grow a user base, then worry about the wider world of Linux and upstreaming. They've made astounding progress, but I can understand if platform issues, both technical and political, become a substantial problem moving forward.
 
Ideology aside, I hope that Hector and team can concentrate on doing just what they need for the project, get Asahi Linux fully functioning and stable, grow a user base, then worry about the wider world of Linux and upstreaming. They've made astounding progress, but I can understand if platform issues, both technical and political, become a substantial problem moving forward.

Hector’s philosophy, at least at the start, was that upstreaming ensures that the work his own done properly with an eye towards maintaining the code long term. A lot of Linux developers actually followed your logic but then never did the upstreaming and as the code bases grew more disparate basically made it so you had an incompatibility problem and just general mess leading to user frustrations. That’s why Hector is still trying to upstream as much as possible and work with various other developers to get their stuff on board. It’s actually a crucial of “Just Works” when it comes to Linux. It’s just costing him more of his sanity than I think he had anticipated.

Similarly I remember reading from some engineers deep in the ARM ecosystem actually jealous of how easy a time Hector was having getting his stuff upstreamed (it’s all relative) when they had been fighting tooth and nail to get “System Ready” into mainline Linux for years with no movement from maintainers. “System Ready” is basically an ARM branding effort to make their server chips and partner server chips as close to drop in compatible with x86 as possible (things ARM doesn’t explicitly required in the ISA or chip design but are still necessary for OSes and server managers to take into account like UEFI). The annoying thing about from their perspective is that Linux already supports that for x86 chips because it’s standard in that ecosystem (built for both Linux and Windows) but are dragging their feet on ARM. And of course servers are a major battleground between x86 and ARM and Linux is a crucial component of that so the fact that distros have to roll their own solutions to support what is supposed to be a standard is sand in the gears. Now this was awhile ago so I don’t know the current situation, but yeah it’s a headache.

To be fair being a maintainer seems like a really hard, often thankless job. But that still doesn’t excuse some of this.
 
Back
Top