owl-project / NVISII

Apache License 2.0
319 stars 27 forks source link

GPU Memory Estimation #156

Open guystoppi opened 1 year ago

guystoppi commented 1 year ago

When I make my scene too complicated, the NVISII renderer runs out of GPU memory. Obviously, this is inevitable, but it would be nice if I could get the size of a scene in memory before I call nvisii.render() so I can try to reduce the memory usage.

Is there already something I can call that estimates the GPU memory usage?

natevm commented 1 year ago

Hm, good question.

At the moment we don’t have a good way to report this. It is an interesting thing to consider, but would be a lot of work to add…

In general, memory goes to:

Textures and meshes you can compute, because you know how many vertices and indices a mesh uses, or how many pixels a texture has.

Component arrays are pre allocated, but the sizes of these allocations can be reduced depending on your workload using the optional parameters to nvisii.initialize.

Acceleration structures are a bit more difficult. In general, an acceleration structure will be 2-4X larger than the mesh being “accelerated” for ray traversal. But it depends on a lot of variables…