我有一個特斯拉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