当VRAM满时会发生什么?

7

我想了解当前nvidia/AMD处理VRAM资源分配的实现。

我们已经知道操作系统在系统RAM满时使用交换/虚拟内存,那么当涉及到VRAM时,相当于交换的是什么?它们会回退到系统RAM还是硬盘?

我认为回退到系统RAM是合理的,但从我的经验来看,当视频游戏的视频内存空间不足时,它们会严重卡顿(典型FPS的1/20),这让我怀疑它们是否在使用系统RAM,因为我认为系统RAM并不会使游戏如此卡顿。

简而言之,我想了解当前的实现情况以及导致游戏在内存不足的情况下卡顿的最大瓶颈是什么。


我已经重新标记了你的问题(因为我认为应该这样),所以请检查并修复如果您不同意。 - Spektre
1个回答

5
  1. the swapping is really done to RAM

    if there is enough RAM to swap to. Swapping to file is unusable due to slow speed see next bullet

  2. The RAM it self is not that slow (still slower) but the buses connected to it are

    while swapping system memory to swap file the memory swap occur when needed (change focus of application,open new file/table,...) this is not that frequent but if you are out of VRAM then you are in trouble because usually most of gfx data is used in each frame.

    This leads to swapping per frame so you need to copy usually very large data blocks very often for example swapping 256MB 20fps leads to:

    256M x 2 x 20 = 10 GB/s read
    256M x 2 x 20 = 10 GB/s write
    

    which is 20GB/s bandwidth needed of coarse depending on the memory controller and architecture You can do read/write simultaneously up to a point so you can get close to 10GB/s in total theoretically but still that is huge number for only 256MB chunk of data look here:

    My setup at that time has memory write only around 5GB/s which is nowhere near the needed memory transfer rate needed for such task


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接