Skip to content

[BUG]: GPU memory leak per created/destroyed render product while /app/asyncRendering is true (Render Graph Texture) #964

Backlog

Description

@j-marwitz-code

Description

Every rep.create.render_product(...) / render_product.destroy() cycle leaves GPU memory behind while /app/asyncRendering is true. The RTX memory statistics (omni.hydra.engine.stats.get_mem_stats(detailed=True)) show that only the category Render Graph Texture grows: exactly 256 MiB per cycle at 2472x2064 with the annotators LdrColor, distance_to_camera and normals. The memory is not released when idle, so a service that captures on demand runs out of VRAM after a few dozen captures.

With /app/asyncRendering set to false at runtime the same loop is flat.

isaacsim.exp.base.kit sets asyncRendering = false, but in isaacsim.exp.full.kit the setting is true at runtime (also when started through SimulationApp), and --/app/asyncRendering=false on the command line does not stick. isaacsim.exp.base.python.kit (setting stays unset) does not leak.

Steps to reproduce

Empty stage with one cube, one dome light, one camera; 10 create/attach/render/detach/destroy cycles. Script below.

./python.sh render_product_leak.py           # leaks
./python.sh render_product_leak.py --sync    # flat

Output on 6.0.1 (/app/asyncRendering = True):

iteration  1: process 3650 MiB, render graph textures 306 MiB
iteration  2: process 4121 MiB, render graph textures 561 MiB
iteration  3: process 4592 MiB, render graph textures 817 MiB
iteration  5: process 5662 MiB, render graph textures 1329 MiB
iteration 10: process 8145 MiB, render graph textures 2609 MiB

With --sync (/app/asyncRendering = False):

iteration  1: process 3183 MiB, render graph textures 50 MiB
iteration  5: process 3055 MiB, render graph textures 50 MiB
iteration 10: process 3119 MiB, render graph textures 50 MiB

In the memory scope statistics the growth sits under SceneRenderer RTX 0 / Viewport RTX 0 (PathTracing, PrevGBuffer, DLSS, TemporalAA Depth, Tonemapping, GBuffer): the per-render-product render graph resources of the destroyed products.

Expected: the render graph textures of a destroyed render product are released, as they are with async rendering off.

"""GPU memory grows with every created/destroyed render product while /app/asyncRendering is true.

Run:  ./python.sh render_product_leak.py            -> leaks (~500 MB per iteration at 2472x2064)
      ./python.sh render_product_leak.py --sync     -> flat (sets /app/asyncRendering=false at runtime)
"""
import os
import subprocess
import sys

from isaacsim import SimulationApp

app = SimulationApp({"headless": True}, experience=os.path.join(os.environ["EXP_PATH"], "isaacsim.exp.full.kit"))

import carb.settings  # noqa: E402
import omni.replicator.core as rep  # noqa: E402
import omni.usd  # noqa: E402
from omni.hydra.engine import stats as engine_stats  # noqa: E402

RESOLUTION = (2472, 2064)
ANNOTATORS = ("LdrColor", "distance_to_camera", "normals")
settings = carb.settings.get_settings()


def process_mib() -> int:
    out = subprocess.run(
        ["nvidia-smi", "--query-compute-apps=pid,used_memory", "--format=csv,noheader,nounits"],
        capture_output=True, text=True,
    ).stdout
    return next((int(l.split(",")[1]) for l in out.splitlines() if int(l.split(",")[0]) == os.getpid()), -1)


def render_graph_texture_mib() -> int:
    return next(m["size"] for m in engine_stats.get_mem_stats(detailed=True) if m["category"] == "Render Graph Texture")


omni.usd.get_context().new_stage()
rep.create.cube()
rep.create.light(light_type="dome")
rep.create.camera(position=(5, 5, 5), look_at=(0, 0, 0))
for _ in range(20):
    app.update()
camera = next(str(p.GetPath()) for p in omni.usd.get_context().get_stage().Traverse() if p.GetTypeName() == "Camera")

if "--sync" in sys.argv:
    settings.set("/app/asyncRendering", False)
    for _ in range(20):
        app.update()
print(f"LEAKTEST /app/asyncRendering = {settings.get('/app/asyncRendering')}", flush=True)

for i in range(1, 11):
    render_product = rep.create.render_product(camera, resolution=RESOLUTION)
    annotators = [rep.AnnotatorRegistry.get_annotator(name) for name in ANNOTATORS]
    for annotator in annotators:
        annotator.attach(render_product)
    for _ in range(60):
        app.update()
    for annotator in annotators:
        annotator.detach(render_product)
    render_product.destroy()
    for _ in range(10):
        app.update()
    print(f"LEAKTEST iteration {i:2d}: process {process_mib()} MiB, render graph textures {render_graph_texture_mib()} MiB", flush=True)

app.close()

Isaac Sim version

6.0.1 and 6.2.0-rc.14 (same behaviour, ~585 MiB process memory per cycle on 6.2.0). Also seen on 6.1.0 (streaming app, vGPU).

Operating System (OS)

Ubuntu 24.04

GPU Name

RTX 5090 (also NVIDIA L40S vGPU, 24 GB)

GPU Driver and CUDA versions

580.178.04

Additional information

Reusing one render product instead of creating a new one per capture did not help in our application (memory still grew while async rendering was on). Workaround: carb.settings.get_settings().set("/app/asyncRendering", False) at runtime.

Activity

  1. lhuang-svg commented on Nov 30, 2026

    @lhuang-svg

    Thanks for the detailed report and the self-contained script. We reproduced this on 6.0.1 (RTX PRO 6000 Blackwell, driver 580.178.04): with /app/asyncRendering = True, Render Graph Texture grows by 256 MiB per create/destroy cycle, and with async rendering off it stays flat at 50 MiB.

    Why --/app/asyncRendering=false doesn't stick: isaacsim.exp.full.kit enables exts."isaacsim.core.throttling".enable_async, and that extension sets /app/asyncRendering = true at startup, overriding the command-line value. It only switches async rendering off while the timeline is playing.

    Workaround: turn off the throttling extension's async toggle instead:

    ./python.sh your_script.py --/exts/isaacsim.core.throttling/enable_async=false

    or with SimulationApp:

    app = SimulationApp(
        {"headless": True, "extra_args": ["--/exts/isaacsim.core.throttling/enable_async=false"]},
        experience=os.path.join(os.environ["EXP_PATH"], "isaacsim.exp.full.kit"),
    )

    With this setting, your repro stays flat for all 10 iterations. Setting /app/asyncRendering to False at runtime, as you did, also works.

    We've passed the underlying leak (render graph resources of destroyed render products not freed under async rendering) to the rendering team. We'll update this issue when there's a fix.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions