I’ve got a weird problem, which i’m hoping others have had and solved. When I call cuCtxCreate after X amount of runs of my app it gets into a state where it fails and returns CUDA_ERROR_OUT_OF_MEMORY, even though I check the memory and nothing is allocated at that point. Restarting visual studio doesnt fix this and I have to restart the computer for this problem to go away, until it comes back after X number of app runs. Which is a bit annoying, having to reboot every 30-60 mins.
My guess is that since im debugging, and not always hitting the code that deallocates/destroys the context, its left lingering somewhere in the CUDA runtime running in windows, which accumulates until the stack for contexts is full. Which is then cleared upon rebooting.
I am also facing the same problem. After some 15-20 runs of my application cuCtxCreate fails with error CUDA_ERROR_OUT_OF_MEMORY. Surprisingly, this error comes only with my Quadro FX 5600 card. Everything works fine on my laptop GeForce 8400M GS.
I am stuck at this place. Any help would we appreciated. Thanks!!
Try use cuMemGetInfo(&free_mem, &total_mem) in your program after you create the context and just before you destroy it/ exit the program to check if you have memory leaking from somewhere.