Announcement

Collapse
No announcement yet.

Gallium3D Now Supports NIR Shader Disk Cache

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

  • Gallium3D Now Supports NIR Shader Disk Cache

    Phoronix: Gallium3D Now Supports NIR Shader Disk Cache

    With the Gallium3D OpenGL on-disk shader cache most notably used right now by the RadeonSI driver, TGSI is the intermediate representation currently being cached to the disk for speeding up game load times, etc. Given the RadeonSI NIR back-end continuing to mature, Timothy Arceri of Valve has added NIR caching support...

    http://www.phoronix.com/scan.php?pag...R-Shader-Cache

  • #2
    So what exactly happens, when both Steam and the driver caches a shader? And of course the application may too. What happens if the program has its own cache, like emulators, and they're being launched by Steam, and running on this driver? Whose cache wins? Does having 800 caches decrease performance and defeat the purpose?

    Comment


    • #3
      Originally posted by eydee View Post
      So what exactly happens, when both Steam and the driver caches a shader? And of course the application may too. What happens if the program has its own cache, like emulators, and they're being launched by Steam, and running on this driver? Whose cache wins? Does having 800 caches decrease performance and defeat the purpose?
      Shouldn't be an issue? If a program has its own built-in caching support like with the relevant GL extension, the program/game should be checking its own cache prior to querying the driver for the shader, etc. The Steam cache afaik is just populating the Mesa or NVIDIA on-disk shader cache directory with relevant pre-compiled caches... but not implementing its own functionality. And then this NIR or TGSI cache just comes down to what code path the driver is taking.
      Michael Larabel
      http://www.michaellarabel.com/

      Comment


      • #4
        Originally posted by eydee View Post
        So what exactly happens, when both Steam and the driver caches a shader?
        it does not happen, steam caches shader in driver(passes its cache dir to driver)
        Originally posted by eydee View Post
        And of course the application may too.
        it can't. it can keep compiled shader, but it then has to pass it to interface which expects compiled shader and can't use cache(which needs source shader as its input)
        Originally posted by eydee View Post
        Whose cache wins?
        there is no fighting

        Comment


        • #5
          FYI the poor performance in Madmax on low settings was caused by an LLVM bug which has been fixed recently. I haven't yet looked into the reported hang on the medium and high settings.

          Comment


          • #6
            What's so cool of NIR over TGSI? Can someone explain this ongoing(?) migration to NIR?

            Comment


            • #7
              Originally posted by timofonic View Post
              What's so cool of NIR over TGSI? Can someone explain this ongoing(?) migration to NIR?
              https://video.fos.../radeonsi.webm
              Last edited by xxmitsu; 02-11-2018, 02:56 AM.

              Comment


              • #8
                Originally posted by eydee View Post
                So what exactly happens, when both Steam and the driver caches a shader? And of course the application may too. What happens if the program has its own cache, like emulators, and they're being launched by Steam, and running on this driver? Whose cache wins? Does having 800 caches decrease performance and defeat the purpose?
                When the driver compiles shaders it hashes the source and uses it to index the cache files, so that it finds the cached compiled code matching the shader source when that source is passed (or pointed to) again.

                If the app caches a compiled shader then it passes the compiled version. The driver doesn't compute a hash of it, it doesn't put it in the cache, because it has no source to hash to produce an index, nor does it need to compile the already compiled shader. Recall that the point of the cache is to save time compiling.

                So then yes, the app's cache 'wins' but there's no contention whatsoever. Worst case scenario the driver temporarily maintains a duplicate cache until it retires it. The app knows it will keep using it so it hangs onto it, that's in some ways better than having the driver dumping the cache if you don't use it for a while.
                Last edited by linuxgeex; 02-12-2018, 06:07 AM.

                Comment

                Working...
                X