Skip to content

Conversation

@kywch
Copy link

@kywch kywch commented May 14, 2025

Hello, thank you for maintaining the awesome robosuite!

What this does

I've experienced a GPU memory leak while running a long session with many resets. I found that self._destroy_sim() was not being called during reset because my renderer was mjviewer.

With self._destroy_sim() properly called in each reset regardless of the renderer, I no longer see the GPU memory leak.

How it was tested

I monitored nvidia-smi during my script before and after the fix.

Thanks!

@Abhiram824 Abhiram824 self-requested a review May 17, 2025 17:30
@kywch
Copy link
Author

kywch commented May 22, 2025

Here is a simple test script to demonstrate the problem. With the current code, memory usage fluctuates up to 2GB. With the fix, memory usage remains constant at around 260MB.

import robosuite

env = robosuite.make("Lift", robots=["Panda"], has_offscreen_renderer=True)

while True:
    env.reset()
    sim_ref = env.sim
    for _ in range(100):
        env.step([0] * 7)

Thanks!

@hochanb
Copy link

hochanb commented Nov 23, 2025

you saved me. I wasn't able to train more than 100,000 steps, and find out this was the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants