No announcement yet.

RADV Adds Knobs To Force Shader Re-Compilation - Helping Games On The Steam Deck

  • Filter
  • Time
  • Show
Clear All
new posts

  • RADV Adds Knobs To Force Shader Re-Compilation - Helping Games On The Steam Deck

    Phoronix: RADV Adds Knobs To Force Shader Re-Compilation - Helping Games On The Steam Deck

    Valve's Steam Deck is a heavy user of relying on pre-compiled shaders to yield quicker start times and a more efficient handheld gaming experience. But in cases where bugs happen and a shader compiler fix needs to be back-ported, there isn't a straight-forward means of properly handling that for the Steam Deck. But with new knobs being added to the Mesa RADV driver code, there will be some options for better dealing with this moving forward...

    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
    Doesn't it prefer the game cache? Surely if that's replaced with the fixed shaders there would be no need to recompile on the Deck #confused


    • #3
      I don't think radv did implement that feature specifically not even for steam even less for the steam deck, so I understand mentioning steam deck because downstream it's 1 prominent example of where that will be used, but putting steam deck in the title and the only picture in the article a steam deck is strange to me.

      I get it a steam deck looks nicer than the mesa symbol, and showing pictures of "software" is harder than for hardware but still it's very misleading, when it's a general AMD / Mesa news and only to a small degree related to steam deck.

      And in general even I eventually will probably buy a used steam deck, I hate that most development is focused on this proprietary prison system. So far that it's a pain in the ass to access mods for games outside of steam because they are somehow despite being "free" exclusively published over the steam workshop BS.

      But even Lutris does not support proprietary installers they seem to not even try, while opensource should not have a bias/favor for promoting proprietary legal software, if at all it should be a way to fight against it, like ReactOS is a attempt to free 100% of users from Windows, now that is no piracy, but not being able to freely copy is against free software, having anti features like DRM in Software is against free software.

      Now there is a fine line in assisting piracy and being neutral about it in a legal way, but there is ton's of room like I don't see why lutris installer scripts could not provided, maybe not in their main repo but in some other repo, and there could be attempts to have universal Mod Managers, where also people that bought their game legally over GOG could benefit.

      YES one advantage of the Steam machine is that you can do piracy without a mod chip, sue me for saying the truth, and yes without piracy or at least the possibility of it, the prices of games on the PC Platform would be as high as for consoles, you can all virtua signaling on me for hating on piracy, but even the "honest" buyers profit from it. Not to mention when even game companies install no-cd cracks on their official games because they lost access to the source or it was just cheaper to use that than to implement it themself.

      We have what like 2000 Distros but not 1 is designed for piracy but we have Hannah Montana Linux, really, I rest my case

      Linus could attract a lot of new users if they would provide a steam like experience for "pirates", that could be a platform advantage.


      • #4

        It was added to Mesa by one of Valve's Linux developers literally for Steam Deck usage. It just happens to be done in a way that everyone can benefit, but it is for the Steam Deck. Now we/they/whomever can add some env variables to our launch parameters, Proton init scripts, or wherever to fix shaders when they go wonky due to software mismatches.

        Anyhoo, to address the rest of that, the problem is that the US has made it hard to be neutral about anything by writing laws that fine the server owner for things the end users say or do with their services and not the end-users themselves. Apparently its hard to track anonymous people using fake names and Tor so they gotta attack the low hanging fruit and easy targets.

        By even having non-free repositories, hosting "for educational purposes" software, or even allowing discussions that go in-depth with links and how-to manuals, the hosters, like Michael here at Phoronix, put themselves at risk to prosecution and punishment for what assholes like you and me say and do. DMCA-like laws have since trickled down into other allied countries so there are few safe havens to host questionable content. That said, if you go down the rabbit-hole you'll find that a lot of what you're proposing, the piracy stuff and questionable content, does exist. It's a constant game of cat and mouse with police and content owners so names and whatnot are always changing. Tor and logless VPNs are your friend.

        Piracy isn't an advantage of a Steam machine, it's an advantage of any personal computer in existence. Any computer can do piracy without a mod chip. Things like Steam Decks and Machines just put the same common hardware up front of a lot of people so piracy developers can more easily share code and program around the same quirks and hardware bugs which can make things easier and speed up development since they don't need 47 if-thens to handle every generation of CPU in existence because everyone has the same CPU. Fixed variables are why modded consoles have such optimized software and piracy experiences when compared to dynamic variable PC software.

        What does any of that piracy stuff have to do with RADV shader cache and times where OEM provided shaders might need a recompile?


        • #5
          blackiwid you might want to actually read the article; you're making a lot of unnecessary conclusions.


          • #6
            doesn't shader compilation on steam are done using CPU?


            • #7
              loganj Yes, the shaders are compiled using the CPU.

              Steam has a mechanism, where it can download all of the games' "raw" shaders and "replay" them before launching a title. This in turn causes the graphics driver to compile them for your specific hardware, populating a cache, such that this doesn't happen while playing the games. Replaying and recompiling the shaders can then be skipped the next time.

              What happens every now and then though, is that changes/fixes to Mesa's shader compiler get backported, but the software version number stays the same. Such changes can break the shader ABI and should always invalidate the cache, which doesn't happen due to the version number though.

              This can manifest as a variety of issues: I.e. subpar performance, graphical glitches in games, application crashes or even complete system crashes/freezes due to an oopsie on the graphics driver level.

              Thus, there's a need for an override, to force repopulating the cache with freshly compiled shaders.
              An alternative would be deleting ~/.cache/mesa_shader_cache and ~/.cache/radv_builtin_shaders{32,64}, but that's not on a per-game basis and forces the shaders for all applications to be recompiled, which can take a huge amount of time, esp. with large game libraries.


              • #8
                several times I've had to hunt for shader cache directories to delete them after an os upgrade. they should really standardize on ~/.cache/$APP_NAME/gpu for these, so I can just purge them. but many apps tuck them in ~/.local or ~/.config directories with nonstandard names.


                • #9
                  Originally posted by schmidtbag View Post
                  blackiwid you might want to actually read the article; you're making a lot of unnecessary conclusions.
                  I find it comical that their reply was longer than the article they didn't seem to read.
                  Not to knock the person. I'm guilty of similar things. I try to be a good netizen.


                  • #10
                    Originally posted by Mitch View Post

                    I find it comical that their reply was longer than the article they didn't seem to read.
                    Not to knock the person. I'm guilty of similar things. I try to be a good netizen.
                    That's called "I want to talk about piracy and I just found an article with the Steam Deck in the title, sounds like a good place to go."