9 ms·
An Update on Apple M1/M2 GPU Drivers
- renewiltord 2y agoThe work by Alyssa R and Asahi Lina is great stuff. I have to say that a lot of this is really inscrutable unless you’re used to driver code. I wish it were much easier to write this stuff but hardware stuff is so idiosyncratic. Have to say I do enjoy all the old school style whimsy with the witch costume and whatnot.
- dylan604 2y agowhat they do is just this side of magic, so maybe it's not really a costume?
- gjsman-1000 2y ago[flagged]
- slekker 2y agoIs that a fact or are you speculating?
- gjsman-1000 2y ago[flagged]
- stepupmakeup 2y agoThere was drama with Lina and another person in the vtuber hacker space who directly referred to them as marcan.
- tredre3 2y agoMarcan42 accidentally posted on his twitter as Asahi Lina, and on screen Lina has accidentally shown things identifiable to Marcan (usernames, logged in mastodon account). But he clearly doesn't want to be linked/equated to her for whatever reason, so I don't know why GP brought this up beyond stirring up drama.
- userbinator 2y ago[flagged]
- Teever 2y agoIs that actually the purpose though? The appearance of diversity? Maybe marcan42 just wants to present themselves that way.
- gjsman-1000 2y ago[flagged]
- colechristensen 2y agoAre you being offended for yourself or on behalf of other people? If the latter, please leave that for others to judge for themselves.
- gjsman-1000 2y ago[flagged]
- talldayo 2y agoThere's something rich about this gjsman showing up to defend Apple as an unpaid lackey, and inventing controversy to justify hating the opposition. I'd say something like "I wonder what it's like inside this user's head" but it seems like their deepest insecurities have been made quite external by now.
- colechristensen 2y agoHere it is best to not engage or add any volume to discussions like this. How you get a community that isn't infested with shallow controversy is by not giving it any attention but small amounts of gentle discouragement.
- deleted 2y ago[deleted]
- TimTheTinker 2y ago[flagged]
- renewiltord 2y agoYeah, the culture war stuff is a big deal for people who don’t write code. But I don’t think their opinions are that important for Linux kernel. Pretty effective to have it as honeypot. Allows for easy programmatic filter out for non-coders.
- gjsman-1000 2y ago[flagged]
- MrBuddyCasino 2y ago[flagged]
- hi_hi 2y agoI've just been watching her recent talk. I noticed she appears to change slides with a wave of her wand. Is there an known piece of hardware one can purchase to do this? I tried googling, but trying to find the specific result I'm interested in amongst all the blog spam garbage related to powerpoint is beyond me. Even googles own AI couldn't help. Sad times!
- sen 2y agoShe might be doing some OpenCV/MedaPipe gesture tracking? There's lots of tutorials out there and it's not super difficult to get some basic gesture tracking going on your laptop.
- bryanlarsen 2y agoPurchasing one has been illegal since 1863, but the technology typically used is a human assistant, although the signal is usually more subtle.
- sroussey 2y agoUg… a person is watching and clicking for her when she does that?
- Onavo 2y agoIs Leap Motion still a thing?
- m4rtink 2y ago
- UncleOxidant 2y agoWill M3/M4 need completely different drivers?
- wmf 2y agoProbably. Apple made major changes to the GPU in M3.
- a_wild_dandan 2y agoWhat were the major differences?
- coldtea 2y agoMajor base changes, or just added more stuff on top of the same base?
- wtallis 2y agohttps://forum.beyond3d.com/threads/apple-dynamic-caching-on-m3-gpu.63419/ https://forum.beyond3d.com/threads/apple-dynamic-caching-on-... Changing the register file into a cache sounds like a major base change. Raytracing is a major feature added on top of existing functionality. So I'd say the answer is: plenty of both.
- ferbivore 2y agoM3 has mesh shader support. The geometry pipeline they inherited from PowerVR fundamentally doesn't support them, for reasons that go way over my head. They probably changed a good chunk of it.
- olliej 2y ago> for reasons that go way over my head In fairness to you I think a lot of the stuff involving hardware goes over everyone's heads :D I've seen comments in a number of articles (and I think a few comments in this thread) saying that there are a few features in Vulcan/opengl/direct3d that were standardized ("standardized" in the D3D case?)/required that turned out to be really expensive to implement, hard to implement fast in hardware anyway, and not necessarily actually useful in practice. I think geometry shaders may have been one of those cases but I can't recall for sure.
- scottlamb 2y ago> tessellator.cl is the most unhinged file of my career ...so far. The presenter is only 23 apparently. Maybe I'm speaking only for myself here, but I think career unhingedness does not go down over time as much as one might hope. In all seriousness, she does really impressive work, so when she says this 2,000 lines of C++ is inscrutable, that gives one pause. Glad it's working nonetheless.
- dividuum 2y agoI guess it's these two files? The original 2600+ lines of C++: https://gitlab.freedesktop.org/asahi/mesa/-/blob/main/src/gallium/auxiliary/tessellator/tessellator.cpp https://gitlab.freedesktop.org/asahi/mesa/-/blob/main/src/ga... The translated code: https://gitlab.freedesktop.org/asahi/mesa/-/blob/main/src/asahi/lib/shaders/tessellator.cl https://gitlab.freedesktop.org/asahi/mesa/-/blob/main/src/as...
- kachapopopow 2y agoI always wondered about these /SubscriberLink/ links. Is sharing them considered unethical?
- deleted 2y ago[deleted]
- anamexis 2y agoFrom the LWN FAQ: > Where is it appropriate to post a subscriber link? > Almost anywhere. Private mail, messages to project mailing lists, and blog entries are all appropriate. As long as people do not use subscriber links as a way to defeat our attempts to gain subscribers, we are happy to see them shared.
- vintagedave 2y agoIt says, > The following subscription-only content has been made available to you by an LWN subscriber. I might be wrong but I read that as there being funding to make the previously paywalled content available, probably on an article-specific basis. Does anyone know?
- anamexis 2y agoAlso from the LWN FAQ: > What are subscriber links > A subscriber link is a mechanism by which LWN subscribers may grant free access to specific LWN articles to others. It takes the form of a special link which bypasses the subscription gate for that article.
- cbhl 2y agoThe purpose of these links is to be shared, see the FAQ: https://lwn.net/op/FAQ.lwn#slinks https://lwn.net/op/FAQ.lwn#slinks The LWN paywall is unique in that all the content becomes freely available after a week. The subscriber links are there to encourage you to subscribe if you are in a position to do so.
- sophacles 2y agoRepresentatives of LWN have posted here before saying they are OK with it, along with a polite request not to have it go overboard since they need to fund the site and writers, editors, etc. That funding comes from subscriptions only IIUC. FWIW an LWN subscription is pretty affordable and supports some of the best in-depth technical reporting about Linux and linux-related topics available. (I am not affiliated with LWN, just a happy subscriber - I also credit some of my career success to the knowledge I've gained by reading their articles).
- gigatexal 2y agoIs anyone else astonished at how much is missing in the hardware and how much is emulated?
- jsheard 2y agoThe things being emulated are mostly legacy features that are barely used in modern software, if at all, so the overhead of emulating them for backward compatibility isn't the end of the world. I can't blame Apple for not supporting geometry shaders in hardware, when they're widely considered to be a mistake that never should have been standardized in the first place, and Metal never supported them at all so they could only ever come up in old OpenGL code on macOS. https://x.com/pointinpolygon/status/1270695113967181827 https://x.com/pointinpolygon/status/1270695113967181827
- raverbashing 2y agoTessellation does not seem to fit this description though
- parl_match 2y agoI wouldn't go so far as to say "mistake that should never have been standardized". Their intended use was always pretty limited, though. There's zero reason for anything built in recent memory to use them.
- jsheard 2y agoThey had limited uses and turned out to be incredibly hard to implement efficiently in hardware, so in practice it was nearly always faster to just keep using the proven techniques that GS was supposed to replace. http://www.joshbarczak.com/blog/?p=667 http://www.joshbarczak.com/blog/?p=667
- RantyDave 2y agoSo why does instancing suck? I would have thought it would be heavily optimised in the driver...
- egwor 2y agoReally impressive. Well done (and thanks for the laughs. Starting in French would be so funny)
- recvonline 2y agoAny link to the fact that the drivers are written in Rust?
- hoherd 2y agohttps://asahilinux.org/2022/11/tales-of-the-m1-gpu/ https://asahilinux.org/2022/11/tales-of-the-m1-gpu/ > Since this was going to be the first Linux Rust GPU kernel driver, I had a lot of work ahead! Not only did I have to write the driver itself, but I also had to write the Rust abstractions for the Linux DRM graphics subsystem. While Rust can directly call into C functions, doing that doesn’t have any of Rust’s safety guarantees. So in order to use C code safely from Rust, first you have to write wrappers that give you a safe Rust-like API. I ended up writing almost 1500 lines of code just for the abstractions, and coming up with a good and safe design took a lot of thinking and rewriting! Also https://github.com/AsahiLinux/linux/blob/de1c5a8be/drivers/gpu/drm/asahi/gpu.rs https://github.com/AsahiLinux/linux/blob/de1c5a8be/drivers/g... where "drm" is https://en.wikipedia.org/wiki/Direct_Rendering_Manager https://en.wikipedia.org/wiki/Direct_Rendering_Manager
- karunamurti 2y agoI particularly like line 1322 and 1344
- computersuck 2y agoThat's not even a costume because she's definitely a wizard
- adastra22 2y ago> frankly, I think ray tracing is a bit of a gimmick feature That's incredibly arrogant. The whole industry is adopting ray tracing, and it is a very desired feature people are upgrading video cards to get working on games they play.
- madeofpalk 2y agoThe same was true about 3D TVs. Also a gimmick.
- talldayo 2y ago3D TVs failed before they existed as a product category. You cannot encode enough information through stereoscopy to create a convincing or "realistic" 3D effect. The conditions for making it work have always been fickle and as 6DOF VR/AR is proving, it was never enough to be convincing anyways. Encoding two slightly different versions of a video and layering them on top of each other is a dirty hack. It is not a holistic solution to a problem they seriously intended to solve in the first place. It is a novelty designed from the bottom-up as a scarcely-usable toy. Ray tracing is, by comparison, the holy grail of all realtime lighting effects. Global illumination makes the current raster lighting techniques look primitive by comparison. It is not an exaggeration to say that realtime graphics research largely revolves around using hacks to imitate a fraction of ray tracing's power. They are piling on pipeline-after-pipeline for ambient occlusion, realtime reflections and shadowing, bloom and glare as well as god rays and screenspace/volumetric effects. These are all things you don't have to hack together when your scene is already path tracing the environment with the physical properties accounted for. Instead of stacking hacks, you have a coherent pipeline that can be denoised, antialiased, upscaled and post-processed in one pass. No shadowmaps, no baked lighting, all realtime. There is a reason why even Apple quit dragging their feet here - modern real-time graphics are the gimmick, ray tracing is the production-quality alternative.
- adastra22 2y agoThank you. This guy gets it. Path tracing is the gold standard for computer graphics. It is a physically based rendering model that is based on how lighting actually works. There are degrees of path tracing of varying quality, but there is nothing else that is better from a visual quality and accuracy standpoint. Your modern AAA title does a massive amount of impressive hacks to get rasterization into the uncanny valley, as rasterization has nothing to do with how photons work. That can all be thrown out and replaced with “model photons interacting with the scene” if the path tracing hardware was powerful enough. It’d be simpler and perfectly accurate. The end result would not live in the uncanny valley, but would be indistinguishable from reality. Assuming the hardware was fast enough. But we’ll get there.
- olliej 2y agoAlyssa is amazing, I remember the first article about the GPU work, and then learning she was only 17 and poof mind blown. It's truly stunning that anyone could do what she did, let alone a teenager (yes I know, she's not a teenager anymore, passage of time, etc :D)
- Daz1 2y ago[flagged]
- gcr 2y agoI’ve been trained to expect articles with this headline to say something like “we’re dropping support and are getting acqui-hired.”
- m463 2y ago"our target hardware is running literally none of those things". What is needed is to somehow translate DirectX to Vulkan, Windows to Linux, x86 to Arm64, and 4KB pages to 16KB pages. oh my.
- deleted 2y ago[deleted]
- kristianp 2y agoI was going going to say she should work for Valve to help get Steam working on Linux on Macs, but it seems she already does? [1] [1] https://en.wikipedia.org/wiki/Alyssa_Rosenzweig#Career https://en.wikipedia.org/wiki/Alyssa_Rosenzweig#Career
- jillesvangurp 2y agoNice; that raises some interesting questions as to what Valve is planning here. Steam/Proton on macs would make a lot of sense for them hard as it may be. People booting linux on their macs to play games would really annoy Apple probably.
- Dah00n 2y ago>Steam/Proton on macs would make a lot of sense ..... would really annoy Apple probably Sounds like a win-win situation.
- galleywest200 2y agoThere was a Proton for ARM test build [1] that got talked about recently, your guess is entirely possible. [1] https://www.tomshardware.com/video-games/pc-gaming/steam-likely-coming-to-arm-chips-with-support-for-hundreds-of-windows-games-valve-testing-arm64-proton-compatibility-layer https://www.tomshardware.com/video-games/pc-gaming/steam-lik...
- GeekyBear 2y ago> People booting linux on their macs to play games would really annoy Apple probably. You dont have to boot Linux to play PC games on Mac. Apple already provides the tools you need to build a Mac native equivalent to Proton. There are several options built using those tools, both paid {Crossover) and free/open source (Whisky). Whisky combines the same ooen source Wine project that Proton leverages with Apple's Rosetta x86 emulation and Apple's DirectX emulation layer (part of the Game Porting Toolkit) into a single easy to use tool. https://getwhisky.app/ https://getwhisky.app/
- 2y ago
- whitehexagon 2y agoWhat I really respect is the dedication to completing support for the M1/M2. Too many projects get dropped the moment the next shiny ray-traced toy comes along. I know this type of work can be challenging to say the least. My own dabble with Zig and Pinephone hardware drivers reminded me of some of the pain of poorly documented hardware, but what a reward when it works. My own M1 was only purchased because of this project and Alyssa's efforts with OpenGL+ES. It only ever boots Asahi Linux. Thank-you very much for your efforts.
- Cthulhu_ 2y agoOne thing I noticed in the M4 macbook announcement comments was how many people were happy with their M1 laptop, and second, how many people kept their Macbooks for nearly a decade; these devices are built to last, and I applaud long-term support from Apple itself and the Linux community. Second, since it's open source, Apple themselves are probably paying attention; I didn't read the whole thing because it's going over my head, but she discussed missing features in the chip that are being worked around.
- TrainedMonkey 2y agoUnderrated point, maybe it's aluminum unibody or more stable OS, but in my experience average MBP lifetime is meaningfully higher compared to a windows machine. My longest lasting windows machine was T400 Thinkpad which lasted 5 years before Core 2 Duo architecture stopped being able to keep up. It got replaced with HP Envy with great specs but made out of plastic which barely lasted 1.5 years before screen fell off (literally). Replaced with 17" 2014 MBP which is still alive after SSD replacement.
- throw88888 2y agoIf you replaced the T400 because it felt slow, maybe it’s just a software/OS issue. The hardware on Thinkpad T-models should last longer than just 5 years in general. My daily-driver laptop at home is a T420 from 2011 with a Core 2 Duo, SSD and 8GB RAM. Works fine still. I run Linux + OpenBox, so it is a somewhat lightweight setup to be fair.
- trallnag 2y ago[flagged]
- gellyi 2y ago[flagged]
- skoczko 2y agoSince bringing modern OpenGL and Vulkan onto Apple Silicon is impossible without an emulation layer anyway, could, theoretically, a native Metal API for Linux be created? Or is Metal too ingrained in macOS SDKs? MoltenVK is attempting to solve the same issues Alyssa was talking about in her talk [1, the last comment on the issue is hers] [1] https://github.com/KhronosGroup/MoltenVK/issues/1524 https://github.com/KhronosGroup/MoltenVK/issues/1524
- Twisell 2y agoNothing is barring Apple from supporting Vulkan natively on MacOS. This is essentially the closing statement of Alyssa Rosenzweig´s talk. With Apple knowledge of internal documents they are the best positioned to produce an even better low level implementation. At this point the main blockroad is the opinionated point that Metal porting is the only official supported way to go. If Valve pull up a witch-crafted way to run AAA games on Mac without Apple support that would be an interesting landscape. And maybe would force Apple to re-consider their approach if they don't want to be cornered on their own platform...
- bri3d 2y ago> If Valve pull up a witch-crafted way to run AAA games on Mac without Apple support that would be an interesting landscape. And maybe would force Apple to re-consider their approach if they don't want to be cornered on their own platform... Right, except that Game Porting Toolkit and D3DMetal was an exact response to this scenario. Whether it's the right approach, time will tell, but Apple definitely already headed this one off at the pass.
- 6SixTy 2y agoGame Porting Toolkit isn't a response in this scenario. All advertising for GPTK is aimed squarely at publishers, and even Whiskey has to pull a binary out of a back alley for D3DMetal. Apple is essentially doing nothing and hoping it works.
- GeekyBear 2y ago
- wwalexander 2y agoAlyssa Rosenzweig deserves a Turing Award!
- helsinki 2y agoAlyssa's solution to the 4KB vs. 16KB page size discrepancy by running everything in a virtual machine feels like both a clever hack and a potential performance bottleneck. It makes me wonder about the long-term implications of such workarounds. Are we reaching a point where the complexity of bridging these gaps outweighs the benefits, especially when dealing with proprietary hardware designed to be a closed ecosystem? This also touches on a broader question about the future of open-source efforts on platforms that are inherently restrictive. While it's inspiring to see games like Control running at 45fps on an M1 MAX with open-source drivers, it begs the question: Should the community continue to invest significant resources into making closed systems more open, or should efforts be redirected toward promoting more open hardware standards? Apple's approach to hardware design warrants criticism. By creating GPUs with limitations that hinder standard functionalities like tessellation shaders and using non-standard page sizes, Apple places unnecessary obstacles in the path of developers. This closed ecosystem not only complicates the work for open-source contributors but also stifles innovation that could benefit all users.
- i000 2y agoWhat do you mean by “should the community do X” ? The Community is not some form of organisation with a mission and objective, it is a loose collection of individuals free to put their talents and explore intersts into whatever they please. You imply that this creative and inspiring work somehow stifles innovation and hurts users which is frankly absurd.
- helsinki 2y agoYou should re-read the last paragraph of my comment and note that it is directed towards Apple.
- i000 2y agoI said ‘imply’ because your response is not to an article on apples walled garden but work of open source developers. I agree with you 100% on criticizing apple but not on whether someone should put effort in making it more open.
- flkenosad 2y agoI love her. Keep up the incredible work Alyssa.
- mmaniac 2y agoI'm not sure I've ever seen a bigger case of pissing in the wind than Asahi Linux. I respect the dedication but it takes a special kind of personality to not wash their hands of an affair like this.