If you're looking for a high level introduction to GPU development on Apple silicon I would recommend learning Metal. It's Apple's GPU acceleration language similar to CUDA for Nvidia hardware. I ported a set of puzzles for CUDA called GPU-Puzzles (a collection of exercises designed to teach GPU programming fundamentals)[1] to Metal [2]. I think it's a very accessible introduction to Metal and writing GPU kernels. [1…
After a quick scan through the [2] link, I have added this to the list of things to look into in 2025
Ask HN: Resources for general purpose GPU development on Apple's M* chips?
71–80 of 86 posts
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#72Earlier quoted context omitted.
> Where does the 270 gbit/s networking figure come from? Is it the aggregate bandwidth from the pcie slots on the Mac pro We both should restate and specify the calculation for each different Apple Silicon chip and the PCB/machine model it is wired onto. The $599 M4 Mac mini base model networking (aggregated Wifi, USB-C, 10G Ethernet, Thunderbolt PCIe) is almost 270 Gbps. Your 720 Gbps is for a >$8000 Mac Pro M2 Ultr…
It's very weird to add together all kinds of very different networking solutions (WiFi, wired ethernet, TB) and talk about their aggregate potential bandwidth as a single number.
Ultimately, unless the chip architecture is oversubscribed or overloaded (unsure what the right term is), the features are all meant to be used simultaneously and thus the bits being read/written have to come from somewhere.
That somewhere is a % of the total throughput of the chip.
Stated another way — people forget that there’s almost always a single piece of silicon backing the total bandwidth throughput of modern computing devices regardless of what ‘standard’ is being used.
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#73You can help with the reverse engineering of Apple Silicon done by a dozen people worldwide, that is how we find out the GPU and NPU instructions[1-4]. There is over 43 trillion float operations per second to unlock at 8 terabit per second 'unified' memory bandwidth and 270 gigabits per second networking (less on the smaller chips).... [1] https://github.com/AsahiLinux/gpu [2] https://github.com/dougallj/applegpu [3]…
Where does the 270 gbit/s networking figure come from? Is it the aggregate bandwidth from the pcie slots on the mac pro, which could support nics at that speeds (and above according to my quick maths#), but there is not really any driver support for modern Intel or Mellanox/Nvidia NICs as far as I can tell. My use case would be hooking up a device which spews out sensor data at 100 gbit/s over qsfp28 ethernet as dire…
I'm confident you can get 100 Gbps in by aggregating M4 Mac mini ports.
I resell a $199 Microtik CCR2004-1G-2XS-PCIe SmartNIC with 2 x 25 Gbps QSFP28 that connects to a x8 PCIe 3.0. (I still have a few available for $140 plus shipping plus a few refurbished 16 x 10 Gbps for $400 and 8 x 100 Gbps switches for $800).
Theoretically you can connect that SmartNIC to two of the three M4 Mac mini Thunderbolt 4/USB4 ports that pass through 2 x x4 PCIe 3.0, if you can figure out how to aggregate the two x4 PCIe lanes into a single x8 port. The driver source code is for Linux and could be ported to MacOS. You then aggregate the ports with the 100 Gbps switch.
I'm pretty sure you could create a new PCB design with a larger Broadcom switch chip model to attach to the 10G Ethernet, two 10 Gbps USB-C ports plus the three Thunderbolt 4/USB4 port and write a new driver to aggregate over the 6 ports. You'd have 126 Gbps minus the PCIe overhead and could combine it into a single 100 Gbps QSFP28 port.
I already warned this is still theoretical. Broadcom might not sell you the switch chip, Intel might not sell you the Thunderbolt chip and Apple might block the installation of your device driver code.
But people already proved the interconnect with the Apple Thunderbolt Bridge driver at 3 x 10 Gbps connected via large expensive Thunderbolt hubs [2]. Others just connect each port to different M4 Macs [1][3][4] in various ways.
[1] https://x.com/alexocheema/status/1807882764261417000
[2] https://www.youtube.com/watch?v=GBR6pHZ68Ho
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#74Earlier quoted context omitted.
Where does the 270 gbit/s networking figure come from? Is it the aggregate bandwidth from the pcie slots on the mac pro, which could support nics at that speeds (and above according to my quick maths#), but there is not really any driver support for modern Intel or Mellanox/Nvidia NICs as far as I can tell. My use case would be hooking up a device which spews out sensor data at 100 gbit/s over qsfp28 ethernet as dire…
>but there's no way to get the data into it at 100 Gbps I'm confident you can get 100 Gbps in by aggregating M4 Mac mini ports. I resell a $199 Microtik CCR2004-1G-2XS-PCIe SmartNIC with 2 x 25 Gbps QSFP28 that connects to a x8 PCIe 3.0. (I still have a few available for $140 plus shipping plus a few refurbished 16 x 10 Gbps for $400 and 8 x 100 Gbps switches for $800). Theoretically you can connect that SmartNIC to…
I'll just stick to Orin AGX modules with their proper pcie slot and real Linux support. I want to do something meaningful with the incoming data and not waste years just getting the link up and running.
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#75Earlier quoted context omitted.
While understanding the GPU’s microarchitecture might be useful for exploits it’s definitely not worth “millions”.
You are right. The zero-day exploits might be worth roughly a million each, but not the family tree of native GPU's, ANE, CPU instruction sets and microarchitecture on which they would be based. My apology for writing unclearly, English is not my native language. I'm surprised it is yours. Saving on energy, programming effort and purchase cost of a supercomputer in case of M4 instruction sets and microarchitecture kn…
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#76Earlier quoted context omitted.
How do you issue/execute "GPU" machine code instructions from MacOS not through Metal?
You (or your compiler) write the instructions and data into unified memory (up to 192 GB) and jump to the first instruction (usually of a loop) on each core. GPU and ANE processor cores are not fundamentally different from CPU cores, they just have fewer transistors (gates) and therefore more limitations in what a register can address, what data type or what instruction it can execute. Some cores can only execute the…
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#77I’ve had a good time dabbling with Metal.jl: https://github.com/JuliaGPU/Metal.jl
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#78Apple is known to actively discourage general purpose computing. Better try a different vendor.
idk about “known” considering they basically created OpenGL
Re: Ask HN: Resources for general purpose GPU development on Apple's M* chips?
#79Earlier quoted context omitted.
> Look at the recent semianalysis test to see how not ready AMD is, who would be the only company to have a real shot at this. Their HW on paper is better or equal, yet their software ecosystem is nowhere ready. Reading that was kind of odd. It seems like their conclusion was that on paper AMD should be significantly less expensive and significantly faster, whereas in practice they're significantly less expensive and…
They literally spent months trying to work out the bugs. It’s an absolute admonishment of AMD’s software stack. Just look at their market value and it says everything you need to know about how much “better” AMD is than NVIDIA.
That's kind of the point. They spent months working out bugs that are now worked out. Which sucks when you're the one to do it, so they're kind of bitter about it, but is pretty great for everyone who comes after them and the fixes have already made it into the drivers.
> Just look at their market value and it says everything you need to know about how much “better” AMD is than NVIDIA.
"The company makes more money" has a nasty tendency to be inversely correlated with value for money to the customer. Comparing the "market cap" of Oracle vs. pick your favorite open source database is not a great way to decide which one to use.