Announcement

Collapse
No announcement yet.

AMD Working On RDNA3 User-Mode Graphics Queue For Their Linux GPU Driver

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

  • #11
    Originally posted by milkylainen View Post
    So why not dropping everything into userspace then?
    It's not like vram, io and dma allocations, IRQ messaging are magical things?
    For the sake of security and stability, I'd say.

    Windows once moved most/all of the graphics card drivers into userspace (for performance reasons) and stability took a nosedive. That was back in the late 1990's, so security was less of a concern.

    Originally posted by milkylainen View Post
    Sure, it'd break all presumptions about borders. But isn't this doing that already?
    The queue is still managed by the driver. Again, I think io_uring is a very close analogy to what's being done, here. It's a limited block of memory that you can use for communication - not throwing the doors wide open.

    Originally posted by milkylainen View Post
    Besides, doing userspace cmd-queues, doesn't that already require regspace, vram and dma in userspace?
    Presumably, the command queue sits in host memory. So, either a kernel thread or the GPU has the same block mapped and is doing all of that stuff in a privileged domain.

    Comment


    • #12
      Originally posted by coder View Post
      Oh dear. Here we go...

      My take is: no. I think the use of examples, counter-examples, and supporting rationale are a bit beyond it. Furthermore, it has a logical structure that doesn't follow from the prior post. IMO, Mitch is demonstrating a theory of mind, by anticipating and responding to the points of key interest to the intended audience. I know that can be faked, to some degree, but I don't think this one is.

      Please, unless something is a word salad, can we not start accusing each other of ChatGPT? If someone takes the time and effort to write an informative and well-thought out post, it's quite a slap in the face then to be accused of being (or using) a bot.
      I'm not accusing and I think it's totally fine to use AI to help make a valid answer.
      Mitch post was written in a style that reminds very much of chatGPT.
      I'm sorry for drunk shit post.

      Comment


      • #13
        Originally posted by Etherman View Post

        I'm not accusing and I think it's totally fine to use AI to help make a valid answer.
        Mitch post was written in a style that reminds very much of chatGPT.
        I'm sorry for drunk shit post.
        No offense taken. I wasn't using any AI text generator or anything like that. Just wrote out my thoughts while trying not to go into details beyond what I know. I like talking about Linux and hardware and don't get many opportunities IRL to talk about it.
        ​​​​​
        The way I see it, if people can have positive, supportive communities in the Linux world, we can give more people the enthusiasm and courage to try it out and adopt it.

        All that said, I'm actually a T-800 terminator and I'm running on a future version of Linux, 13.37 LTS, that won't be released for years to come. My CPU is a Motorola 68k 🤓 (totally kidding, I'm a human)
        Last edited by Mitch; 25 December 2022, 11:55 AM.

        Comment


        • #14
          Originally posted by Etherman View Post
          I'm sorry for drunk shit post.
          I reacted rather strongly, but not so much to your specific reply as the foreboding sense I got that we're entering a twilight zone of continually having to pass some kind of Turing test to prove we're wet brains behind these accounts. This was bound to happen, it's just that your post was the first time I saw it. So, you got the full force of my reaction.

          I do hope that we can try to learn a little better what are the hallmarks of chatGPT and similar, but also use restraint in playing that card unless it really seems warranted.

          I think it's good that you followed-up and I wish happy holidays to you and yours.

          Comment


          • #15
            Originally posted by milkylainen View Post
            So why not dropping everything into userspace then?
            It's not like vram, io and dma allocations, IRQ messaging are magical things?
            Sure, it'd break all presumptions about borders. But isn't this doing that already?
            Besides, doing userspace cmd-queues, doesn't that already require regspace, vram and dma in userspace?
            Atleast mapped in userspace?
            The answer is complex.
            The (very simplified) TL; DR: modern CPUs implement "rings" as security mechanisms.
            Ring 0 = kernelspace, Ring 3 = userspace.
            Ring 0 can do anything (esp. w.r.t. hardware).
            Ring 3 can run user code, but as soon as it comes to interacting with hardware, it needs to use syscalls and pass off params and data to Ring 0 (kernel). Hardware instructions are not available in Ring 3.
            The transition is not cheap, as the kernel has to do lots of checking and accounting before running the syscall, and then some more accounting before returning.
            Notice that rings 1 and 2 exist, but are essentially unused by Windows and Linux, because the performance impact of switching rings is high from the CPU's POV. If you use all 4 rings (e.g: userspace -> ring 2 -> ring 1 -> kernelspace -> ring 1 -> ring2 -> userspace), you get 6x costly transitions, and if you need to do it a lot (e.g: playing a videogame, writing many files to disk, ...), you'll get abysmal performance (just think that playing a video game issues many syscalls, many times per second).

            The rings are there for security implications, and you wouldn't want to run hardware stuff in userspace (or user stuff in kernel space), otherwise any kind of malfunction in a program (or intended design - e.g: viruses, cryptolockers, ...) could crash your machine, change the LED lighting of your keyboard, make your screen or GPU run out of specs, ......

            As others have guessed as well, this change likely comes as an efficiency improvement: prepare a queue of stuff and submit it once, thus paying the cost of the ring transition once instead of many times in a row in a short span of time.

            Comment


            • #16
              Originally posted by fsvm88 View Post
              The (very simplified) TL; DR: modern CPUs implement "rings" as security mechanisms.
              Ring 0 = kernelspace, Ring 3 = userspace.
              Ring 0 can do anything (esp. w.r.t. hardware).
              Ring 3 can run user code,
              I rarely hear about rings, any more. Do rings 1 & 2 truly exist, in Linux? Or has it entirely been simplified down to ring 0 and 3?

              Originally posted by fsvm88 View Post
              The transition is not cheap, as the kernel has to do lots of checking and accounting before running the syscall, and then some more accounting before returning.
              I think it's overwhelmingly dominated by the context-switch.

              Comment

              Working...
              X