由于显卡提供大量 RAM(0.5GiB 到 2GiB),并且使用 CUDA 访问 GPU 并没有那么困难。 , Stream更便携OpenCL我想知道是否可以将图形内存用作RAM。 Grahics RAM 可能比 real RAM 有更大的延迟(来自 CPU),但它肯定比 HDD 快,因此它可能是缓存的最佳选择。
是否可以直接访问图形内存,或者至少在自己的应用程序中使用薄内存管理层(而不是免费用于操作系统)?如果是这样,最好的方法是什么?
最佳答案
是的,您可以在 Linux 上将其用作交换内存。引用链接here了解更多详情。
With Linux, it's possible to use it as swap space, or even as RAM disk.
Be warned
It's nice to have fast swap or RAM disk on your home computer but be warned, if a binary driver is loaded for X, it may freeze the whole system or create graphical glitches. Usually there is no way to tell the driver how much memory could be used, so it won't know the upper limit. However, the VESA driver can be used because it provides the possibility to set the video RAM size.
So, Direct Rendering or fast swap. Your choice.
Unlike motherboard RAM and hard drives, there aren't any known video cards that have ECC memory. This may not be a big deal for graphics rendering, but you definitely don't want to put critical data in it or use this feature on servers.
关于memory - 如何将显存用作 RAM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6321551/