Shader Complilation on PC: About to become a bigger bottleneck?

Discussion in 'Rendering Technology and APIs' started by Flappy Pannus, Aug 6, 2020.

  1. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    17,282
    Likes Received:
    4,698
    Question whats the average size of the shader cache for a single game?
    If I set a limit (say 10gb) and I play a new game when the limit is reached does the driver
    A: not cache the shaders for the new game
    B: delete shaders from the least played games to make room
    C: inform you and give you some options like increasing the cache
    D: something else

    ps: Unreal Tournament from 1999 has an option to precache shaders (not sure if its the same thing)

    Edit: read on a forum post that overwatch uses about 150mb for its cache
     
    #101 Davros, Oct 13, 2021 at 6:14 PM
    Last edited: Oct 13, 2021 at 8:45 PM
  2. Flappy Pannus

    Newcomer

    Joined:
    Jul 4, 2016
    Messages:
    198
    Likes Received:
    294
    I imagine it works the same way the default (1GB) option worked before, is that when it hits that limit it starts deleting the oldest caches.
     
    Davros likes this.
  3. pharma

    Veteran Regular

    Joined:
    Mar 29, 2004
    Messages:
    4,545
    Likes Received:
    3,984
    Isn't the default cache size 256MB with the latest Nvidia driver?
     
    Remij likes this.
  4. Remij

    Regular Newcomer

    Joined:
    May 3, 2008
    Messages:
    383
    Likes Received:
    707
    Yea, I always thought it was 256MB.
     
  5. Flappy Pannus

    Newcomer

    Joined:
    Jul 4, 2016
    Messages:
    198
    Likes Received:
    294
    Hmm, was going by what some in the Nvidia reddit sub were saying, so really have no idea then. My DXCache folder is already ~400mb on my system and I have about 20 games installed.
     
    Remij likes this.
  6. DegustatoR

    Veteran

    Joined:
    Mar 12, 2002
    Messages:
    2,837
    Likes Received:
    2,687
    Location:
    msk.ru/spb.ru
    I have it on default after a clean install and the folder is 610 MB right now. So 1 GB seems more likely for default size.
     
    pharma and Remij like this.
  7. Flappy Pannus

    Newcomer

    Joined:
    Jul 4, 2016
    Messages:
    198
    Likes Received:
    294
    I'm just under a gig now, with the oldest cache file being created last Saturday. Horizon Zero Dawn takes up almost 300MB in shader cache files by itself (and 16mb in new cache after the optimization stage, indicating that's why I still get the occasional stutter/CPU spikes - it's still compiling shaders at certain points during gameplay). Not even playing that many PC games lately, this 1GB default limit was likely pushing out a lot of game caches before.
     
    Remij, pharma and pjbliverpool like this.
  8. pharma

    Veteran Regular

    Joined:
    Mar 29, 2004
    Messages:
    4,545
    Likes Received:
    3,984
    Anyone set it to "10 gig" "100 gig", or "Unlimited" yet?
     
  9. Flappy Pannus

    Newcomer

    Joined:
    Jul 4, 2016
    Messages:
    198
    Likes Received:
    294
    I set it to 10gb. Judging by how my limited playtime over a week has already got it over a gig, if anything I'd say 5GB+ should be the new 'default'.
     
  10. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    17,282
    Likes Received:
    4,698
    How many games do you think you played in the last week ?
     
  11. DegustatoR

    Veteran

    Joined:
    Mar 12, 2002
    Messages:
    2,837
    Likes Received:
    2,687
    Location:
    msk.ru/spb.ru
    I'm at 670 MB now and since installing the driver I've played 10 or so games.
    Tbh I think that 1 GB is completely adequate for a typical gaming scenario.
     
  12. pharma

    Veteran Regular

    Joined:
    Mar 29, 2004
    Messages:
    4,545
    Likes Received:
    3,984
    It shouldn't hurt allocating more since it only uses what your games demand. Whatever amount you chose is a hard ceiling (maximum) that may never be reached.
     
  13. Remij

    Regular Newcomer

    Joined:
    May 3, 2008
    Messages:
    383
    Likes Received:
    707
    I set mine to unlimited and after playing a few games I'm already at 2.6GB.

    Now it would be nice if they were able to separate the shaders into different folders based on each game/application so that we could easily delete complied shaders for games which we no longer play.

    IMO this should be an option right in the driver control panel.
     
    DavidGraham, PSman1700, Malo and 4 others like this.
  14. PSman1700

    Legend Newcomer

    Joined:
    Mar 22, 2019
    Messages:
    5,579
    Likes Received:
    2,441
    Good to see the shader compilation issue can be addressed and is worked on.
     
    pjbliverpool likes this.
  15. Jawed

    Legend

    Joined:
    Oct 2, 2004
    Messages:
    11,484
    Likes Received:
    1,844
    Location:
    London
    Sorry Davros, you're going to need to install the mystical 100 Exabyte storage system for your sacred 10TB of gaming goodness.

    Sucks, doesn't it?
     
  16. Lurkmass

    Regular Newcomer

    Joined:
    Mar 3, 2020
    Messages:
    438
    Likes Received:
    491
    By introducing a cap on precompiled shader/pipeline caches, you're potentially inviting yourself to recompilations or frametime spikes again. For example, if you set the storage limit to 1GB then any shader/pipelines encountered after this limit must always be recompiled again if you refuse to store the precompiled result ...
     
  17. DegustatoR

    Veteran

    Joined:
    Mar 12, 2002
    Messages:
    2,837
    Likes Received:
    2,687
    Location:
    msk.ru/spb.ru
    New shaders are overwriting old ones in the cache once the limit is reached.
     
    PSman1700 likes this.
  18. Lurkmass

    Regular Newcomer

    Joined:
    Mar 3, 2020
    Messages:
    438
    Likes Received:
    491
    If new shader/pipelines are overwriting then the old precompiled results are effectively deleted. Whether this cache is overwritten or not does not change my previous statement. Any refusal to keep all precompiled shader/pipelines will either mean accepting recompilation or frametime spikes.The trade-offs should be obvious to everyone by now when applying/removing storage limits to this cache. Make no mistake that this is not a unilateral solution to the PC GPU compilation problem ...
     
  19. DegustatoR

    Veteran

    Joined:
    Mar 12, 2002
    Messages:
    2,837
    Likes Received:
    2,687
    Location:
    msk.ru/spb.ru
    Old cache is unlikely to be in use since people don't play a 1000 of games all at the same time.
     
    PSman1700 likes this.
  20. Remij

    Regular Newcomer

    Joined:
    May 3, 2008
    Messages:
    383
    Likes Received:
    707
    There's always been a cap... so in essence nothing changes... so long as you're set to default or higher.

    After the cap is reached, as stated, shaders will be overwritten, as they always were. The bigger the cap simply means that cached shaders will remain cached for a longer period of time, reducing potential recompilations.
     
    Flappy Pannus and PSman1700 like this.
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...