News for hackers. Stuff that matters.
Re:Native Linux GPU Driver for Apple M1 by bityard on Thursday September 29, 2022 @01:55PM (#33024632)
Totally non-sarcastic question: then why bother?

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.

Re:Native Linux GPU Driver for Apple M1 by bri3d on Thursday September 29, 2022 @02:23PM (#33025026)
There's a much lower standard than "AAA gaming" which still delivers massive value to most users in running a desktop environment.

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.

Re:Native Linux GPU Driver for Apple M1 by vbezhenar on Thursday September 29, 2022 @05:47PM (#33027707)
I don't really understand what's the difference between AAA game and Google Chrome? I thought that modern applications heavily use GPU acceleration. Is it some subset of GPU commands that's required for desktop, compared to AAA game? Is it possible that Google Chrome will crash the OS with some tricky CSS animation (may be in the future version)?
Re:Native Linux GPU Driver for Apple M1 by coldtea on Thursday September 29, 2022 @05:59PM (#33027870)
>I don't really understand what's the difference between AAA game and Google Chrome?

Hundreds of GPU features the latter doesn't use in normal hw-accelerated rendering of webpages... except maybe in doing WebGL content (and even less much fewer and older features than what AAA games want)

Re:Native Linux GPU Driver for Apple M1 by pjmlp on Friday September 30, 2022 @02:14AM (#33031572)
Right, because WebGL 2.0 is basically 2010 GPU hardware, while the upcoming WebGPU is targeting 2014 hardware.
Re:Native Linux GPU Driver for Apple M1 by fomine3 on Thursday September 29, 2022 @09:04PM (#33029536)
Also don't need so much performance so it can be easier
Re:Native Linux GPU Driver for Apple M1 by conradev on Thursday September 29, 2022 @09:06PM (#33029548)
> Is it some subset of GPU commands that's required for desktop, compared to AAA game?

Yes. Compute shaders and geometry shaders are big features. Vulkan, DX12 and Metal also brought a jump in performance at the API level by allowing developers to batch commands sent to the GPU.

Desktop environments can and do leverage those newer APIs to get marginally better battery life. Asahi will miss out on those benefits, but the performance will be insanely better than “no GPU at all”.

Re:Native Linux GPU Driver for Apple M1 by pjmlp on Friday September 30, 2022 @02:16AM (#33031582)
Yes, but WebGPU is basically the version 1.0 of the common subset of those APIs, meaning 2014 hardware.
Re:Native Linux GPU Driver for Apple M1 by shmerl on Thursday September 29, 2022 @07:04PM (#33028538)
Games can trigger a lot more GPUs paths due to their creative usage of shaders.
Re:Native Linux GPU Driver for Apple M1 by Denvercoder9 on Thursday September 29, 2022 @02:01PM (#33024712)
Gaming is not the only thing that uses a GPU. A driver that's complete/performant enough to run a Linux desktop and web browser is already useful.
Re:Native Linux GPU Driver for Apple M1 by 4m1rk on Monday October 10, 2022 @08:03PM (#33157849)
To me the whole point of using open source tech is the freedom. I want to have options, hardware or software. When Apple tries hard to remove itself from that list I probably won't fight to keep it there. I just cross it out of my list as if it doesn't exist. So I simply don't use Apple products.

What do I miss?

Re:Native Linux GPU Driver for Apple M1 by coldtea on Thursday September 29, 2022 @05:58PM (#33027851)
>Totally non-sarcastic question: then why bother?

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.

Re:Native Linux GPU Driver for Apple M1 by bacchusracine on Friday September 30, 2022 @11:49AM (#33036499)
>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?

Re:Native Linux GPU Driver for Apple M1 by bacchusracine on Saturday October 01, 2022 @02:12PM (#33048626)
I'm a bit disappointed that this is getting downvoted without a response.

I had a Macbook Pro 8,1 I ordered specifically for the intel video because at the time Nvidia support was lacking and I got that model with the express purpose and idea that if OSX changed to where I no longer liked it or if the hardware was no longer supported by Apple I could just install Linux and keep going. I had nothing but nightmares trying to get Linux to work on that thing. Consistently things would be fine and then suddenly grub would randomly eat itself. The idea of buying hardware and installing an unsupported operating system seems like insanity to me after that experience.

I'm genuinely trying to understand why people would do this because it seems to make no sense. I doubt any of the people hitting the downvote will see this post in response but I'd really like to hear why anyone would do this. This is supposed to be a commenting and discussion board, I'd like some discussion. Thanks.

Re:Native Linux GPU Driver for Apple M1 by winnie_ua on Saturday October 01, 2022 @07:34PM (#33051168)
My two cents (i'm not one who was downvoting).

Reasons to do it: 1. Enthusiasts are having fun 2. They increase their skill in Linux driver development 3. This can generate patches usable by ARM linux in general, not only viable for Apple hardware.

If she manages to succeed, perhaps with help of others, then we have Linux desktop there. Linux gaming and 3D acceleration wasn't always a thing, and people were still using Linux.

But I agree that apple hardware would still be hostile, and not sure if it is worth it. VM can be used with same success. People who by new macs should be ready to be vendor locked.

But to extend this topic.

Many parts of x86 linux drivers are community developed. Either by individuals, or by companies as RedHat. Yes major hardware vendors, like Intel and AMD makes sure that chipset and CPU are supported, but many motherboard vendors and laptop ones don't give a damn. As far as I know Realtek gigabit ethernet chip was community driven driver.

And most printer drivers are not from vendors.

Now I am curious to search statistics, how much of drivers are made by vendors?

But generally, there is still a problem, that person decide to try linux, and their hardware is unsupported on x86. Laptops especially.

I tend to check linux compatibility first, even if I don't use Linux regularly(actually going to switch soon). I've used linux for a while on my DELL laptop, and experience was great. But my daily driver is windows desktop. Going to try it out. Hope my Wacom tablet would work in Linux, as from my research Wacom is best shot for L.

Re:Native Linux GPU Driver for Apple M1 by winnie_ua on Saturday October 01, 2022 @07:44PM (#33051238)
By the way. I don't know anything about ARM laptop. I know that there are some models. But have no idea how it is going.

I guess having another option won't hurt, and would increase applications adoption.

To be honest: supporting such uniform hardware as Apple's is way easier than supporting bunch of different vendors. So this is doable, if won't be one-man project.

Re:Native Linux GPU Driver for Apple M1 by winnie_ua on Saturday October 01, 2022 @07:36PM (#33051183)
But you are partially correct. If people can concentrate on other, more mainstream and easier to fix hardware, it would be more beneficial for comunity in general.

But people is doing it for free, and getting fun. So that's their choice.

Re:Native Linux GPU Driver for Apple M1 by bacchusracine on Monday October 03, 2022 @10:05AM (#33067680)
Thank you for the response. I was busy so I didn't see it at first.

You helped me see what was happening too, so thank you for that too.

I'm not for a second saying that if people want to hack away on the hardware to have fun, to scratch their own itch, etc etc they shouldn't be allowed to do so. They want to do it, they should have as much fun as they can while doing so. I wish them well. No on is served by petty administrator types demanding the whole world act as an offshoot of their corporate needs and abandon what is fun for them to work on the stuff that any one individual needs. Linux grows like it does because so many people are having fun with it and I'd never want to stop that.

The people I don't understand are the ones who buy Apple hardware with the intention of running Linux. They're the ones taking the gamble and buying something which was never intended to work under Linux from a vendor who is actively hostile to them doing so. At these prices, why gamble? Why fight? Do you want a toy for geek cred or are you buying hardware to use?

It's different if they're planning to develop on the hardware alongside the hackers getting Linux to run or are trying to target their code on the ARM type that Apple is using with hopes of future portability. That makes sense and is their business, whether for work or for pleasure. I just don't understand why the average Linux user would want to do this.

Sure Apple's ARM processor is pretty much leading the pack when it comes to ARM hardware set up for daily use. The hardware is very cool and I dearly hope that someone will release something intended for Linux that can compete and give them a run for their money. I just don't think it's a gamble worth pursuing if your goal is to simply use the hardware as opposed to developing or hacking on it.

Thanks again for your response, it helped me understand how I was coming off and I apologize to everyone for the misunderstanding my wording caused.

Re:Native Linux GPU Driver for Apple M1 by Underphil on Thursday September 29, 2022 @07:34PM (#33028810)
What AAA games would even run on an M1?
Re:Native Linux GPU Driver for Apple M1 by p1necone on Friday September 30, 2022 @01:35AM (#33031363)
Basically all AAA games will run relatively smoothly (30-60fps) with low-midrange dedicated gpus which is effectively what the M1 performs like on paper (I think it's in the ballpark of the NVidia 1050/1050ti/1650).

You just have to lower the settings and resolution to get that smooth performance - think base model last gen console/nintendo switch levels of visual fidelity rather than up to date gaming pc/current gen console levels of visual fidelity.

It's kinda fun squeezing performance out of woefully underpowered hardware - LowSpecGamer on youtube is a channel dedicated to this kind of stuff.

Re:Native Linux GPU Driver for Apple M1 by coldtea on Friday September 30, 2022 @04:05AM (#33032256)
>Basically all AAA games will run relatively smoothly

I think the parent's point is "what AAA games would run on the M1, even if they finish GPU support, given that we're talking about ARM Linux?"

Re:Native Linux GPU Driver for Apple M1 by SXX on Friday September 30, 2022 @07:51AM (#33033651)
Actually Apple itself already released Rosetta for Linux VMs. I hope it might also be usable with Asahi to run Steam.
Re:Native Linux GPU Driver for Apple M1 by pongo1231 on Friday September 30, 2022 @09:20AM (#33034496)
Box64 actually comes quite close to Rosetta in terms of translation speed and apparently that's with optimizations which have yet to be implemented[0]. Would make sense to just use that instead.

[0] https://box86.org/2022/03/box86-box64-vs-qemu-vs-fex-vs-rose...

Re:Native Linux GPU Driver for Apple M1 by simonh on Thursday September 29, 2022 @10:25PM (#33030141)
With the upcoming updates to Metal, in principle quite a few.
Re:Native Linux GPU Driver for Apple M1 by mfuzzey on Thursday September 29, 2022 @04:02PM (#33026311)
GPUs tend to evolve over time rather than change radically. So even if the hardware is obselete before the work is finsihed the driver for the next generation will start from a much better point than the first one.

Also it will be useable for at least some usecases, even if not AAA games, before the hardware is obselete.

Re:Native Linux GPU Driver for Apple M1 by acomjean on Thursday September 29, 2022 @03:27PM (#33025820)
You can't tell people who are doing the work what to work on..

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).

Re:Native Linux GPU Driver for Apple M1 by jorvi on Thursday September 29, 2022 @08:34PM (#33029281)
And yet Linus used a MacBook Air as his daily driver for many many years.

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?

Re:Native Linux GPU Driver for Apple M1 by lmm on Friday September 30, 2022 @12:32AM (#33030972)
It sets the wrong incentives. Companies that are more developer-friendly, publishing specs and so on, should be rewarded for it.
Re:Native Linux GPU Driver for Apple M1 by _ph_ on Friday September 30, 2022 @08:12AM (#33033829)
In principle I would agree, but the world isn't black and white. First of all, in the PC world, there are few machines which are completely and well documented. That Linux runs on so much PC hardware is more due to the popularity than great documentation. NVidia just recently finally open sourced their drivers.

Could Apple improve the documentation a lot? For sure! Bu on the other side, the ARM Macs are a very nice platform, so I can understand the desire to use it. There is no competition at the moment, so it would be wrong too, to not support Linux there.

Re:Native Linux GPU Driver for Apple M1 by mnd999 on Friday September 30, 2022 @01:10AM (#33031241)
I don’t like your implication that ARM is the only way to do this. The Apple chips are fast and low power because they are good designs built on a very modern fabrication process.

It’s perfectly possible to build such chips with other designs and instruction sets, for example x86_64 or risc-v, in the same way it’s pretty common to build cheaper slower ARM processors. Plenty of folks at Intel and AMD are doing that right now.

Re:Native Linux GPU Driver for Apple M1 by cylon13 on Friday September 30, 2022 @01:59AM (#33031479)
There are fundamental issues with x86 that make it impossible to match the efficiency of ARM. Variable length instruction coding for instance, which means a surprising amount of power is dedicated to circuitry which is just to find where the instruction boundaries are for speculative execution. Made sense in the 80s when memory was scarce and execution was straightforward, but now it’s a barrier to efficiency that’s baked right into the ISA.
Re:Native Linux GPU Driver for Apple M1 by dontlaugh on Friday September 30, 2022 @07:33AM (#33033526)
And sadly this partly applies to RISC-V too. It only achieves competitive density with the (optional) instruction compression, which makes instructions vary in length. Not as big of a problem as on x86, but still a fundamental limitation.
Re:Native Linux GPU Driver for Apple M1 by snvzz on Friday September 30, 2022 @10:46AM (#33035608)
>sadly this partly applies to RISC-V too.

Not in any way that has any relevance.

>Not as big of a problem as on x86, but still a fundamental limitation.

Huge understatement. Instructions being any size 1-16 (x86) vs being either 16bit or 32bit long (RISC-V).

As with everything else in RISC-V, the architects did the weighting, and found that the advantage in code size overwhelms the (negligible by design) added decoding cost, for anything but the tiniest of implementations (no on-die cache + no builtin ROM).

As it turns out, it would be difficult to even find a use for such a core, but in any event it is still possible to make one such very specialized chip, and simply not use the C extension.

Such a use would be deeply embedded, and the vendor would be in control of the full stack so there would be no concerns of compatibility with e.g. mainstream Linux distributions. They would still get ecosystem benefits; they'd be able to use the open source toolchains, as they support even naked RV32E with no extensions.

Re:Native Linux GPU Driver for Apple M1 by snvzz on Friday September 30, 2022 @10:39AM (#33035511)
>Variable length instruction coding for instance, which means a surprising amount of power is dedicated to circuitry which is just to find where the instruction boundaries are for speculative execution.

This does apply to x86 and m68k, as "variable" there means 1-16 byte, and dealing with that means bruteforcing decode at every possible starting point. Intel and AMD have both thus found 4-wide decode to be a practical limit.

It does not apply to RISC-V, where you get either 32bit or 2x 16bit. The added complexity of using the C extension is negligible, to the point where if a chip has any cache or rom in it, using C becomes a net benefit in area and power.

Therefore, ARMv8 AArch64 made a critical mistake in adopting a fixed 32bit opcode size. A mistake we can see in practice when looking at the L1 cache size that Apple M1 needed to compensate for poor code density.

L1 is never free. It is always *very* costly: Its size dictates area the cache takes, clocks the cache itself can achieve (which in turns caps the speed of the CPU), and power the cache draws.

Re:Native Linux GPU Driver for Apple M1 by renox on Friday September 30, 2022 @12:13PM (#33036810)
Maybe. If I remember well, Apple ARM M1 can decode up to 8 instruction at the same time, is-there any RISC-V CPU with the C extension which is able to decode 8 instructions?
Re:Native Linux GPU Driver for Apple M1 by snvzz on Friday September 30, 2022 @12:20PM (#33036882)
>is-there any RISC-V CPU with the C extension which is able to decode 8 instructions?

Sure, there's Ascalon[0], 8-decode 10-issue, by Jim Keller's team at Tenstorrent. It isn't in the market yet, but is bound to be among the first RISC-V chips targeting very high performance.

Note that, at that size (8-decode implies lots of execution units, a relatively large design*), the negligible overhead of C extension is invisible. There's only gains to be had.

C extension decode overhead would only apply in the comically impractical scenario of a core that has neither L1 Cache nor any ROM in the chip. Otherwise, it is a net win.

And such a specialized chip would simply not implement C.

0. https://youtu.be/yHrdEcsr9V0?t=346

(*: 8-wide decode being small is just Jim Keller's idea of a joke)

Re:Native Linux GPU Driver for Apple M1 by withinboredom on Friday September 30, 2022 @08:06AM (#33033775)
That sounds false to me. If that were solely the case, then the CPU could pad the instructions coming in and pretend they are all the same length.
Re:Native Linux GPU Driver for Apple M1 by POPOSYS on Friday September 30, 2022 @02:46AM (#33031752)
Thank you very much for this interesting comment! It would be great if you would like to provide an URL with a detailed analysis of this issue.
Re:Native Linux GPU Driver for Apple M1 by colonwqbang on Thursday September 29, 2022 @06:01PM (#33027902)
Maybe it's the reverse engineering aspect that makes it interesting. Those of us in that line of work already spend our time at work turning docs into device drivers. It would be like working at Apple without getting paid.
Re:Native Linux GPU Driver for Apple M1 by pcwalton on Thursday September 29, 2022 @05:52PM (#33027778)
Your desktop that you're using to post this is likely using GPU acceleration to composite your windows. Not having GPU acceleration for graphics is a killer with today's HiDPI displays. The CPU generally can't keep up, and even when it technically can it is extremely power inefficient.
Re:Native Linux GPU Driver for Apple M1 by winnie_ua on Saturday October 01, 2022 @07:49PM (#33051266)
By the way, I am reading and replying not using desktop, but using Android phone :-)

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!

Re:Native Linux GPU Driver for Apple M1 by deaddodo on Thursday September 29, 2022 @05:11PM (#33027271)
Why bother building a contemporary computer kit on MOS6502 chips[1]?

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)?

1 - https://eater.net/6502

Re:Native Linux GPU Driver for Apple M1 by simonh on Thursday September 29, 2022 @04:12PM (#33026463)
Because AAA games aren’t everything.

> 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.

Re:Native Linux GPU Driver for Apple M1 by robert_foss on Thursday September 29, 2022 @02:56PM (#33025432)
Why bother? Because the next generation of hardware will be able to use most of the software written for the current generation, and after a few generations the hardware will be well supported very quickly.

Additionally there's a lot of shared code between the different linux graphics drivers through Mesa, the linux userspace graphics driver framework.

Re:Native Linux GPU Driver for Apple M1 by nicoburns on Friday September 30, 2022 @06:00AM (#33032950)
Currently 60% of the CPU power is being used to do software rendering! If we can offload that to the GPU then it both frees up a lot of CPU capacity and ought to greatly improve battery life.
Re:Native Linux GPU Driver for Apple M1 by zeckalpha on Thursday September 29, 2022 @11:22PM (#33030512)
Just a hobby, won't be big and professional like GNU
Re:Native Linux GPU Driver for Apple M1 by rand0m4r on Thursday September 29, 2022 @04:37PM (#33026811)
The answer could be: because they like it.

People do great stuff with computers and programming and I think this is a good example. Passion is what it's all about.

Re:Native Linux GPU Driver for Apple M1 by coldtea on Thursday September 29, 2022 @06:02PM (#33027910)
This is not about just doing it for passion or for hacking fun despite being worthless of something. There's a very pragmatic reason that makes it very useful!

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...

Re:Native Linux GPU Driver for Apple M1 by chris_wot on Friday September 30, 2022 @11:15AM (#33036001)
I totally concur, AAA games aren’t really the main driver for desktop Linux anyway.
Re:Native Linux GPU Driver for Apple M1 by rrss on Thursday September 29, 2022 @02:22PM (#33025011)
note it’s probably a lot less effort to add support for M2’s GPU than starting from scratch and having to reverse engineer everything.

So eventually the gap between hardware release and fairly complete driver support could close quite a lot.

Re:Native Linux GPU Driver for Apple M1 by imiric on Thursday September 29, 2022 @06:00PM (#33027880)
> why bother?

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.

Re:Native Linux GPU Driver for Apple M1 by malermeister on Friday September 30, 2022 @05:34AM (#33032828)
Right now, Apple makes arguably the best laptop hardware on the market thanks to its chipset.

Why should you be forced to choose between non-free software and subpar hardware?

Why not liberate the hardware?

Re:Native Linux GPU Driver for Apple M1 by imiric on Friday September 30, 2022 @01:43PM (#33038089)
Because it will always be an uphill battle, where the biggest beneficiary will be Apple. I'm not saying the OSS community should boycott Apple, but maybe let's not help them sell more machines.

I think there are plenty of "good enough" laptops that run Linux just fine, so I'd rather use those than have the relatively "best" hardware, but have to fight it to run the software I want, deal with any incompatibilities, and fear that it might break at any point. Standard Linux on supported hardware has plenty of issues; I can't imagine what the experience is like on completely opaque hardware, as much progress as the Asahi team has made. It's like a reverse Hackintosh project, which has always been a painful experience.

Re:Native Linux GPU Driver for Apple M1 by winnie_ua on Saturday October 01, 2022 @07:53PM (#33051287)
I agree. If you know that you want to use Linux on it. You should support honest vendor with money, not one who is actively against you.
Re:Native Linux GPU Driver for Apple M1 by malermeister on Friday September 30, 2022 @02:37PM (#33038819)
I think that is all personal preference. I'd rather hack around incompatibilities than settle for "good enough" while macOS gets best of class hardware.
Re:Native Linux GPU Driver for Apple M1 by SkyMarshal on Saturday October 01, 2022 @04:31PM (#33049821)
Same reason people bothered with Linux back in the 90s. It's about the journey not the destination. It's fun, enlightening, and there's a chance it becomes something big and impactful in the future.
Re:Native Linux GPU Driver for Apple M1 by ThatPlayer on Thursday September 29, 2022 @03:07PM (#33025567)
Box86 translates plenty of x86(-64) games to be playable on ARM.

https://youtu.be/Of93GBCEbug Shows some native games, but also Skyrim and Metro Last Light working on ARM.

Re:Native Linux GPU Driver for Apple M1 by gigatexal on Thursday September 29, 2022 @04:32PM (#33026751)
Getting this off the ground has a chance to get this to snowball. Imagine it gets to rough but useable and it’s in the kernel. Then more and more folks can iterate on it. It’s development rate will increase.
Re:Native Linux GPU Driver for Apple M1 by insane_dreamer on Thursday September 29, 2022 @02:22PM (#33025007)
Machine learning