Announcement

Collapse
No announcement yet.

Asahi Linux May Pursue Writing Apple Silicon GPU Driver In Rust

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by mdedetrich View Post
    Programmers willingly choosing a worse tool for the job is not a sign of competence.
    C language and GCC is a proven tool for device driver development. Rust is not a proven tool for device driver development, in fact there is no kernel code at all, except some very trivial example.

    Writing a driver for undocumented hardware is challenging, doing so with an experimental compiler is ... hobby-ism?

    Comment


    • #12
      Originally posted by ferry View Post

      C language and GCC is a proven tool for device driver development. Rust is not a proven tool for device driver development, in fact there is no kernel code at all, except some very trivial example.

      Writing a driver for undocumented hardware is challenging, doing so with an experimental compiler is ... hobby-ism?
      they could write it in python to be even cooler ?

      Comment


      • #13
        Originally posted by mdedetrich View Post

        Actually marios spent 30+ pages on Phoronix arguing in favour of C even though he has no real programming experience and most of his justifications boil down to "I don't like it".

        So yeah in this case its not a meme, he is dead serious (and also dead wrong).
        Lol, did you even read who you are quoting? (Hint: the guy who knows better than anyone else if marios was meming or dead serious)

        PS0: I don't like rust, but it is a matter of taste.
        PS1: I am against rust specifically in the kernel because of the added complexity of having 2 programming languages instead of 1. I also have a non technical reason similar to the old good Linus's non technical reason to keep C++ out of the kernel.
        PS2: Leave my real programming experience alone and go write some java where you belong

        Comment


        • #14
          Originally posted by JacekJagosz View Post

          The only opensource driver from Imagination is for their newest mobile GPU, and it isn't even ready yet. So first basing it off of something that doesn't yet work might be risky, but also it is interesting how much of their IP has been used in Apple's chips, when did the split occur between Apple and PowerVR and if they are even based on the same technology. But yeah, unifying efforts would be really helpful.
          As for using Rust, I guess this is one of the best occasions to try a new approach, a driver written completely from scratch.
          I guess we'll find out how much of PowerVR is in Apple when there's investigation. I do know that Apple had poached some of Imaginations PowerVR developers and then eventually just paid licenses to Imagination anyway.

          Comment


          • #15
            looking fwd. to a working Linux AGX driver! ;-)

            Comment


            • #16
              Originally posted by ferry View Post

              C language and GCC is a proven tool for device driver development. Rust is not a proven tool for device driver development, in fact there is no kernel code at all, except some very trivial example.
              For the Linux kernel maybe. But there are multiple operating system projects using rust, e.g. redox os. And there are many people using rust on micro controllers (https://github.com/rust-embedded/awesome-embedded-rust), so I'm positive they will be fine.

              Comment


              • #17
                Originally posted by ferry View Post

                C language and GCC is a proven tool for device driver development. Rust is not a proven tool for device driver development, in fact there is no kernel code at all, except some very trivial example.

                Writing a driver for undocumented hardware is challenging, doing so with an experimental compiler is ... hobby-ism?
                only Redox & friends ;-)

                Comment


                • #18
                  Originally posted by marios View Post
                  Then someone will have to rewrite it in C, I guess...
                  Hah, Indeed. At this point, the Rust code will likely all be in an unsafe{} block anyway and twiddling raw bytes like drivers typically do will pretty much resemble C, so hopefully won't be hard to clean up into a proper implementation language.

                  Python -> Rust -> C. This is why we typically avoid web developers writing kernel modules. It has to keep getting rewritten from whatever popular prototyping language they chose.

                  Comment


                  • #19
                    Originally posted by Dukenukemx View Post
                    I guess we'll find out how much of PowerVR is in Apple when there's investigation. I do know that Apple had poached some of Imaginations PowerVR developers and then eventually just paid licenses to Imagination anyway.
                    The investigation already happened. An apple M1 openGL driver already exists in python. The answer is basically zero, not that it even matters because asahi didn't use anything from powervr either way.

                    Comment


                    • #20
                      This isn't really surprising at all. Not only have asahi been floating this possibility for months, it's part of their stated mission.

                      They run non-4k paged kernels and do other things because they want to push boundaries. Running the M1 in 4k mode would have improved compatibility, but then chromium wouldn't be reworking itself right now to pick up non-4k page support.

                      This rust effort falls perfectly in line with that. Why not be the first to cross the line and implement a serious rust driver? For anyone who wants an example of a "real" driver written in rust, here it is.

                      Comment

                      Working...
                      X