Memory problem (bis repetita)

Hi all,

I explain quickly my problem, even if I’ve already exposed it previously in another post.

I want to build a float* of size 19200x2048.

So, I do the following :

dist_alloc = cudaMallocPitch( (void **) &dist_dev, &dist_pitch, 2048*sizeof(float), 19200);

I have a 8800GTX (768MB DDR3).

My matrix has a memory sizeof 2048x19200x4 = 157286400 Bytes = 157MB.

The free memory is 747335680 Bytes (I use cuMemGetInfo).

The problem is that I call my program many times and there is an allocation problem.

I know that I properly free my memory (because the free memory is the same in the beginning and on the end of the program). I manage the error by stoping the program is the allocation failed. So I print all the useful informations to understand my mistake but I don’t understand what is the problem :

ERROR MEMORY ALLOCATION  : unknown error

Variable                 : dist_dev

Free memory              : 747335680

Whished allocated memory : 157286400

The error message (provided by cudaGetErrorString) is “unknown error”.

Somebody tellsme that find X MB of linear memory is not the same of finding X MB of memory and I agree with that. But, in my case,with the first iterations, the memory required is found and after a couple of iterations, even if the free memory is the same, the memory allocation problem appears.

Maybe I could use cuMemAllocPitch but I think that the problem will be the same…

I ran into the exact same problem. One solution that worked for me was to init the memory once before the loop. You can see the discussion here:

[url=“The Official NVIDIA Forums | NVIDIA”]http://forums.nvidia.com/index.php?showtop...&st=0&p=346861&[/url]

I’m wondering if this is possibly a driver bug.