7 ms·
Writing a Rust GPU kernel driver: a brief introduction on how GPU drivers work
- fabiensanglard 1y agoGreat article. But too short. I was just getting excited about it and it ended. I look forward reading the other parts.
- Animats 1y agoTune in next week for the next exciting episode, where we will see a command taken off the queue and executed in the GPU! The abstraction level discussed here is just where data gets passed across the user/kernel boundary. It's mostly queue and buffer management, which is why there are so few operations. The real action happens as queued commands are executed. There's another stream of command completions coming back from the GPU. Looking forward to seeing how that works. All this asynchrony is mostly not the driver's problem. That's kicked up to the user code level, as the driver delivers completions.
- Muromec 1y agoOh, that's cool. I use one of the rk3588 things with panfrost as a desktop and it sometimes bugs out with black or transparent patches in firefox. Weird thing.
- TZubiri 1y agoI know that "Rust GPU driver" on the titles gets you more clicks than "Arm Mali CSF Based GPU Driver". But isn't this a Arm Mali CSF-based GPU driver? I hate focusing on the metatools (tools for building tools). It really sounds like the objective here was to build something in Rust. In the article it is even described as "a gpu driver kernel supporting arm mali.." instead of just an arm mali driver It is a misunderstanding of what the job of writing a driver is, you are connecting some wires between the OS api and the manufacturer api, you are not to build a framework that adds an additional layer of abstraction, sorry to put it so bluntly, but you are not that guy. Sorry for being rough.
- UK-AL 1y agoRust is important here because it's one of the first(if not the first) to use the rust infrastructure for a GPU.
- monocasa 1y agoThe Asahi folks were probably first in this regard.
- amiga386 1y ago[flagged]
- UK-AL 1y agoBecause rewriting the kernel from scratch would literally cost billions. That's why. Literally criticising them for not achieving an impossible goal.
- dralley 1y agoThe Rust integration for Linux was invited and greenlit by Linus and Greg KH.
- Ar-Curunir 1y agoPeople are already trying to make their own kernels in Rust. You just don’t hear about those because it takes a fuckton of time to build a useful kernel
- taminka 1y agovery interesting, is there a second part to this? or logical continuation...
- steveklabnik 1y agoIt came out today, so I am assuming more will come later.
- skavi 1y agoCurious as to whether uring_cmd was considered instead of ioctls since this looks green field. Would the benefits have been negligible to nonexistent? If so, why?
- rjsw 1y agoThe driver described in the article uses the API that the userspace Mesa libraries expect.
- skavi 1y agoah thanks for the clarification. should have read more carefully.
- kimixa 1y agoAs GPUs are already asynchronous devices with their own command queue, and the IOCTLS generally just abstracting a relatively cheap write into that command queue, I suspect there's limited utility in making another asynchronous command queue on the CPU to schedule those writes. Unless you mean to make the GPU command queue itself the uring and map that into userspace, but that would likely require significant firmware changes to support the specifics of the io_uring API, if even possible at all due to hardware specifics.