Is there any way to increase the size of Nvidia Cache?

Discussion in 'Videocards - NVIDIA GeForce Drivers Section' started by PapaJohn, Mar 19, 2020.

  1. PapaJohn

    PapaJohn Master Guru

    Messages:
    402
    Likes Received:
    136
    GPU:
    Asus 6700XT OC 12Gb
    Using an older system, I really see a huge difference in the smoothness of certain games once they have stored files in the Nvidia Cache folder. In some cases, it's a night and day difference. However, I also like to play quite a few different games when I feel like it. Unfortunately, this will overwrite the existing shader cache files if it's too full and then when I go to play that game again I have to go through the whole process again of it building up it's files causing some stutter and reduced performance until it has created the ones it needs.

    Is there any way to increase the allowance of shader files stored in the cache as storage is one thing I do not lack and it would be so nice to jump from game to game with that same level of smoothness throughout.

    If not, could one of you genius Gurus come up with a solution? Thanks.
     
    BlindBison likes this.
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,543
    Likes Received:
    13,563
    GPU:
    GF RTX 4070
    How many games do you play? Hundreds?
    I am skeptic about your assumption that NVIDIA drivers check the overall space occupied by the cache.
    Any file in that cache is not that big.
    File in cache is not stored by game, it is stored by drivers, and drivers should store there only compiled shaders. I assume that each file in cache contains compiled shaders for one game.

    Cache can be emptied by 3rd party clean tools, by OS clean tool, probably by clean install of drivers.
     
  3. PapaJohn

    PapaJohn Master Guru

    Messages:
    402
    Likes Received:
    136
    GPU:
    Asus 6700XT OC 12Gb
    I have a lot of games installed on my system as I love being able to jump straight into something when I feel like it, I have a huge steam collection and currently 6TB storage to cater for that.

    Generally I've noticed it starts overwriting files when it's as little as 400mb full which honestly, only allows for a few complex games.

    For example, I can play Witcher 3 when I have installed a new driver and the first 20 or mins or so, it will stutter as it compiles and stores those shaders in the the Nvidia Cache folder. It's not just one, it's numerous amounts of files. Once they have all been stored it's a perfectly smooth experience until I maybe decide to play some other games which also store a lot of files in that same Nvidia cache folder. Lo and behold when I go back to the Witcher 3 it then has to generate and store those same files again that have been overwritten.

    All I am asking is, can this Cache folder be customised to allow greater storage of cached files or can anyone other than Nvidia come up with a solution for this? I'm not asking for judgement.

    EDIT - I also don't use cleaning tools other than DDU for a clean driver install. System runs perfectly fine, all times of shader files generated in the cache folder always correlate correctly to the times I am playing the games.
     
    Last edited: Mar 19, 2020
    BlindBison and tiliarou like this.
  4. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,016
    Likes Received:
    7,355
    GPU:
    GTX 1080ti
    nvidia's shader cache has not had an upper limit for a long time.
     

  5. PapaJohn

    PapaJohn Master Guru

    Messages:
    402
    Likes Received:
    136
    GPU:
    Asus 6700XT OC 12Gb
    If that's the case, why is it overwriting files? It's displaying exactly the same behaviour with all drivers I've tested, whether that's with a standard install/dch install or following a DDU reinstall?
     
  6. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,016
    Likes Received:
    7,355
    GPU:
    GTX 1080ti
    all games have their own unique string, updates will trigger the cache to overwrite those files.
     
  7. JonasBeckman

    JonasBeckman Ancient Guru

    Messages:
    17,564
    Likes Received:
    2,961
    GPU:
    XFX 7900XTX M'310
    There might be a maximum file limit or some other upper size limit from a few forum searches.
    https://www.nvidia.com/en-us/geforce/forums/discover/252573/shader-cache-storage-limit-control/

    I suppose it could be tested by copying and adding back shader files manually, replaying the game again and seeing if it starts clearing files or caching more and that should confirm if there is some limit or not. :)

    EDIT: Hmm and I can see a cleanup command and override for the behavior but that's with OpenGL and Linux.
    https://forums.developer.nvidia.com...che-max-size-garbage-collection/60056#5281950


    EDIT: And the shader cache itself is no longer in the Temp folder is it? That would be on Windows doing periodic scheduled cleanup if that's what this could be from if so.
     
  8. PapaJohn

    PapaJohn Master Guru

    Messages:
    402
    Likes Received:
    136
    GPU:
    Asus 6700XT OC 12Gb
    @JonasBeckman - Yeh that's correct Jonas, it's in Program Data. Every time I check, it will reach a peak of about 400-450mb and then if I play something different it will start overwriting the oldest files.

    @Astyanax - What do you mean updates? None of these games have been updated in a while and still display the same behaviour of overwriting the oldest files in the cache folder once it has reached roughly 400-450mb capacity.

    EDIT - Currently it's actually at 515mb, gonna play a couple more different games that are both DX 11 and see what happens, will report back later.
     
  9. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,016
    Likes Received:
    7,355
    GPU:
    GTX 1080ti
    my shader cache has gone as high as several gigabytes.
     
    PapaJohn likes this.
  10. PapaJohn

    PapaJohn Master Guru

    Messages:
    402
    Likes Received:
    136
    GPU:
    Asus 6700XT OC 12Gb
    So, in fairness, it did reach 650mb last night. Looked at this morning, back down to 250mb. Just don't understand why it does that if others are reaching gigabytes?

    My system is running stock and no changes made to the OS, optimized settings in my bios. I'd love to find a way of extending it's limits or at least making it work correctly if others are stating that default behaviour should be unlimited cache storage capacity.
     

  11. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,543
    Likes Received:
    13,563
    GPU:
    GF RTX 4070
    May be Windows cleans that staff automatically or by the schedule? There is an option in disk clean up "DirectX Shader Cache" - who knows whether this option is about NV files or not.
    There is setting in Storage tab called "Storage sense"
    [​IMG]

    look it up on your rig.
     
    PapaJohn likes this.
  12. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,016
    Likes Received:
    7,355
    GPU:
    GTX 1080ti
    the disk cleanup setting doesn't touch nvidia's own caches
     
    BlindBison likes this.
  13. PapaJohn

    PapaJohn Master Guru

    Messages:
    402
    Likes Received:
    136
    GPU:
    Asus 6700XT OC 12Gb
    @mbk1969 - Had a look at that and didn't see anything relating to it, will dig around in task scheduler and see if anything stands out.

    @Astyanax - Is it possible the cache folder may work differently based on the generation of the card?
     
  14. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,016
    Likes Received:
    7,355
    GPU:
    GTX 1080ti
    not likely.
     
  15. EdKiefer

    EdKiefer Ancient Guru

    Messages:
    3,128
    Likes Received:
    394
    GPU:
    ASUS TUF 3060ti
    I noticed on mine it seems to clear out according to date and usage. When this OP I checked it and I had files *SPAM* a few days back (3/17/2020). today it is only 3/19/2020 files with "around" 295mb worth but it was more when I first checked I think.
     
    PapaJohn likes this.

  16. PapaJohn

    PapaJohn Master Guru

    Messages:
    402
    Likes Received:
    136
    GPU:
    Asus 6700XT OC 12Gb
    @EdKiefer Thanks, good to know someone else is seeing the same behaviour. I wonder what it is that causes it or if it is indeed the "normal" behaviour?
     
  17. EdKiefer

    EdKiefer Ancient Guru

    Messages:
    3,128
    Likes Received:
    394
    GPU:
    ASUS TUF 3060ti
    My guess it is normal, I noticed a clearing effect for a long time. I play mainly BFv solely and it seems the files get refreshed no mather every couple of days.
     
    PapaJohn likes this.
  18. aufkrawall2

    aufkrawall2 Ancient Guru

    Messages:
    4,361
    Likes Received:
    1,822
    GPU:
    7800 XT Hellhound
    After starting a bunch of games, it completely flushed all cached shaders for Heroes of the Storm (no driver change in between) at "C:\ProgramData\NVIDIA Corporation\NV_Cache". Auto-cleaning in Windows is turned off. This is really stupid.
    Can we have a toggle to prevent flushing and to increase the cache size to any value @ManuelG ? This behavior is really inconvenient and Mesa drivers on Linux handle this much better.
     
  19. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,016
    Likes Received:
    7,355
    GPU:
    GTX 1080ti
    You could revoke the Delete permission on the nv_cache folder
     
    BlindBison, PapaJohn and aufkrawall2 like this.
  20. aufkrawall2

    aufkrawall2 Ancient Guru

    Messages:
    4,361
    Likes Received:
    1,822
    GPU:
    7800 XT Hellhound
    Huh, it seems that hint is golden. It keeps only growing and has surpassed 600MB of size, which it never did for me before. I'll try to get it a bit further and then test with Witcher 3, as it's well suited to spot shader compile stutter.
    It'd also be interesting what happens with a new driver. Ideally, it would just keep growing and I guess that will be the case. Thanks for your hint!

    If someone else wants to try:
    https://helpdeskgeek.com/how-to/prevent-file-deletion-and-file-renaming-in-windows/
    I suspect modifying it for SYSTEM user would be enough. This folder should be safe to temper with, but better know what you're doing regardless.
     
    BlindBison, RodroG and PapaJohn like this.

Share This Page