869 points · by yewenjie · 4y ago · 273 comments
- https://rosenzweig.io/blog/asahi-gpu-part-1.html, https://rosenzweig.io/blog/asahi-gpu-part-2.html, https://rosenzweig.io/blog/asahi-gpu-part-3.html
- https://rosenzweig.io/blog/asahi-gpu-part-4.html, https://rosenzweig.io/blog/asahi-gpu-part-5.html, https://rosenzweig.io/blog/asahi-gpu-part-6.html
It's an honest question. Even if someone (or a team) could somehow be paid for this work, by the time the results are usable, the hardware will be more or less functionally obsolete.
And that is on top of the fact that ARM64 on MacOS will always be a small slice of the gaming pie, and ARM64 on Linux games and GPU applications virtually nonexistent.
Also, the Apple GPU has evolved from PowerVR roots dating back to the 1990s. It is fairly safe to assume that the next generation of Apple GPU will share enough with the current generation that in 3 years, supporting whatever new hardware exists will be incremental rather than transformative ground-up work.
This was already the case for M1 into M2.
What do I miss?
but considering there is a mountain of linux development for people with the expertise to be done for more open platforms. This work pretty much only helps one of the richest companies and Apple shows very little inclination to help by providing documentation or support (they let an alternative OS boot seems to be the extent of it).
The XPS series might have caught up for a while, but until they flip over to ARM, Apple laptops simply blow anything else out of the water. What’s wrong with trying to run Linux on that?
Also it will be useable for at least some usecases, even if not AAA games, before the hardware is obselete.
Because most of us looking into Asahi don't care for playing AAA games with it. We want Linux on our Mac laptop, with hw acceleration for the desktop and apps.
Again, why bother?
Why continue to choose user hostile hardware made by a manufacture who seeks to frustrate your precise desire to do this? Wouldn't it be much more logical to purchase from a manufacturer who doesn't care what you use on the hardware--or even better yet, actively supports you in getting the hardware to perform as well as possible with Linux? What is the point in continuing to chase after hardware which doesn't fully work in your chosen operating system with your preferred applications? Why pay full price for hardware that will never be fully supported and work to its full potential?
But you are right -- modern desktops are using a GPU heavily. For worse or best(10-15 years ago everything worked without GPU help and compositors. Was not as fancy looking).
P.S. I like how HN works on mobile. And how lightweight it is. Made by real hacker wizards, of long lost arcane knowledge of the webcraft!
Because people want to. Who is anyone to be the arbiter of those desires, no matter the practical applications (which this has a ton of, as alluded to via the other repliers)?
> a basic OpenGL driver is doable by a single person. I’m optimistic that we’ll have native OpenGL 2.1 in Asahi Linux by the end of the year.
That should be enough to be very useful to a lot of users.
Additionally there's a lot of shared code between the different linux graphics drivers through Mesa, the linux userspace graphics driver framework.
People do great stuff with computers and programming and I think this is a good example. Passion is what it's all about.
The "why bother" is missing the crucial point, that the most important use of the GPU driver for Asahi would be HW accelerated desktop (and driving external monitors, etc) - it's not like a GPU driver for M1 is useless if no AAA games aren't supported...
So eventually the gap between hardware release and fairly complete driver support could close quite a lot.
I wonder the same thing, but from an ideological perspective.
Why should the free software community promote Apple hardware by making it more accessible to OSS enthusiasts, when Apple only cares about OSS when it directly benefits them? Apple makes great hardware, but they're actively hostile to everything free software stands for. If Apple cared about this user base, they would work on this themselves.
That said, from a technical standpoint, this is nothing short of impressive, so kudos to the team. I can't even imagine the dedication and patience required to work on this project.
Why should you be forced to choose between non-free software and subpar hardware?
Why not liberate the hardware?
https://youtu.be/Of93GBCEbug Shows some native games, but also Skyrim and Metro Last Light working on ARM.
Isn't there anyone inside Apple who wants to have Linux?
Isn't there anyone inside Apple who wants to help?
They also may be reluctant to release it because of fear of litigation. They may do something that’s patented, similar to a patent, or deemed patented by someone else, and releasing documentation makes it easier for others to find such cases.
Also, in the end, there’s dollars. Even the simplest process to release documentation costs money (and theirs wouldn’t be the simplest for the reasons mentioned above). They may think there’s not enough money or reputation gain in it for them to do this (and for reputation gain, they would have to keep doing it)
At this point, trying to expand the user base through sheer hardware improvement or trying to include fringe groups (windows dual boot users, linux user) probably has diminishing returns.
In contrast, service revenue, app revenue and accessories like air pods, the Apple Watch have a much better ROI.
What I'm coming at: they have little incentive to work hard to expand the user base, and a better ROI on expanding revenue from users of their software platform. So I'm not holding my breath on Apple actively helping for windows or linux support anytime soon.
> thanks to the tremendous shared code in Mesa, a basic OpenGL driver is doable by a single person. I’m optimistic that we’ll have native OpenGL 2.1 in Asahi Linux by the end of the year.
It's likely that even a bare-bones OpenGL driver will probably run better than llvmpipe, which is especially important in a laptop context due to the resulting power use improvements.
I do this on my workstation and can run anything, it's quite nice:
$ lscpu | grep Architecture
Architecture: x86_64
$ GOARCH=arm64 go build main.go
$ file ./main
./main: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, ...
$ ./main
Hello, world.Also all of this has progressed so fast thanks to Alyssa doing bunch of GPU reverse engineering on macOS and writing coresponding userspace MESA driver. https://rosenzweig.io/blog/asahi-gpu-part-6.html
To put it simply, NVIDIA screwed third-party drivers by requiring a ever-changing encrypted and signed blob, hidden deep within the proprietary driver package, to be sent to the GPU every time it boots. Otherwise, you can't change the clock speed of your NVIDIA GPU from the boot clock speed, which is almost unusably slow.
The message from that is screw NVIDIA - not that third party GPUs necessarily are that horrible to implement.
https://blogs.gnome.org/uraeus/2022/05/11/why-is-the-open-so... https://lwn.net/Articles/894861/
But almost no users to justify the huge development effort. Many laptops from that era, for example, are completely unusable by now - only high end models had 16GB of RAM, most were limited to 4 or 8GB - and desktop builds of that age simply consume far too much electricity for the performance they offer.
In contrast, investing work into current NVIDIA/AMD drivers or the Apple Mx architecture makes more sense - the crypto boom and bust led to a lot of cheap but current cards which means many will simply stick it out with a used RTX 3090 for a couple years once NVIDIA releases their new generation, and Apple usually keeps their own hardware stacks very similar in design which means work done now will still be a foundation for Apple's chipsets five or ten years in the future.
https://nouveau.freedesktop.org/CodeNames.html https://nouveau.freedesktop.org/FeatureMatrix.html
https://csis.pace.edu/~marchese/CS865/Papers/candea_microreb...
In case you're curious about the process, here you have her YouTube profile: https://www.youtube.com/AsahiLina
It's a bit of a shame that the RAM is so limited on all those platforms - I can't imagine it being enough to load many electron apps in a few years time.
I honestly hopoe Electron has to improve it's performance or companies start moving off of it. It's honestly a bit of a joke at this point.
I just don't see how 220MB for Discord is unreasonable in any way, when Firefox with 8 tabs takes 1.2GB. Telegram written in Qt meanwhile takes 200MB, literally no difference to Discord, an electron app.
Slack was using 1.2 GB. It is in a workspaces but that seems a lot for an app that does nothing.
Postman I think is also Electron often uses 1-2GB for sending API requests.
Atom though was only using 200MB which is fair.
I think it's a bit weird to compare a chat app with a web browser, though, when it comes to memory usage. Maybe a better example: hexchat, a native GTK IRC client, is currently using 60MB of RAM. Telegram's native app using over 200MB is also ridiculous.
Not to say that it should not have more, far from it. But the Electron framework is so wasteful, compared with basically all the alternatives.
I wish the framework developed for Sublime Text were not secret.
Que pedo, wey.
As long as you didn't get one of the single-channel SSD models, it would make plenty of sense to give yourself a 16 gig swapfile (or something of the sort).
It's actually a problem, if you're low on SSD space the filesystem can fill up with swapfiles while the system is still reasonably functional because the SSDs are fast enough. Then because of an APFS design fault, sometimes it isn't possible to delete any files to free up space. It says "out of disk space" when you try to delete a file.
Currently sitting at 29GB (on M1 Pro), just for regular web dev environment on MacOS.
Does that include file system cache?
Having a system with lots of RAM, the OS does it's best to use it. Just because you see 29GB used doesn't mean you'd see a noticeable performance dip on a 16GB machine. You might, but it really depends what that RAM is being used for.
Yes, but that's normally what people mean when they talk in broad strokes about "electron apps". Anything beyond that is application data, which is going to be roughly the same regardless of stack, and in nontrivial apps quickly comes to dominate.
> Currently sitting at 29GB (on M1 Pro), just for regular web dev environment on MacOS
I mean, I assume you're using more than just some regular electron apps. macOS itself is currently using 8GB of RAM on my machine, my docker VM is using 4GB (down from a default of 8GB), etc. And that doesn't include my IDE and its code-scanning and type-checking background processes.
For something extremely functional like a VS Code, which is a mini-IDE of sorts, that might be excusable but it's beyond silly for a streaming music player.
There are no dependencies.
new hardware, arm based apple silicon here, is now challenging the monopoly of x86. after such a long waiting, we finally have a mature alternative platform to choose from - and it is performance is pretty good.
new language, rust here, is getting its way into the linux kernel. this new GPU driver is written in Rust!
the work is based on the GPU hardware analysis of Alyssa Rosenzweig, who is a very talented young lady who started when she was in high school I think. the author of the driver, Asahi Lina, also seem to be very young.
Just amazing!
Linux was about making it work on different platforms from the very beginning. There was never any vendor support.
Cynics are gonna cynic. But it's people like Asahi that get shit done and move the world forward.
If Apple don't want to release documentation on their chips, then leave them to rot in their walled garden.
They just didn't tell anyone how to actually build a third-party operating system.
Nonetheless, a half-step like this is vastly better than the locked bootloaders, jailbreaking, and outright hostility of the smartphone/tablet/console world.
From a past article, reversing a printer protocol was derided for its complexity and there is a wire to snoop.
> reversing a printer protocol was derided for its complexity and there is a wire to snoop.
Anything can be reverse engineered with enough time, effort, and domain knowledge. A printer may not be worth it.
Also just wanted to point out that torch does support Apple GPUs now, however.
But you have to remember that this was an impromptu live stream. It took much less effort on her part to create, literally just 30 mins (half of which was her trying to compile OBS).
And I think that's fine. I think the end result is the goal, blog posts are nice but not the focus here.
What I meant, is that the result is still great (a GPU driver for M1) regardless of how bad the video is and how weird the entire thing is in general.
And going through the twitter link you can find the homepage for that software is at https://inochi2d.com/ (the other twitter link gets you the homepage for the developer of that software at https://github.com/LunaTheFoxgirl).
[ unpopular opinion incoming!! ]
yes, you are special and unique, sure. we all are. you like anime, and stuff from Japan, awesome. lots of people do. why is one third to one quarter of the video real estate consumed by the avatar? why is the voice so high pitched and hard to understand?
i mean, fine. i am not about to tell someone how to present themselves, especially unprompted. i will say that i have zero interest in this if this is what the community around it is like. it feels like i’m being talked to like i am an infant, and there is fear that my attention will wane if i am not overstimulated visually and aurally. it is insulting, to me.
i wish this effort all the best. treat me like an adult, please.
From what I've seen, it's not unusual for streamers which do not use an avatar to consume a fraction of the video real estate with a camera showing their face; the avatar merely replaces that.
God bless anime.
Dang that video... I think of myself as pretty open to whatever folks want to do and all, but it is really hard to watch that video.
This is the future of our profession. We've gone from long-term, long-form documentation, to blog posts, to talks... in the next ten years it'll just be anime pfps squeaking at each other.
I was wondering if this would be more common as the technology developed but it seems like it hasn't and instead there are specific ideas about what vtubers are supposed to be that have become entrenched.
There are some people like Hikalium who are using vtuber avatars for live programming videos but not particularly doing a character though
(Anyway, the work itself is great!)
[1]: https://twitter.com/alyssarzg/status/1533624133929553922
On the consumption side, I find the VTuber method to be more compelling than pure voiceovers, even if it’s silly. An avatar helps create a sense of engagement. It’s also interesting to see what sort of characters people come up with.
Give me Optimus Prime doing kernel Rust coding. Even better, gimme the sarcastic high pitch of Skeletor. I'd also be fine with, I dunno, Lara Croft or other virtual female character.
Everybody has their own preferences, fine, but outside of that overrepresented niche of sexually ambiguous anime and furry there's just... nothing.
Oh my god I need this now
If you work towards correctness by design this gives a certain assurance that you don't get if you do a lot of guesswork and hope for the best.
Meanwhile for example in Poland (EU member), it's illegal to forbid reverse engineering - any claim in a contract, license or not, that forbids such is null & void. Because the copyright law has a paragraph about how "reverse engineering is a right of everyone." - the only thing is that you can't just recompile reversed code and claim it's yours (that would be copyright violation).
> The unauthorised reproduction, translation, adaptation or transformation of the form of the code in which a copy of a computer program has been made available constitutes an infringement of the exclusive rights of the author. Nevertheless, circumstances may exist when such a reproduction of the code and translation of its form are indispensable to obtain the necessary information to achieve the interoperability of an independently created program with other programs. It has therefore to be considered that, in these limited circumstances only, performance of the acts of reproduction and translation by or on behalf of a person having a right to use a copy of the program is legitimate and compatible with fair practice and must therefore be deemed not to require the authorisation of the rightholder. An objective of this exception is to make it possible to connect all components of a computer system, including those of different manufacturers, so that they can work together. Such an exception to the author's exclusive rights may not be used in a way which prejudices the legitimate interests of the rightholder or which conflicts with a normal exploitation of the program.
Directive 2009/24/EC
This would allow you to disassemble and modify any parts of OSX and its drivers in order to help write a Linux driver. Does the same apply in the US?
There were a number of court cases, many involving game consoles (incl. Sega v. Accolade, Galoob v. Nintendo, Sony v. Connectix) that establish that as long as you're not distributing verbatim or other infringing copies of another company's work such as software or chip designs (and you haven't signed any contractual agreements otherwise), you're in the clear. To establish that you are in the clear, clean-room reverse engineering is the recommended approach: one party does the reverse engineering yielding a spec; the other implements the software based on the spec.