Closed odusseys closed 9 months ago
I don't see a reason why this would leak memory, so there may be something going on outside this function. The antialias op stores a couple of temporary objects for the gradient pass, and if you accidentally hold onto these across iterations, that might explain increasing memory consumption — see the first item here.
However, these objects shouldn't be big enough to immediately fill the GPU memory, unless your mesh has a massive number of triangles (tens or hundreds of millions).
The function above looks fine to me, so hunting this down would require a stand-along reproducer. If this is a bug in the antialiasing op itself, it has to be some sort of a corner case, or the inputs have to be extreme in some way that hasn't come up in other projects that have used this op.
I am using the following code snippet to render a scene:
Here,
cam
is a Kaolin camera, but you can assume that everything fromproj=...
is standardIf I remove the commented line which performs the antialiasing step, I get an instant memory leak. After rendering a couple images, CUDA memory is full, and resetting its cache / performing gc only clears a fraction of the used memory. Removing the antialiasing leads to no noticeable GPU memory usage whatsoever (T4 card).
For reference - I am using