Cycles GPU Potential Bug / Memory Leak?

Hello,
I’m working on an animation in cycles which isn’t particularly intensive (95k Tris). It’s being rendered on a GeForce GTX 650, which I know is one of the lower end graphics cards but it has 1GB of Memory, which should be enough to render a basic scene.
However, when I leave my animation to render, it keeps stopping and producing this error:
CUDA error Out of Memory in cuMemAlloc( device_pointer,mem.memory_size)

This would suggest that I simply don’t have enough memory to render the scene but I don’t think it’s as simple as that. When the error occurs, the ‘Mem’ amount on the Info panel is at around 450MB and the ‘Mem’ amount on the Image Editor window (where it’s rendering) is at around 85MB. I don’t know which number is the actual amount that the GPU is using, but neither of these are anywhere near 1024MB…

When this error occurs, I can close and reopen Blender, upon which the ‘Info Mem’ drops down to 130MB and the scene renders fine, so I feel like there’s some sort of memory leak going on here.

(It might be worth noting that I’m using a 1080p Movie as an image texture for one of the materials)

Has this happened before to anyone, and should I file a bug report? Any help would be greatly appreciated :slight_smile:

Check with this tool how many GPU memory the file use when it render for example https://www.techpowerup.com/gpuz/

Hi. Blender does not report the real vRAM usage by CUDA. You have to monitor the use of vRAM while render with an external monitor, such as GPU-Z. 1GB of VRAM is really very little memory.
What version of Blender you use?

Edit:
My guess is that you’re really on the limit to exceed the vRAM, and any peak makes bring up the CUDA error. But just in case since you mentioned “animation”: do you have enabled motion blur?
If the answer is “yes”, again, what version of Blender you use?

Yes I know 1GB isn’t much, but it’s never been an issue before…
Anyway I’m looking at GPU-Z (cheers for the link Benny) and it says that the GPU is using 530MB of its vRAM when it’s rendering stably, but I think I may have found the issue. On my Movie Image Texture, I had Auto Refresh checked, so I could view the correct frame in the 3D viewport. After I disabled that, the render seems to be much more stable.

After experimenting with Auto Refresh enabled, I’m almost certain there’s a memory leak going on. While scrubbing across the timeline in Rendered preview, the Mem tab increases rapidly into the hundreds of megabytes, and the vRAM used when rendering after that scrubbing is increased by 200MB. So yes, I must have been exceeding the GPU’s vRAM, but not due to the complexity of the scene.

Thanks for the help :slight_smile:

P.S. I’m not using motion blur, and it’s v2.77a

Download Blender 2.78a, it has a lot of optimizations regarding vRAM usage:
https://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.78/Cycles

Go to Blender-user preferences-system and increase your memory cash limit to maximum RAM you have on your computer.

update Nvidia driver and download and install new Cuda tollkit 8.0

Also in NVidia panel settings in 3d settings make sure that power management mode set to Prefer maximum performance and not to Adaptive or Optimal

  • use Ccleaner to clean your comp, optimize your disks