Skip to content

Script-default visualizers incorrectly flagged as explicit, causing crash with --headless and HEADLESS=1 #7403

Closed

Description

@ChaitanyaParate

Describe the bug

When a task script registers a default visualizer via parser.set_defaults(visualizer=["kit"]),
two related bugs in AppLauncher cause a RuntimeError in headless mode:

Bug 1 — _resolve_visualizer_settings promotes defaults to explicit intent

_cli_visualizer_explicit is set to True even when the user never typed --viz or
--visualizer on the command line. The value came from set_defaults(), not from the user.
This means SimulationContext._resolve_visualizer_cfgs sees an "explicitly requested"
visualizer and raises:

RuntimeError: Explicitly requested visualizer(s) ['kit'] could not be configured.

Bug 2 — Neither --headless nor HEADLESS=1 clear launcher_args["visualizer"]

_resolve_headless_settings set _cli_visualizer_disable_all = True for the --headless
path but never cleared launcher_args["visualizer"], leaving ["kit"] in the args.
The HEADLESS=1 env-var path had no clearing logic at all.

Steps to reproduce

Both of the following crash on any task that calls parser.set_defaults(visualizer=["kit"]):

HEADLESS=1 python scripts/environments/zero_agent.py --task=<task> --num_envs=1

python scripts/environments/zero_agent.py --task=<task> --num_envs=1 --headless

Expected behavior

Both headless invocation styles should suppress visualizers cleanly and start without error.

I have a fix ready — will link PR once this issue is open.

Activity

  1. AntoineRichard commented on Sep 2, 2026

    @AntoineRichard
    Collaborator

    I couldn't reproduce either of the commands here. --headless was removed from the CLI in 3.0 and is rejected by the parser, and HEADLESS=1 python scripts/environments/zero_agent.py --task Isaac-Cartpole --num_envs 1 runs cleanly on develop with the Kit visualizer active — that script does use set_defaults(visualizer=["kit"]), so it should be the case you're describing.

    The RuntimeError you saw only fires when isaaclab_visualizers.kit can't be imported, which shouldn't happen on a normal install. Can you share the full traceback and uv pip list | grep isaaclab? Details in #7444.

  2. added
    question
    on Sep 2, 2026
  3. ChaitanyaParate commented on Sep 3, 2026

    @ChaitanyaParate
    ContributorAuthor

    After further investigation (and thanks to @AntoineRichard for the review), the bug described here is actually an environment configuration issue masquerading as a config error.

    If the isaaclab_visualizers extension fails to load (e.g., due to a broken workspace environment), _create_default_visualizer_configs cannot import the Kit visualizer. This causes AppLauncher to fall back to a code path that incorrectly raises RuntimeError: Explicitly requested visualizer(s) ['kit'] could not be configured.

    When run on a clean, healthy install of develop, HEADLESS=1 uv run python scripts/environments/zero_agent.py --task Isaac-Cartpole --num_envs 1 executes cleanly in headless mode with the Kit visualizer properly initialized.

    The actual fix here should be to improve the upstream error message so that it distinguishes between "you asked for an invalid visualizer string" versus "the visualizer extension failed to load, check your installation".

    I am leaving this issue open to track improving that error message, but closing the associated PR #7444 since its logic changes were a regression.

  4. matthewtrepte commented on Sep 22, 2026

    @matthewtrepte
    Collaborator

    Thanks @ChaitanyaParate

    Pushed a change to address the false positive newton alias error msg.

    The runtime error from the broken / missing package can be avoided with a healthy installation / adding the right --extra package

  5. StafaH commented on Sep 23, 2026

    @StafaH
    Collaborator

    Fixed by #7960

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

Metadata

Metadata

Assignees

Labels

question

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions