Hi hopefully someone can explain my problem.
We allocate two large blocks of memory, use a kernel to process the data and then free the memory. This cycle is repeated continously for hours at a time and we have been getting after varying numbers of iterations ‘unable to allocate memory’ error. After much testing we have simplified the code to the attached memAlloc.cpp which just allocates and then frees blocks of memory with no GPU kernel processing.
The pseudo code for the attached file is as follows
Set block size to 140 Mbytes
// allocate a large block of memory to ensure incresing block size is possible
Allocate a single 420 Mbyte block of gpu memory
Free the 420 Mbyte block of gpu memory
loop a 1000 times or stop on error
Allocate a block of memory - block1
Allocate a second block of memory - block2
Free block 1
Free block 2
increase the size of the block by 320 bytes
The memory allocation will fail between 500 and 800 iterations
The same program without changing the size of the blocks allocated will run many minutes ( forever ? ). A single block, fixed or changing size will run for many minutes ( forever? ).
GPUs Tested 8800GTX 9800GTX GTX260
Windows XP Professional Service Pack 2 ( 32bit )
Intel Quad core PC
AMD Dual core PCs
memAlloc.cpp (2.2 KB)