Announcement

Collapse
No announcement yet.

NIR Lands In Mesa, New IR Started By High Schooler Intern At Intel

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

  • NIR Lands In Mesa, New IR Started By High Schooler Intern At Intel

    Phoronix: NIR Lands In Mesa, New IR Started By High Schooler Intern At Intel

    NIR, the new IR for Mesa that's better than the status quo (GLSL IR), has finally landed inside mainline Mesa...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Congratulations to both Connor and Jason on getting this project into master. It's been ongoing for a while now, and it's good to see it make it in.

    Now, let's see how long/difficult it is to incorporate NIR into the various other drivers (e.g. r600g through GLSL->NIR->TGSI) so that we can increase the number of shared optimization passes used throughout drivers in mesa.

    Comment


    • #3
      I wonder if OpenCL would complicate the ability of AMD to take advantage of NIR?

      Comment


      • #4
        Benchmarks please!
        ## VGA ##
        AMD: X1950XTX, HD3870, HD5870
        Intel: GMA45, HD3000 (Core i5 2500K)

        Comment


        • #5
          Originally posted by darkbasic View Post
          Benchmarks please!
          Agreed and how will NIR's performance be better than the old IR? Would be good to see some sort of benchmarking on this. Also if bugs or regressions are found who would handle the bug reports?

          Comment


          • #6
            Originally posted by Prescience500 View Post
            I wonder if OpenCL would complicate the ability of AMD to take advantage of NIR?
            No. AMD won't touch NIR directly at all, they will still base all their drivers off TGSI (and LLVM). However, eventually they will use it indirectly by having the GLSL compiler generate it, and then having that translated to NIR -> TGSI, rather than the current GLSL IR -> TGSI. OpenCL or any other API won't affect it at all.

            The NIR -> TGSI translation is already pretty much done, AFAIK, by Eric Anholt so that he can use it with the RPi driver he is working on.

            Comment


            • #7
              Originally posted by Prescience500 View Post
              I wonder if OpenCL would complicate the ability of AMD to take advantage of NIR?
              As smitty3268 said, this won't affect OpenCL for AMD. The way that the radeon drivers (r600g and radeonsi) handle OpenCL is as follows:

              1) Clover state tracker gets device OpenCL C source from the client application
              2) Clover asks the device driver (e.g. r600g) to compile the opencl c source
              3) r600g/radeonsi invokes clang/llvm to compile the CL source to LLVM IR
              4) r600g/radeonsi then takes the LLVM IR and compiles to GPU-specific machine code

              All of this happens without GLSL IR, Mesa IR, NIR, or TGSI being involved.

              Even the Nouveau drivers will likely utilize LLVM to an extent when/if they support OpenCL. Either they will compile to LLVM IR and then translate that to TGSI so that they can then compile to their machine code in the driver OR they will just convert the LLVM IR to PTX using the appropriate LLVM back end and work with that.

              Comment


              • #8
                Originally posted by Veerappan View Post
                As smitty3268 said, this won't affect OpenCL for AMD. The way that the radeon drivers (r600g and radeonsi) handle OpenCL is as follows:

                1) Clover state tracker gets device OpenCL C source from the client application
                2) Clover asks the device driver (e.g. r600g) to compile the opencl c source
                3) r600g/radeonsi invokes clang/llvm to compile the CL source to LLVM IR
                4) r600g/radeonsi then takes the LLVM IR and compiles to GPU-specific machine code

                All of this happens without GLSL IR, Mesa IR, NIR, or TGSI being involved.

                Even the Nouveau drivers will likely utilize LLVM to an extent when/if they support OpenCL. Either they will compile to LLVM IR and then translate that to TGSI so that they can then compile to their machine code in the driver OR they will just convert the LLVM IR to PTX using the appropriate LLVM back end and work with that.
                Good to know that all the drivers will be able to benefit. I can't wait to see performance comparison benchmarks. I suppose time will tell if the unified graphics driver will allow Catalyst to benefit or if it'll just help mesa reach parity faster.

                Comment


                • #9
                  Originally posted by DeepDayze View Post
                  Agreed and how will NIR's performance be better than the old IR? Would be good to see some sort of benchmarking on this. Also if bugs or regressions are found who would handle the bug reports?
                  Right now, the NIR path is actually a lot worse than the GLSL IR one since we haven't implemented SIMD16 support, as well as a bunch of other stupid things. That's why it's hidden behind an environment variable. I don't think it'll take long to catch up though, and with SSA it's a lot easier to implement more powerful optimizations that run faster. Already, we have copy propagation and dead code elimination passes that are a lot more advanced than anything GLSL IR could do, and that took me less than a day to implement. The other major thing is that with the more standard design it's a lot more straightforward to implement techniques you'll find in most recent compiler papers.

                  Comment


                  • #10
                    Originally posted by Prescience500 View Post
                    Good to know that all the drivers will be able to benefit. I can't wait to see performance comparison benchmarks. I suppose time will tell if the unified graphics driver will allow Catalyst to benefit or if it'll just help mesa reach parity faster.
                    based on what it was written about NIR i wouldn't expect some performance increase until much later. at least how i understood (and please do correct me if i'm wrong) main thing NIR brings is simplicity that enables easier work on optimizations due to flatness

                    Comment

                    Working...
                    X