I’m currently having issues trying to figure out the reason why I cannot allocate as much as the total amount of memory available on my Tesla C1060. I mean, I would not bear if it was for like a cupple of KB or even MB but in my case it’s like if more than a hundred MB were not really available. Does it sound normal to you?
Here is the code I’m using : maximumAllocatableMemory.cu
[codebox]int main(int argc,char**argv)
cudaError_t L_cuda_return; int count = 0; int *p_dev; int nb = 1000;
L_cuda_return = cudaMalloc((void**)&p_dev,nb*sizeof(int)); count++; }while (L_cuda_return == cudaSuccess);
printf("\n %u allocations really done so that a total amount of %u B has been allocated with %u B in a row",count-1,(count-1)nbsizeof(int), nb*sizeof(int));
cudaGetDeviceProperties( &deviceProp, 0 ); printf("\n The total amount of global memory available is %u B in theory, then it appears that %u B where not actually used\n",deviceProp.totalGlobalMem, deviceProp.totalGlobalMem - (count-1)*nb*sizeof(int));
the result is :
1038592 allocations really done so that a total amount of 4154368000 B has been allocated with 4000 B in a row
The total amount of global memory available is 4294770688 B in theory, then it appears that 140402688 B where not actually used
Am I missing something obvious here?
Please try this simple code (that I compile with nvcc 3.0) since I’d really like to know how it’ll end up for you.
Just for the record, I’m not using this card for graphics purpose.
Thanks for you time