I was helping a friend with CUDA "out of memory" problems, and it reminded me of a trick I discovered by chance last year.
Of course, the amount of VRAM you have available to CUDA code on your system can be disappointingly small, so you might be getting these problems legitimately. But on several occasions I've had my code run out of memory before any of my own cuda_mallocs, or on my first, smallish cuda_malloc. I had a hunch that the OS might be caching way more crap in VRAM than it needs to, and that it would help to flush the cache somehow.
I ended up trying to change and reset my color depth or screen resolution.
After doing this, the CUDA code that really should have run to begin with ran perfectly!
Design and code ©2012 Julian Panetta