页锁定主机内存分配的最大大小是多少? [英] What is the maximum size of a page-locked host memory allocation?

查看:679
本文介绍了页锁定主机内存分配的最大大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在64位Ubuntu 13.04上运行CUDA 5.0,NVIDIA GTS 250具有1 GB内存和NVIDIA驱动程序319.17。我在我的计算中使用的数据集太大,不适合卡本身,所以我试图在主机系统上分配页锁定内存使用 cudaHostAlloc cudaHostAllocMapped 标志。我使用的数据大小约为18 GB,主机有24 GB的RAM。我的问题是,每当我尝试分配超过4 GB的页锁定内存,在任何数量的块,我被给予内存不足的错误。使用标准C malloc 我可以一次分配整个18 GB,但如果我尝试映射它与 cudaHostRegister 我仍然限制为4 GB。

I'm running CUDA 5.0 on 64-bit Ubuntu 13.04 with an NVIDIA GTS 250 that has 1 GB of memory and NVIDIA driver 319.17. The data set I'm using in my computations is too large to fit on the card itself, so I'm trying to allocate page-locked memory on the host system using cudaHostAlloc with the cudaHostAllocMapped flag. The data I'm using is about 18 GB in size, and the host has 24 GB of RAM. My problem is that whenever I try to allocate more than 4 GB of page-locked memory, in any number of chunks, I am given the "out of memory" error. With the standard C malloc I can allocate the whole 18 GB in one shot, but if I try to map it with cudaHostRegister I am still limited to 4 GB.

CUDA中页锁定分配的最大大小是多少?这是我的系统中的问题,还是由硬件,驱动程序或CUDA版本设置的此限制?是否有任何方法可以分配可以为GPU映射的大型数组?

What is the maximum size of a page-locked allocation in CUDA? Is this a issue in my system or is this limit set by the hardware, the driver, or the CUDA version? Is there any way to allocate such a large array that can be mapped for the GPU?

推荐答案

支持32位寻址。如果您删除 cudaHostMapped 标志(和 cudaDeviceMapHost 标志),您可能可以分配超过4GB的固定内存从 cudaSetDeviceFlags())。

SM 1.x class hardware only supports 32-bit addressing. You might be able to allocate more than 4GB of pinned memory, provided you remove the cudaHostMapped flag (and the cudaDeviceMapHost flag from cudaSetDeviceFlags()). That would enable you to use asynchronous memory copies to transfer data into and out of GPU memory.

但是为了映射超过4G内存,可以使用异步内存副本将数据传入和传出GPU内存。您需要在64位平台上使用SM 2.x或更高版本。

But to map more than 4G of memory, you need to use SM 2.x or later, on a 64-bit platform.

这篇关于页锁定主机内存分配的最大大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆