Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug Path Tracing Denoiser GPU memory leak

Discussion in 'HDRP Ray Tracing' started by cecarlsen, Apr 24, 2023.

  1. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    864
    I experience consistent crashes (in Unity 2023.1.0b13) after path-tracing about 6 sec of 60fps 1080p video with 300 samples accumulation. My GPU runs out of memory, and then it crashes when it runs out of shared memory as well. I can see that about 30mb GPU ram is eaten up for every frame rendered, disregarding the end format (image sequence, ProRes, ...). This effectively prevents me from working seriously with path-tracing.

    I am depending on Dynamic Geometry and I think it could be related to this known memory leak:
    https://issuetracker.unity3d.com/is...dering-dot-raytracingmode-dot-dynamicgeometry

    The status says a fix is "In Review". Will it make it into the next update?
     
    Last edited: Apr 24, 2023
  2. INedelcu

    INedelcu

    Unity Technologies

    Joined:
    Jul 14, 2015
    Posts:
    173
    Are you creating and destroying Dynamic Geometry renderers every frame? That bug is caused by the accumulation of acceleration structures for dynamic geometry into the cache. The fix will be available in the next beta version.
     
  3. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    864
    Nope. I've been through most of the low hanging fruits.

    Thanks for letting me know. I very much looking forward to this.
     
  4. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    864
    I have just tested 2023.2a13 which includes a potential fix to the leak. Unfortunately my GPU memory is still filling up until eventually my machine crashes. I am not creating and destroying renderers at any points, so the I could have told myself it was unrelated.

    Has anyone else attempted to render path-traced videos of GPU meshes (updated using GraphicsBuffer access with RayTracingMode set to Dynamic Geometry)? I am suspecting that garbage is created when Unity updates the RayTracingAccelerationStructure.
     
  5. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    864
    The leak has nothing to do with the above. It is caused by the denoiser(s).

    This was apparently pointed out by Keijiro six months ago in this video (in Japanese).


    So denoisers are useless when recording videos! :eek:
    Unless you can stay below 5sec clips like Keijiro ended up doing.

    Is there a fix underway?
     
    Last edited: May 7, 2023
  6. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Hey, thanks for pointing this out, can you by any chance report an issue about it so that it can get tracked and fixed on our side?
     
  7. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    864
    This thread has more on the topic. The memory leak remains.
     
    Last edited: Jul 21, 2023
  8. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    864
    The leak is fixed in Denoiser 1.0.3.
     
    newguy123 and chap-unity like this.