4 ms·
I am astonished by the progresses made by the Asahi folks. In particular, having been a Linux user for the past 15 years or so, I can't wrap my head around the
by butokai 4y ago
I am astonished by the progresses made by the Asahi folks. In particular, having been a Linux user for the past 15 years or so, I can't wrap my head around the fact that a single developer can get such impressive results in reverse engineering a device --- be it storage, Bluetooth, and now even the GPU!
How can this be so different from the situation with, say, the nvidia drivers, or even many wi-fi drivers, where it took years of effort from the community before reaching fully working drivers?
- tambourine_man 4y agoSame. GPU in particular, seems like magic to a layman’s eye like mine. Bluetooth and WiFi reverse engineering is something I can conceptually grasp from afar, especially because they should be relatively similar across architectures. They are well defined protocols, you send and receive packages. OK. But GPUs are such complicated beasts, each on it’s own snowflakey way, I don’t even understand how the work on a deep level, let alone imagine how reverse engineering would begin. Memory access and sharing with the CPU, shaders, a massively parallel computing model. Crazy stuff. Oh, and you also get to draw lots of triangles really fast while you’re at it.
- rvz 4y ago> How can this be so different from the situation with, say, the nvidia drivers, or even many wi-fi drivers, where it took years of effort from the community before reaching fully working drivers? Support for Apple Silicon has much less device combinations to deal with unlike what you see with other devices. There is only one type and fixed set of GPU, storage, wifi, bluetooth drivers to support vs the hundreds of hundreds of GPU variants, with the infinite combinations of other devices found on PCs. Also the so-called 'open-sourcing' of the Nvidia drivers which got the Linux fans too excited, only to be disappointed to realise that Nvidia was not only still working against them, but the news of this announcement turned out to be a red herring. Pushing GPU FFI wrapper code to binary blobs is still not 'open-source'.
- Topgamer7 4y agoMarcan is quite the talented reverse engineer and low level engineer. From watching him on YouTube, and a small bit of research into his past (Wii/PS3 pwning), he figures out ways to creatively solve problems, and provide himself with fast feedback on the tough problems he works on. M1n1 is case and point.
- zozbot234 4y ago> How can this be so different from the situation with, say, the nvidia drivers, or even many wi-fi drivers, where it took years of effort from the community before reaching fully working drivers? They only have to get a single device model to work, with perhaps a handful of small variations. Monoculture has its benefits.
- monocasa 4y agoIt also seems quite a bit saner than a lot of GPUs from what I've read of the code released so far.
- deleted 4y ago[deleted]
- sidkshatriya 4y agoMy guess is that the Mx GPU is probably the toughest target for reverse engineering -- as it is very unique to Apple. It will probably take many years to reverse engineer. I believe the Asahi Linux X11/Wayland graphics interface still works on the CPU today (Mesa) and _not_ the GPU. I don't think they have the GPU working except for small proof of concept things. In general, I think the porting effort depends on whether Apple has used a freely available industry component. So if the WiFi chip is something that is available in a non-Apple system, one could tweak the AArch64 Linux driver a bit and get it to work on AArch64 Mx Linux. If the silicon is totally custom I can imagine the task being much more difficult. My guess is that many of the components on which Asahi Linux has made good progress in porting over to work have good support already on vanilla AArch64 Linux. Understanding the integration and working around Apple's proprietary sauce, of course, makes the task totally non-trivial.
- unmole 4y agoDrivers for things like WiFi are generally platform independent.
- sidkshatriya 4y ago> Drivers for things like WiFi are generally platform independent. For the core of the driver that may be true. Ultimately the driver needs to _interface_ with the platform (and the OS) and for that custom code needs to be done to account for platform and OS differences. You cannot abstract away everything.
- gjsman-1000 4y agoThis is not correct. Right now, the GPU Driver for Asahi Linux is not written in Rust/C++ yet (because that's a lot of work). Instead, the prototype driver is written in Python, and when it is done, then it will be rewritten in Rust/C++ once it works correctly. It runs on a host system, receives OpenGL calls (like the demo application shown at the bottom), and then creates a pile of GPU instructions that are then sent over USB to run on the real GPU in the m1n1 preboot environment. So, in practice, the GPU is being reverse-engineered, is doing the rendering, it's just that the OpenGL -> GPU layer is being handled outside Linux in a simpler language for development speed. This prototype GPU driver has 94% openGLES test suite compliance at this point. > It will probably take many years to reverse engineer. The last 6% is probably decently hard, but it will probably not be terribly hard to finish - and not long for this team thereafter to change the Python code into an actual Linux driver considering the sheer number of drivers they've already written. Once you have openGLES, you have a HW-accelerated desktop, at least through most desktop environments. Video acceleration is another story they haven't started on, but its generally easy by comparison. Might take another year or two for full OpenGL or Vulkan though.
- pantalaimon 4y agoThey have a patreon with over 1000 sponsors and afaiu marcan is working on the project full time. So I would assume it's mostly developer resources that make the difference.
- humanwhosits 4y agoI think I read somewhere that he never actually got to the sponsorship level he wanted for doing this full time
- mort96 4y agoThe open-source nvidia drivers are hard because nvidia is apparently deliberately making it difficult: https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/open-source-nvidia-linux-nouveau/998310-nouveau-persevered-in-2017-for-open-source-nvidia-but-2018-could-be-much-better#post998316 https://www.phoronix.com/forums/forum/linux-graphics-x-org-d..., https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/open-source-nvidia-linux-nouveau/998310-nouveau-persevered-in-2017-for-open-source-nvidia-but-2018-could-be-much-better/page4#post998427 https://www.phoronix.com/forums/forum/linux-graphics-x-org-d.... The Asahi people have been pretty clear that, while Apple doesn't do much to _help_ alternative OSes, they haven't done anything to _hurt_ them either, and have explicitly opened up their bootloader so that it's able to boot alternative OSes. The Asahi people don't have to figure out how to circumvent restrictions, they're "just" doing normal reverse engineering stuff. And yeah, it helps that there's just a tiny amount of Mac hardware compared to PC hardware. If you get any arbitrary wifi chip to work with Linux, then congrats, you just made like 2 or 3 of the thousands of PC laptops work. But if you get the wifi chip Apple uses in their laptops to work, then you might've gotten wifi to work on multiple generations of Mac laptops.