Produced | OSC Open Source Community (ID: oschina2013)
One of the biggest hurdles to Apple M1 and M2 support on Linux is the current lack of GPU acceleration, Asahi Linux has been reverse-engineering the graphics processor for Apple's M-series chips, early experiments are underway on macOS and Asahi Linix's m1n1 environment, next steps The plan is to write a Direct Rendering Manager (DRM) kernel driver.
According to foreign media Phoronix, Asahi Linix's core developer Asahi Lina is exploring the feasibility of writing the DRM kernel GPU driver in the Rust programming language.
picture
Asahi Lina explained on the mailing list:

I started developing a new kernel GPU driver for Apple AGX (for M1 and M2 series chips).

These GPUs run firmware and have fairly complex shared memory data structures that need to be managed by the host, so I've been leaning towards Rust, which has security, better metaprogramming, and general expressiveness.

I have a prototype driver written in Python, but higher level languages ​​are very helpful for reverse engineering the GPU and designing the driver to work differently.

I realize this is the early days of the Rust language on Linux, it's an ambitious challenge, but I'm willing to learn, it will take some time for the driver to stabilize to the point where either way (especially UAPI) can be upstream,

I've heard that Rust For Linux will be merged in the next few kernel cycles at the latest, so writing Linux drivers in Rust doesn't feel like the gamble it used to be.

If it does, it will be the first Linux kernel GPU driver written in Rust. Given that there is currently no actual driver code written in Rust, there are several possibilities for a Rust implementation of the driver: either implement it entirely in Rust (involving the rendering part of the DRM subsystem), or just do most of the firmware interaction logic in Rust, and then The top-level driver is written in C and calls the Rust abstraction layer. It remains to be seen.

A detailed description of writing Apple GPU drivers in Rust can be found on the rust-for-linux mailing list: https://lore.kernel.org/rust-for-linux/70657af9-90bb-ee9e-4877-df4b14c134a5@asahilina. net/t/#u

Recommended in the past


Astro 1.0 released, a modern static site generator

Redis hits back at Dragonfly: 13 years later, Redis' architecture is still best in class

Retirement is recommended! The father of JSON: JavaScript has hindered progress


Here are the latest open source information, software updates, technical dry goods, etc.
Click here↓↓↓ Remember to follow ✔ Star ⭐ Oh~