Live data from Hacker News

Tales of the M1 GPU

asahilinux.org

41–50 of 390 posts

Re: Tales of the M1 GPU

#41
post #20

Is anyone porting the GPU driver to Windows?

I think there's larger barriers to getting windows running on Apple Silicon that would need to be addressed first. For one example, Windows ARM kernels are pretty tied to the GIC (ARM's reference interrupt controller), but Apple has its own interrupt controller. Normally on ntoskrnl this distinction would simply need hal.dll swapped out, but I've heard from those who've looked into it that the clean separation has br…

Apple Silicon doesn't use GIC, but uses AIC (Apple Interrupt Controller).

"Apple designed their own interrupt controller, the Apple Interrupt Controller (AIC), not compatible with either of the major ARM GIC standards. And not only that: the timer interrupts - normally connected to a regular per-CPU interrupt on ARM - are instead routed to the FIQ, an abstruse architectural feature, seen more frequently in the old 32-bit ARM days. Naturally, Linux kernel did not support delivering any interrupts via the FIQ path, so we had to add that."

https://news.ycombinator.com/item?id=25862077

TL;DR: No standard ARM interrupt controller, custom controller requires quirky architectural features

Re: Tales of the M1 GPU

#42
post #17

Earlier quoted context omitted.

I'm not sure Apple would want users to run anything but Apple operating systems on their hardware, and the other way around (fighting against hackintoshes back in the day). I hope to be proven wrong though, as their hardware is really interesting.

I thought someone had posted here that Apple ran Linux on their hardware for manufacturing tests.

Hector Martin claims so which (frankly) suggests he has some insiders.

However, just because Apple "runs linux" doesn't mean they "run linux" the way you are thinking. It's very easy for corporations to write slapdash, horrific, unmaintainable kernel forks that run on a specific piece of hardware. That's just fine when you are testing hardware before handing it to your OS team, but absolutely unacceptable for upstreaming.

For examples of this, take a look at old Android devices (and their ancient kernels), or the original Correlium port of Linux to Apple Silicon (which happened almost half a year before the Asahi Linux beta - but the code was sheer unmaintainable crap). Upstream it? Heck no - it would be rejected entirely and need almost a total rewrite from scratch. Just because you can write a functional driver doesn't mean it is anywhere close to a good, maintainable driver.

So, in a nutshell... yes, Apple does use Linux for early manufacturing tests. But it would almost certainly not be in a state where we could benefit much from it, and certain features would likely not be implemented. It's not anywhere near as simple as "Apple has done the work already - just upstream it please!"

Re: Tales of the M1 GPU

#43
post #23

What an interesting tale. But I feel like an anime character described it to me. I'm totally fine with it (I'm grateful the story is being told at all), but it is surreal tone for technical writing.

pretty much the appeal(?) of asahi lina. it's been a weird ride to follow for sure.

Have to say as much as I want to watch their streams, I can't get passed the annoying voice.

Re: Tales of the M1 GPU

#44
post #23

Earlier quoted context omitted.

pretty much the appeal(?) of asahi lina. it's been a weird ride to follow for sure.

Have to say as much as I want to watch their streams, I can't get passed the annoying voice.

I had a quick look and the streams it made the hair stand up on the back of my neck.

Not in a good way. The write up wasn't so bad but the entire package is too much for me.

Re: Tales of the M1 GPU

#46

Earlier quoted context omitted.

I think there's larger barriers to getting windows running on Apple Silicon that would need to be addressed first. For one example, Windows ARM kernels are pretty tied to the GIC (ARM's reference interrupt controller), but Apple has its own interrupt controller. Normally on ntoskrnl this distinction would simply need hal.dll swapped out, but I've heard from those who've looked into it that the clean separation has br…

Apple Silicon doesn't use GIC, but uses AIC (Apple Interrupt Controller). "Apple designed their own interrupt controller, the Apple Interrupt Controller (AIC), not compatible with either of the major ARM GIC standards. And not only that: the timer interrupts - normally connected to a regular per-CPU interrupt on ARM - are instead routed to the FIQ, an abstruse architectural feature, seen more frequently in the old 32…

Yep, that's essentially what my post says.

My next point was about how the NT kernel was designed to handle exactly this kind of change pretty cleanly, but that clean barrier has been allowed to stagnate. So way back, NT kernels for weird systems like SGI workstations that had x86 CPUs but were decidedly not PCs otherwise simply needed hal.dll swapped out with a version written by the hardware vendor to paper over those system differences like how interrupts are routed around and how to access PCI devices. That's no longer really an option however.

Re: Tales of the M1 GPU

#49
post #17

Earlier quoted context omitted.

I thought someone had posted here that Apple ran Linux on their hardware for manufacturing tests.

Hector Martin claims so which (frankly) suggests he has some insiders. However, just because Apple "runs linux" doesn't mean they "run linux" the way you are thinking. It's very easy for corporations to write slapdash, horrific, unmaintainable kernel forks that run on a specific piece of hardware. That's just fine when you are testing hardware before handing it to your OS team, but absolutely unacceptable for upstrea…

> Hector Martin claims so which (frankly) suggests he has some insiders.

Eh, I've heard the same thing form people I trust, and I'm not the Apple news version of deep throat or something. It's simply not a very well kept secret.

Although part of me wonders if the code will flow the other way. Now that marcan has put in the elbow grease to upstream concepts like 16KB pages, the non standard ordering for regular MMIO and PCI on Apple Silicon, etc, will Apple embrace those in their custom distro to avoid having so much un-upstreamed code? We'll probably never find out, but it's fun to think about.

Re: Tales of the M1 GPU

#50

Earlier quoted context omitted.

i can only assume the poster meant apple should add linux drivers of M1/m2 to mainline linux kernel

I'm not sure Apple would want users to run anything but Apple operating systems on their hardware, and the other way around (fighting against hackintoshes back in the day). I hope to be proven wrong though, as their hardware is really interesting.

They've never taken issue with other OSes running on their hardware. They made Boot Camp for Intel Mac users to run Windows and wrote Windows drivers to use Apple-specific hardware like the iSight cameras. They even showcased this feature in the TV ads. Linux also worked but wasn't explicitly supported.

The rule is only, no macOS on non-Apple hardware.

Post reply on HN