Video memory has been exhausted

When you create an asset for the GPU, this typically gets populated from the cpu, a second buffer for the GPU is created. It gets sent to render a frame, In 3-4 frames we will see it. The GPU copy cannot be freed or modified until those 4 frames have passed. If you have static images geometry, then the same asset is used each from on the GPU. When you start creating and detroying assets then you end up with 4 copies in memory. Each one represents THAT SINGLE frame of dynamic data waiting to be consumed on the GPU.

One thing that exacerbates this is resizing the output buffer size. EI: doing a render at 1080p, then another one at 640. Each time the renderer changes the outbut buffer size, those buffers get locked for the frame of the GPU its used on. Then the next frame, the buffer is resized to 1080p again, but it cant re-use the 640 buffer, and it forgot about the previous 1080p buffer, so then we are consuming even more GPU memory than ever.

This is about the worst case. Dynamic geometry, with varible number of verts. Dynamic textures that are all different sizes.

If you absolutely must by dynamic then standardize your capture size so you can re-use the off screen buffers. Dig into the engine, and tell it to start reusing buffers of the proper size, but from a previous frame. This is the work that has been done on several UE4 projects to keep the memory down, remove this issue, and still maintain a high level of fidelity and qaulity.

4 Likes