0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

NVIDIA Isaac Lab の GUI レンダリング高速化方法(RT factor改善)

0
Posted at

はじめに

NVIDIA Isaac LabのGUIレンダリングの高速化方法について紹介する。Isaac Lab 2.3のデフォルト設定だと、headless 実行では問題になりにくいが、GUI モードではKitのフレームレート制限によってシミュレーション速度が制限され、RT factor(リアルタイムファクター)が x1.0 を下回る場合がある。本記事の設定をすることで、GUIレンダリング有効時でもシミュレーション性能の低下を抑えられる。

動作確認環境

方法

Isaac LabのIssue 3458のコメントで挙げられているように、以下のKit引数を追加することで速度が改善する。

  • app.runLoops.main.rateLimitEnabled=false (default: true)
  • rtx.post.dlss.execMode=0

特に、app.runLoops.main.rateLimitEnabled=falseがパフォーマンス改善に有効である。
Isaac Lab の GUI 実行では、Kit の main loop にレート制限(デフォルト120Hz)が入っているため、シミュレーション速度よりも GUI 更新周期が律速になってしまう。
app.runLoops.main.rateLimitEnabled=falseを指定すると、このフレームレート制限が解除され、GPU/CPU が許す限りシミュレーションが進行する。

これらの設定は、実際に NVIDIA の GR00T-VisualSim2Real でも使用されている。

IsaacLabのPythonスクリプトを起動する際に、--kit_argsのオプションでこれらの設定を有効化する。

--kit_args="--/app/runLoops/main/rateLimitEnabled=false --/rtx/post/dlss/execMode=0 "

実際の使い方は、以下の効果確認の章で紹介する。

効果確認

計測環境

ベンチマークコード

bench_franka_minimal.py
"""Minimal Franka RT-factor benchmark using stock Isaac Lab kit + kit_args override.

Usage:
    # Baseline (Kit defaults, 120Hz rate cap on)
    python bench_franka_minimal.py

    # Disable main loop rate limit
    python bench_franka_minimal.py \
        --kit_args="--/app/runLoops/main/rateLimitEnabled=false"

    # Disable rate limit + DLSS Performance mode
    python bench_franka_minimal.py \
        --kit_args="--/app/runLoops/main/rateLimitEnabled=false --/rtx/post/dlss/execMode=0"
"""
import argparse, time
from isaaclab.app import AppLauncher

parser = argparse.ArgumentParser()
parser.add_argument("--task", default="Isaac-Reach-Franka-v0")
parser.add_argument("--num_envs", type=int, default=1)
parser.add_argument("--steps", type=int, default=1500)
AppLauncher.add_app_launcher_args(parser)
args = parser.parse_args()

app_launcher = AppLauncher(args)
simulation_app = app_launcher.app

import gymnasium as gym
import torch
import isaaclab_tasks  # noqa: F401
from isaaclab_tasks.utils import parse_env_cfg

env_cfg = parse_env_cfg(args.task, device=args.device, num_envs=args.num_envs)
env = gym.make(args.task, cfg=env_cfg)
env.reset()

action = torch.zeros(env.action_space.shape, device=env.unwrapped.device)
step_dt = float(env.unwrapped.step_dt)

t0 = time.perf_counter()
with torch.inference_mode():
    for _ in range(args.steps):
        env.step(action)
wall = time.perf_counter() - t0

sim_time = args.steps * step_dt
print(f"sim={sim_time:.2f}s  wall={wall:.2f}s  RT={sim_time / wall:.3f}x")

env.close()
simulation_app.close()

実行例 (4 構成のベンチマーク)

(1) Baseline — Kit デフォルト (120Hz rate cap on)

python bench_franka_minimal.py

(2) rate_limit のみ off

python bench_franka_minimal.py \
    --kit_args="--/app/runLoops/main/rateLimitEnabled=false"

(3) DLSS Performance mode のみ

python bench_franka_minimal.py \
    --kit_args="--/rtx/post/dlss/execMode=0"

(4) rate_limit off + DLSS Performance mode (両方)

python scripts/bench_franka_minimal.py \
    --kit_args="--/app/runLoops/main/rateLimitEnabled=false --/rtx/post/dlss/execMode=0"

出力例

sim=50.00s  wall=62.44s  RT=0.801x   # (1) baseline
sim=50.00s  wall=22.74s  RT=2.199x   # (2) rate_limit off only
sim=50.00s  wall=59.99s  RT=0.834x   # (3) dlss only
sim=50.00s  wall=17.17s  RT=2.912x   # (4) both

結果

  • rateLimitEnabled=false の効果が非常に大きく、単独で約 2.7 倍高速化
  • DLSS 単独の効果は限定的
    • rate limit 解除時には追加の高速化効果が得られた
  • 両方併用時に最大 3.6 倍改善
# 構成 --kit_args の内容 wall time step time (中央値) ※ RT factor baseline 比
1 Baseline (Kit defaults) (なし) 62.44s ~40ms 0.801x 1.00×
2 rate_limit のみ off --/app/runLoops/main/rateLimitEnabled=false 22.74s ~15ms 2.199x 2.74×
3 DLSS Performance のみ --/rtx/post/dlss/execMode=0 59.99s ~40ms 0.834x 1.04× (≈ noise)
4 rate_limit off + DLSS Performance --/app/runLoops/main/rateLimitEnabled=false --/rtx/post/dlss/execMode=0 17.17s ~12ms 2.912x 3.64×

※step timeとは

  • simulation step の wall-clock time
  • env.step() の中央値

注意点

app.runLoops.main.rateLimitEnabled=false を有効化すると、GUI の更新レート制限が解除されるため GPU 使用率が高くなる。

また、動画キャプチャや画面共有時には描画負荷が増える可能性があるため、用途によってはデフォルト設定のほうが安定する場合もある。

まとめ

NVIDIA Isaac LabのGUIレンダリングの高速化方法について紹介した。Isaac Lab 2.3 の GUI モードでは、
Kit のフレームレート制限によってシミュレーション速度が制限され、RT factor が x1.0 を下回る場合がある。
本記事の設定をすることで、GUIレンダリング有効時でもシミュレーション性能の低下を抑えられるので参考にしてほしい。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?