memory - 如何将显存用作 RAM?

标签 memory memory-management cuda opencl

由于显卡提供大量 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/

相关文章:

c++ - 这个函数如何改变堆栈上声明的变量的值?

java - Java 中的 int[large][small] 或 int[small][large] 之间是否存在低级差异?

android - 在 Android 应用程序中使用 mlock()

c++ - 结合CUDA 9和GCC4.3编译的C++软件

c++ - 能否将一个类简单地传递给 CUDA 内核以进行并行评估?

c - 没有在内存中正确设置整数

python - 如何在 Python 中使用 psutil 获取程序的最大内存使用量

c - 如何写一个简单的 "page fault generator"?

c - free() 为什么不需要长度参数?

c++ - NVCC,与 -Xcompiler 的奇怪交互