A project to reverse engineer the GPU of Apple's proprietary chip 'M1' for Mac is underway



The '

M1 ' developed by Apple has achieved benchmark results that exceed those of other Macs even under the x86 emulation environment, giving a strong impression of its high performance. Attempts to reverse engineer such M1 GPUs and develop open source drivers are being pursued by engineers such as Alyssa Rosenzweig .

Rosenzweig – Dissecting the Apple M1 GPU, part I
https://rosenzweig.io/blog/asahi-gpu-part-1.html

Rosenzweig – Dissecting the Apple M1 GPU, part II
https://rosenzweig.io/blog/asahi-gpu-part-2.html

Since the specifications of M1 are not open to the public, it is necessary to develop a driver by reverse engineering to use it on Linux. `` linux-m1 '' released by Corellium is the first Linux to run on M1, but at the time of writing the article does not have GPU support.

corellium/linux-m1: Linux kernel source tree
https://github.com/corellium/linux-m1



In order to run such M1 GPU on Linux, GPU analysis by Mr. Rosenzweig and the development team is steadily progressing in the '

Asahi Linux ' project aiming for Linux operation on M1 as well as linux-m1.

Mr. Rosenzweig has been involved in the analysis of the Mali GPU installed in the Arm Cortex release and the development of the open source driver ' nouveau ' for NVIDIA GPUs. According to Rosenzweig, GPU analysis basically calls system calls such as ioctl and mmap from the Linux environment variable `` LD_PRELOAD '' and dumps the library in shared memory.

Rosenzweig's analysis reveals some features of the M1's GPU. One of them is that the architecture is SISD , which 'manipulates one data with one instruction'. Normally, the GPU performs parallel processing by SIMD , which ``manipulates multiple data with one instruction'', but the M1 GPU performs all processing with SISD. In addition, Rosenzweig says that efforts have been made to simplify the compiler, such as incorporating the scheduler into hardware.

Based on these characteristics, Rosenzweig succeeded in rendering triangles on the M1's GPU through trial and error. Below is a triangle image actually rendered on the M1 GPU.



Rosenzweig commented that this success only indicates that 'the data necessary to render the image was entered correctly.' Although the code is working, it seems that understanding based on the structure of the GPU itself, such as why the code is working, has not progressed yet.

The M1 GPU analysis project by Rosenzweig et al. is being advanced at the following URL.

AsahiLinux/gpu: Dissecting the M1's GPU for 3D acceleration
https://github.com/AsahiLinux/gpu

・September 30, 2022 postscript
In September 2022, Rina Asahi, a Linux development VTuber, released a web browser and 3DCG games running on Asahi Linux.

Linux 'Asahi Linux' for Mac with Apple chip finally runs GUI application, enabling display of VTuber avatar and YouTube viewing with Firefox - GIGAZINE



in Software,   Hardware, Posted by darkhorse_log