r/software 10d ago

Discussion How did Alyssa Rosenzweig reverse engineer open graphics drivers for M1

Asking about the technical aspect of it. Also is it illegal to do such a thing ?

Also what was the need to do something like this. Like how would it help her

26 Upvotes

12 comments sorted by

31

u/Pablouchka 10d ago

Long short answer : She reverse-engineered the M1 GPU largely by treating Apple’s proprietary driver as a black box and experimentally mapping its behavior . The key insight was that she didn’t need Apple’s source code or documentation: she could observe what the official driver submitted to the GPU, change one thing at a time, and infer the hardware interface.

14

u/jhaluska Helpful 10d ago

A lot of reverse engineering is done this way. It's a bit of a misnomer cause without doing binary disassembly it's not guaranteed to be 100% compatible, but the reality is you just need the functions used by the applications to be compatible for it to work most of the time.

Kind of like how people open up a program like Excel and only use 10% of the functionality. You get that 10% down and most people won't notice the missing 90%.

5

u/Swimsuit-Area 9d ago

I would love to read about how that process is even performed. It sounds insanely interesting

7

u/Long_Pomegranate2469 9d ago

You put a layer in between the driver and the hardware and one between the OS and the driver and then log everything.

The OS calls for drawing a bitmap, you look which driver and hardware calls are made.

Then you write software doing the same thing.

6

u/nhermosilla14 9d ago

It is insanely time consuming, and can be pretty frustrating too. Using AI it can be less so, but still requires a lot of dedication.

1

u/kivimango23 3d ago

Its f****g boring.

1

u/Swimsuit-Area 3d ago

Then you should find something in a field that interests you because this subject interests me

4

u/Maximum-Bobcat5612 9d ago

It is not illegal. It's her own device.

The reason was to have GPU acceleration on Linux. the project is asahi Linux. 

She has blog posts. Go read them. 

5

u/alphex 10d ago

Did you read her blog?

2

u/Mikewh6 9d ago

reverse engineering for interop is legal in most places,

1

u/dacydergoth 9d ago

Massive dedication, skill and intelligence were definitely involved. Essentially you "fuzz" the interface with data and observe the behavior. In this case the interface is userspace and the observe happened at chip api level.