Reduce the GPU RAM used with multiple cameras in IsaacSim 2022.2.0

With IsaacSim2022.1.0, we used SyntheticDataHelper to get images from different cameras and created a different viewport for each camera. To reduce the amount of RAM used when using several cameras, we used to hide the viewports of the cameras for which we didn’t need to fetch images so at most one camera viewport was visible at each moment. We did as follows:

from omni.isaac.kit import SimulationApp
headless = False
simulation_app = SimulationApp({"headless": headless})

import omni
from omni.isaac.core.utils.prims import create_prim
from omni.isaac.synthetic_utils import SyntheticDataHelper

stage = omni.usd.get_context().get_stage()  

# For each of the camera create the camera prim and related viewport:
camera_prim = stage.GetPrimAtPath(prim_path)

viewport_interface = omni.kit.viewport_legacy.get_viewport_interface()
viewport_handle = viewport_interface.create_instance()
viewport_window = viewport_interface.get_viewport_window(viewport_handle)
sd_helper = SyntheticDataHelper()

# If need to fetch an image, then switch the viewport_window visibility before getting the image
# Get the image
sd_helper.get_groundtruth(["depth"], viewport_window)

However, now with IsaacSim2022.2.0, we use the replicator api to create the cameras and we do not know how to reduce the GPU memory used by cameras. How could we do it now? With replicators, is there a similar way to set the visibility of a camera to reduce GPU memory used?


The easiest would be to have a single viewport and set the active camera on it as needed.

Camera prims themselves do not use any extra memory, only creating multiple viewports.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.