21 ms·
Native Linux GPU Driver for Apple M1
- marcodiego 4y agoDoes it need proprietary blobs?
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- asiekierka 4y agoYes, the Apple laptops need a whole host of proprietary blobs for bringup and firmware.
- protoman3000 4y agoThis presentation... Humans are truly amazing.
- argulane 4y agoThis is one of the first Linux kernel driver writen in rust! 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 https://rosenzweig.io/blog/asahi-gpu-part-6.html
- krater23 4y ago
- d3nj4l 4y agoLinus himself is using the work Asahi Linux has put in :)
- viraptor 4y agoMost hardware needs reverse engineering to work - we only got the opensource AMD GPU driver relatively recently. Kernel work is niche in general so really you could say the same thing about Linux itself - yet here we are, it likely works on many devices you use.
- colonwqbang 4y agoIt doesn't particularly matter if a specific kernel module has a big community behind it. 3-4 motivated people would be plenty to maintain a module. The major part of a GPU driver is in userspace, not the kernel. The kernel community have slowly started to embrace rust in recent years. Maybe the community is not so small as you think, or at least won't be in the near future.
- deleted 4y ago[deleted]
- spyremeown 4y agoIt's so comical to see a literal VTuber developer doing absolutely awesome work on an extremely high technical level, and better yet, on HNs frontpage almost every week. God bless anime.
- deleted 4y ago[deleted]
- Thaxll 4y agoThe voice is very annoying though, amazing work none the less.
- rjzzleep 4y agoOMG I just saw it for the first time. That's a nightmare. I didn't expect it to be like this when I read your comment.
- Karsteski 4y agoyea, I tried to watch her livestreams but I can't deal with the voice. Still though, very cool stuff
- unpopularopp 4y agoYeah the voice changer is crazy. Like the work and sometimes I peak the stream. Wish I could watch it with sound but it's unbearable after a couple of minutes.
- riskable 4y agoWhat we need is a highly technical VTuber that's good with audio to work on this problem for us!
- sscarduzio 4y agohe's actually very competent at audio, just he really clings to this hardly intelligible voice filter for some reason.
- Rygian 4y agohttps://github.com/AsahiLinux/linux/tree/gpu/rust-wip/rust/kernel https://github.com/AsahiLinux/linux/tree/gpu/rust-wip/rust/k...
- londons_explore 4y agoThe November 2020 M1 machines are nearly getting to daily usability in Linux. Support for screen brightness adjustment, the webcam, speakers and mic are the remaining things for day to day use for me. All look like they should be working in 6 months-1 year. 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.
- infocollector 4y agoI am waiting to try this on the 16GB RAM M1. M2's have 24G or more available. I think this will be my goto machine for Linux.
- that_guy_iain 4y ago> 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.
- chrisweekly 4y agoDesktop PWA is becoming a pretty reasonable alternative.
- cguess 4y agoI don't want to run a web browser to run a desktop app. I don't care how useful it is to run JS and HTML from a dev standpoint it's an absolutely absurdity that my desktop app has a CORS vulnerability.
- moonchrome 4y agoThen you probably won't get Linux desktop support at all. Linux camp should be cheering electron.
- 4y ago
- angelmm 4y agoI've been following Asahi for some time on twitter. The work she did is incredible and everything was streamed and the recordings are available in Youtube. In case you're curious about the process, here you have her YouTube profile: https://www.youtube.com/AsahiLina https://www.youtube.com/AsahiLina
- toxik 4y agoWow, that's certainly a novel way to disseminate technical information. I could not stand it, and I'm not very dismissive of geek content.
- stewx 4y agoThe live anime avatar and high-pitched vocal conversion are... idiosyncratic, to say the least
- londons_explore 4y agoIs there software that does this? Or is it custom made?
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- 4y ago
- Aissen 4y agoIncredibly fun hack to make it work (start of the video): TLB flushing is a bit hard, so let's reset the GPU after each frame(!!!). And at the rate this advances, this comment will probably be obsolete in less than a week !
- NoGravitas 4y agoThe standard solution: turn it off, and turn it back on.
- sitkack 4y agoMicroreboot – A Technique for Cheap Recovery https://csis.pace.edu/~marchese/CS865/Papers/candea_microreboot.pdf https://csis.pace.edu/~marchese/CS865/Papers/candea_microreb...
- macintux 4y agoEven earlier: Erlang. https://erlang.org/download/armstrong_thesis_2003.pdf https://erlang.org/download/armstrong_thesis_2003.pdf
- fomine3 4y agoThat how Apache prefork + mod_php work
- gjsman-1000 4y agoSome added context: Many may be reading this the first time and wondering, What gives with the NVIDIA drivers (Nouveau)? 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.
- zozbot234 4y agonVidia only requires signed firmware starting from 2nd-gen Maxwell cards (released late 2014). There's a lot of existing nVidia hardware that could be fully supported.
- kelnos 4y ago8 years is pretty old in GPU years. Certainly that old hardware is still useful, but not if you're doing anything where modern GPU performance is helpful, or even necessary.
- mschuster91 4y ago> There's a lot of existing nVidia hardware that could be fully supported. 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.
- pabs3 4y ago
- dis-sys 4y agoThis whole linux on Apple M1/M2 thing is the best proof that Linux is always a very good fit fort next gen hardware/software/developers. 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!
- mwest217 4y ago
- throwaway08642 4y ago
- neonsunset 4y ago
- Cyberdog 4y ago
- neonsunset 4y ago
- gjsman-1000 4y ago
- extrememacaroni 4y agoAttempting to doxx vtubers is in worst taste, just fyi.
- gjsman-1000 4y ago
- renewedrebecca 4y agoMaybe it would be good to keep bullshit conspiracy theories and doxxing behavior to other sites. We don’t need it here too.
- Aissen 4y agoWhen someone asks you to please not speculate on their personal life, it's the polite thing to not do it: https://twitter.com/LinaAsahi/status/1575450309907795968 https://twitter.com/LinaAsahi/status/1575450309907795968
- gjsman-1000 4y ago
- rvz 4y ago> Also, it is not unfair to ask questions considering people are donating money for this. Anyone who is donating money to both, to discover they may be the same entity, should be rightly upset. Exactly, that's the point of a AMA (Ask Me Anything). You can literally ask them anything and as I presume you or others have paid / donated money to them and need to know what they are paying for or towards and who is doing it, for transparency purposes. That isn't doxxing, that's transparency (Especially if you paid or donated for this.) Now, for 'transparency', name please?
- dis-sys 4y agoFrom memory, EU used to have very strict laws against reverse engineering. Is that still the case today? I mean this whole thing is pretty much based on reverse engineering the GPU.
- fps_doug 4y agoThat's the US. EU is fine.
- SeanLuke 4y agoThe US largely has laws against reverse engineering hardware for the purpose of circumventing copyright protection. But that's not happening here. What other laws were you thinking of?
- fps_doug 4y agoAFAIU, in the US to be on the safe side, you need to apply clean room reverse engineering, no matter the goal. In the EU, as soon as it's in the name of interoperability, reverse engineering is fine: > 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?
- phkahler 4y agoWould love to see Solvespace running on that. The Mac version does run native on M1 already and the OpenGL requirement isn't to high.
- Rygian 4y ago"Please temper your expectations: even with hardware documentation, an optimized Vulkan driver stack (with enough features to layer OpenGL 4.6 with Zink) requires many years of full time work. At least for now, nobody is working on this driver full time3. Reverse-engineering slows the process considerably. We won’t be playing AAA games any time soon." From https://rosenzweig.io/blog/asahi-gpu-part-6.html https://rosenzweig.io/blog/asahi-gpu-part-6.html
- bscphil 4y agoYeah, it's because of this statement from an extremely trustworthy source that I'm looking for context here. I suspect most of the big problems haven't been suddenly and magically overcome? E.g. how close are we, given this, to supporting an AAA game, let's say from a few years ago?
- asiekierka 4y agoThe key words are "optimized" and "OpenGL 4.6 with Zink". "Functional" and "OpenGL 2.1" is a different story, and the same trustworthy source said in https://rosenzweig.io/blog/asahi-gpu-part-6.html https://rosenzweig.io/blog/asahi-gpu-part-6.html that: > 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.
- bscphil 4y agoAh, so it's a "90% of the iceberg" situation. Great info, thanks!
- stu2b50 4y agoWhat AAA games run not only on Linux, but ARM Linux? This is more for going on YouTube with hardware acceleration than gaming, which is niche upon niche in its current state anyway.
- lnyan 4y agoAlso check out Alyssa Rosenzweig's "Dissecting the Apple M1 GPU" series - https://rosenzweig.io/blog/asahi-gpu-part-1.html 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-2.html, https://rosenzweig.io/blog/asahi-gpu-part-3.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-4.html, https://rosenzweig.io/blog/asahi-gpu-part-5.html https://rosenzweig.io/blog/asahi-gpu-part-5.html, https://rosenzweig.io/blog/asahi-gpu-part-6.html https://rosenzweig.io/blog/asahi-gpu-part-6.html
- obert 4y agowhat’s the app he used for the overlay avatar?
- cesarb 4y agoIt's mentioned in the description for the video: "Animated using Inochi2D by Luna the Foxgirl (https://twitter.com/LunaFoxgirlVT https://twitter.com/LunaFoxgirlVT https://twitter.com/Inochi2D https://twitter.com/Inochi2D)" And going through the twitter link you can find the homepage for that software is at https://inochi2d.com/ https://inochi2d.com/ (the other twitter link gets you the homepage for the developer of that software at https://github.com/LunaTheFoxgirl https://github.com/LunaTheFoxgirl).
- naikrovek 4y agoi don’t understand things like that avatar. maybe i’m too old. [ 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.
- deleted 4y ago[deleted]
- kzrdude 4y ago(Am I also old, I ask myself?) I don't like the distorted voice but the thought of making an avatar and hiding behind it, instead of showing one's face in a video, sounds good. I wouldn't mind using the image of an anime girl either.
- denysonique 4y agoAmazing, now the only missing thing is a proper trackpad driver.
- waynesonfire 4y agoHow is a gpu driver ported? Isn't it proprietary? From a past article, reversing a printer protocol was derided for its complexity and there is a wire to snoop.
- stirlo 4y agoThe main asahi dev is a reverse engineering legend who previously worked on both Nintendo Wii and PS3/4. I think the apple hardware is probably easier to reverse than those platforms.
- outworlder 4y agoThe driver is not ported, it's reverse engineered. > 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.
- viraptor 4y agoThere's also a "wire" to snoop here. Marcan wrote m1n1 which allows you to run Mac virtualised and shows the hardware communication.
- deleted 4y ago[deleted]
- jacooper 4y agoGreat work, the v-tuber wierd thing doesn't affect of the value of this work.
- humanistbot 4y agoSpeak for yourself, I could barely understand the content due to the high pitch and speed of the vocoder. I hate video tutorials in general though, I really wish this was a blog post.
- naikrovek 4y agowhy would they speak for anyone but themselves? and why would you think they were doing so?
- humanistbot 4y agoIt is an expression, another way of saying "You might feel that way, but I don't" See https://idioms.thefreedictionary.com/speak+for+yourself https://idioms.thefreedictionary.com/speak+for+yourself
- naikrovek 4y agomeh expressions like that don't make sense to me. all these people everywhere saying things that don't make sense just because someone else said it before them. it's all just peer pressure from books and dead people. meanwhile I'm over here trying to understand and participate in conversations and no one cares about people who take words at face value. I hate this goddamned planet
- KAMSPioneer 4y agoSpeak for yourself, I enjoy using idiomatic phrases because I like conveying nuance and expressing myself using a common phrases. :)
- rufusroflpunch 4y agoI'm just getting old, I do not understand VTubers or the appeal.
- atty 4y agoComplete speculation on my part, but I think the biggest appeal is supply side, that people can be Internet personalities with an avatar without sharing their real identity. That helps a lot of people who would like to start sharing content but are otherwise too shy, or for various reasons think they can’t/shouldn’t use their real identity. 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.
- sph 4y agoMaybe I'm old too, but I don't have a problem with avatars and virtual ones, it's the extremely high pitch and cartoony voices VTubere tend to have. And why does it have to be anime or furry aesthetic every time? 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.
- jmyeet 4y agoI'm in awe of anyone who can reverse engineer and build a driver for something like this that isn't documented at all (AFAIK). Impressive stuff. And to use that knowledge to contribute to Linux is a great thing. Kudos to everyone involved.
- simonw 4y agoCan anyone explain why it's hard to get GPU-accelerated ML libraries such as Torch running on a Mac (Intel or M1/M2)?
- atty 4y agoIn each library, their operations need to be implemented for each backend separately (CPU, GPU, TPU, etc). All of these libraries support CUDA as their default GPU implementation because it’s by far the largest in terms of market share. But since Apple GPUs do not implement CUDA or a translation layer (they use Metal, Apples graphics and compute acceleration library), that means all those mathematical operations need to be rewritten targeting Metal before torch can even communicate usefully with an M1/M2 GPU. That doesn’t even touch on the fact that different backends need to have work scheduled on them slightly differently. Some expect a graph of operations to be submitted, some are just submitted as a series of asynchronous operations, etc. Also just wanted to point out that torch does support Apple GPUs now, however.
- spullara 4y agoThe nightly of PyTorch does run on the M1 GPU.
- johnnymarr666 4y agowow this is so impressive! absolutely stunning work!
- ianbutler 4y agoThis work on Asahi Linux is some of the more impressive work I’ve been following. To basically reverse engineer undocumented hardware features and get Linux running on them in such a low amount of time is nothing short of inspiring.
- noveltyaccount 4y agoWow, this is impressive. 2022 may finally be the year of Linux on the desktop! ;)
- amelius 4y agoBut running on undocumented hardware, so without any guarantees.
- gpm 4y agoYou say that like Linux, or really any other consumer software, comes with guarantees on any other hardware.
- amelius 4y agoOf course, guarantees in the non-legal sense of the word. 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.
- gpm 4y agoI'd be more sympathetic to this argument, by a lot, if I wasn't constantly encountering bugs in systems where there wasn't (or shouldn't have been) any guesswork needed. To (substantially) rephrase the point, you're saying "there's this additional source of bugs" without an argument that it's a significant enough source that it will stand out against the background of all the other sources of bugs. There's also a strange flip side where abnormally competent people are doing the work, so I might even believe the bug-rate is likely lower than average.
- rowanG077 4y agoThis! In fact my experience generally is that things that are supported by "hobbyists" work better then official stuff.
- 4y ago
- deleted 4y ago[deleted]
- tbrock 4y agoThis is so technically cool and an amazing achievement but wow what an odd video.
- brokenmachine 4y agoAlthough I'm thoroughly impressed and applaud people for doing this in their spare time, I sort of wish they wouldn't help Apple in their developer-hostile actions. If Apple don't want to release documentation on their chips, then leave them to rot in their walled garden.
- Wowfunhappy 4y agoI mean, I guess there are various degrees of hostility. When Apple ported their iOS bootloader to the new Macs, they purposefully added the ability to boot third-party operating systems. They just didn't tell anyone how to actually build a third-party operating system.
- flyinghamster 4y agoExactly the middle ground, but it's a shame so much has to be reverse-engineered due to lack of documentation. It's quite a contrast from the Apple II, which came complete with schematics and a ROM listing. Obviously, today's computers are nowhere near as simple, but I hate seeing more and more about our systems becoming jealously guarded secrets. Nonetheless, a half-step like this is vastly better than the locked bootloaders, jailbreaking, and outright hostility of the smartphone/tablet/console world.
- soheil 4y agoWhat's the relevance of the anime theme in the linked video? It also doesn't show any of the points discussed in the tweet.
- bni 4y agoI don't get all the griping about "Wasted development effort" and "Apple doesn't have documentation". Linux was about making it work on different platforms from the very beginning. There was never any vendor support.
- tinco 4y agoPeople take so much for granted. It was decades until the graphics cards manufacturers ever saw Linux support as a serious issue. Linux made itself a serious platform by this kind of "wasted effort" and if you go even earlier in the history of Linux, it itself was maintained by enthousiasts that many considered "wasted effort" because Linux was an amateur operating system that was never going to have vendor support or even run production grade software. Cynics are gonna cynic. But it's people like Asahi that get shit done and move the world forward.
- PascalPixel 4y agoThis is incredibly amazing, code wizardry.
- thehias 4y agoEverybody knows that marcan = AsahiLina. I guess he just does V-Tubing for fun? I don't know and I don't understand, I find the voice and the background music also a bit annoying, but its fine... his/their work is great!!
- Wowfunhappy 4y agoMarcan directly said at one point that AsahiLina wasn't him. But, I can't tell if it's really not him or if it's "not him" as in "it's not me, it's my character" and he wants it to be ambiguous.