我有一个特斯拉C2070应该有5636554752字节的内存。当我知道有足够的内存空间时,为什么cudaMalloc会给我一个错误?
然而,这给了我一个错误:
int *buf_d = NULL;
err = cudaMalloc((void **)&buf_d, 1000000000*sizeof(int));
if(err != cudaSuccess)
{
printf("CUDA error: %s\n", cudaGetErrorString(err));
return EXIT_ERROR;
}
这怎么可能?这是否与最大存储器音调有关?这里是GPU的规格:
Device 0: "Tesla C2070"
CUDA Driver Version: 3.20
CUDA Runtime Version: 3.20
CUDA Capability Major/Minor version number: 2.0
Total amount of global memory: 5636554752 bytes
Multiprocessors x Cores/MP = Cores: 14 (MP) x 32 (Cores/MP) = 448 (Cores)
Total amount of constant memory: 65536 bytes Total amount of shared memory per block: 49152 bytes Total number of registers available per block: 32768 Warp size: 32
Maximum number of threads per block: 1024
Maximum sizes of each dimension of a block: 1024 x 1024 x 64
Maximum sizes of each dimension of a grid: 65535 x 65535 x 1
Maximum memory pitch: 2147483647 bytes
至于我运行的机器,它有24个英特尔®至强®处理器的X565,与Linux发行岩石5.4(小牛)。
任何想法?谢谢!
你在哪个平台上? – 2012-01-18 06:33:08
你得到了什么错误代码? – 2012-01-18 09:03:42
使用'cudaGetErrorString'打印错误代码总是有帮助的。这将针对问题 – jwdmsd 2012-01-18 16:54:26