Live data from Hacker News

Dissecting the Apple M1 GPU, Part II

rosenzweig.io

131–140 of 195 posts

Re: Dissecting the Apple M1 GPU, Part II

#131

question from ignorance - Why not use Metal? Is that too embedded in the macOS system to be useful for something like Linux? Or is this for the sake of understanding the bare metal?

If you used metal as the graphics api on Linux, literally no existing Linux software would work with it unless you also used a layer like MoltenGL or MoltenVK (which have been written for a Mac system and would likely need modification). Linux graphics drivers also tend to have extra APIs for buffer management for X11/Wayland, which a molten compat layer probably doesn't do as molten is meant to run in-process with each app I believe.

Some of the Metal APIs are also a little intertwined with swift and objc.

Re: Dissecting the Apple M1 GPU, Part II

#132
post #91
post #78

Earlier quoted context omitted.

Fiddling around on an M1 MBA it felt faster than my 2020 16" MBP. It's half the weight, seems to get double the battery life, and costs less than 1/3. I just can't even imagine what the gap is going to look like when Apple really refines this down.

You should compare it to other than the old Apple laptops. The Ryzen models, such as ThinkPad T14 are very fast, and if you want to go tenfold from there, there is no comparison with the modern Ryzen desktop CPUs. Why Apple always failed with Intel and its thermals is why they feel so slow compared to the M1.

A 2020 16" Macbook Pro isn't old by any measure. This argument seems disingenuous.

Re: Dissecting the Apple M1 GPU, Part II

#133

question from ignorance - Why not use Metal? Is that too embedded in the macOS system to be useful for something like Linux? Or is this for the sake of understanding the bare metal?

The goal is to write a driver for Linux, this is from scratch.

Re: Dissecting the Apple M1 GPU, Part II

#134

Everyone, remember that in 2019 Alyssa was in _High School_. Where do people get this knowledge? It's astounding. She was literally reverse-engineering Mali for Panfrost starting in her Sophomore year.

It’s easy to think this sort of thing requires an incredibly level of knowledge but it’s often more about dedication and a little lateral thinking. You need a broad understanding of the process of putting something on screen, the ability to construct a program that does something, some way to observe the result, and the willingness to experiment.

Back in the 80s lots of kids that age wrote computer games and often found novel ways to use the hardware because even though video controllers might not be fully documented you still knew where their control registers were in memory and could just try altering the values in them.

Now, modern graphics hardware is more complex and controlled by things like command buffers and shaders, but you can apply similar ideas, and you’ve probably got easier tools for examining the state of your process. Write a program that does a simple thing and dump its state. Do a slightly different thing and compare the states. When you think you understand things either change your program and see if you’re correct or use a debugger to alter the state at runtime and see if you can change the visible result.

Re: Dissecting the Apple M1 GPU, Part II

#135

question from ignorance - Why not use Metal? Is that too embedded in the macOS system to be useful for something like Linux? Or is this for the sake of understanding the bare metal?

the metal driver would not work on linux. It was written for OSX. It's also closed source.

Re: Dissecting the Apple M1 GPU, Part II

#136

Everyone, remember that in 2019 Alyssa was in _High School_. Where do people get this knowledge? It's astounding. She was literally reverse-engineering Mali for Panfrost starting in her Sophomore year.

It’s easy to think this sort of thing requires an incredibly level of knowledge but it’s often more about dedication and a little lateral thinking. You need a broad understanding of the process of putting something on screen, the ability to construct a program that does something, some way to observe the result, and the willingness to experiment. Back in the 80s lots of kids that age wrote computer games and often fo…

The M1 is actually especially forgiving about this, because it's good about isolating errors to your process, i.e. if you do something wrong only your test program will crash. For many GPUs, if you feed them garbage the whole machine panics.

Re: Dissecting the Apple M1 GPU, Part II

#137

Earlier quoted context omitted.

What exactly do you expect? x86 is quite competitive. M1 might be slightly better, but it's not like it's miles ahead.

I want a return to the status-quo when for 80% (it could be even less but let's not dwell in the number) of the price of an Apple laptop I could get a windows/linux machine matching or surpassing its specs(including stuff like battery life,energy consumption, screen dpi, noise, etc). This is not true now and I am not seeing an option in the short term.

That was never really possible, or certainly wasn't ever since the laptops went to HiDPI displays. There were just a lot of teenagers showing off their ability to make gamer PC parts lists and claim that it's better than a Mac, but the value of the display/trackpad/integration have been good for a long time. It's just now the quality of the SoC is that good.

Re: Dissecting the Apple M1 GPU, Part II

#138

Earlier quoted context omitted.

> People don't really remember, but a lot of people were really dismissive of the iPhone (and iPod) on launch. I do remember that. iPhone had its growing pains in the first year, and there was a fair criticism back then. But it was also clear that iPhone brings a completely new vision to the concept of a mobile phone. M1 brings a nice performance at fairly low power, but that's just a quantitative difference. No new…

> "Why? Somehow Apple's chips will get better, but competition will stand still?" Arguably this has been the case for the last ten years (comparing chips on iPhones to others). I think x86 can't compete, CISC can't compete with RISC because of problems inherent to CISC ( https://debugger.medium.com/why-is-apples-m1-chip-so-fast-32... ) It won't be for lack of trying - x86 will hold them back. I suppose in theory they…

RISC vs CISC is not real. Anyone writing articles about it is uninformed and you should ignore them. (However, it's also not true that all ISAs perform the same. x86-64 actually performs pretty well though and has good memory density - see Linus's old rants about this.)

ARM64 is a good ISA but not because it's RISC, some of the good parts are actually moving away from RISCness like complex address operands.

Re: Dissecting the Apple M1 GPU, Part II

#139

So Apple strategy seems to be to commit as little resources as possible to their products knowing that "open source" developers will do their work for free thus Apple will not have to pay extra salaries and taxes? I don't understand why people bother working for free to e.g. run Linux or even write a GPU driver? I get this is a nice developer challenge, and being involved with Apple stuff is still being seen as "cool…

> So Apple strategy seems to be to commit as little resources as possible to their products knowing that "open source" developers will do their work for free thus Apple will not have to pay extra salaries and taxes? Apple has no Linux strategy. Nobody is working for Apple for free. People are working on their own time (or supporting the project with their own money) because they want to see this happen. There is no s…

> Apple has no Linux strategy.

macOS comes with a free built in hypervisor for running things in VMs. That's how Linux is supported. (Although I guess not if you want to use the GPU.)

Re: Dissecting the Apple M1 GPU, Part II

#140
post #132
post #91

Earlier quoted context omitted.

You should compare it to other than the old Apple laptops. The Ryzen models, such as ThinkPad T14 are very fast, and if you want to go tenfold from there, there is no comparison with the modern Ryzen desktop CPUs. Why Apple always failed with Intel and its thermals is why they feel so slow compared to the M1.

A 2020 16" Macbook Pro isn't old by any measure. This argument seems disingenuous.

But they are extremely bad with their thermals and Intel is way slower than whatever AMD is pushing right now. The thing is Apple just made quite mediocre hardware. And now they're back where the competition is.
Post reply on HN