我有一台带有2Gb内存的GTX570,当我尝试使用一个cudamalloc调用分配更多内存而不是大约804Mb时,我遇到了麻烦。有人为什么这么想?这是我的第一个电话,所以我怀疑它是碎片。
没问题:
Memory avaliable: Free: 2336116736, Total: 2684026880
requesting 804913152 bytes
no error
Memory avaliable: Free: 1531199488, Total: 2684026880
requesting 804913152 bytes
no error
Memory avaliable: Free: 726286336, Total: 2684026880
问题:
Memory avaliable: Free: 2327601152, Total: 2684026880
requesting 805306368 bytes
out of memory
Memory avaliable: Free: 2327597056, Total: 2684026880
requesting 805306368 bytes
out of memory
Memory avaliable: Free: 2327597056, Total: 2684026880
答案 0 :(得分:1)
这会导致Windows WDDM子系统施加限制。对于可以分配多少内存存在严格限制,计算为
MIN ( ( System Memory Size in MB - 512 MB ) / 2, PAGING_BUFFER_SEGMENT_SIZE )
对于桌面窗口,PAGING_BUFFER_SEGMENT_SIZE约为2Gb IIRC。您有两种方法可以解决此问题: