Repository navigation
fix(export): force vis=False so export runs headless - #156
Merged
Merged
Conversation
`genelab export <trainable-task>` builds the play env via
`resolve_env_cfg(task_id, play=True)`, and trainable tasks set
`simulation.vis=play` so their play_env opens the viewer. Export only probes
obs shapes — it never renders — so on a display-less CI / server building that
env raised `GenesisException: No display detected`, with no CLI override to
disable it.
Force `env_cfg.simulation.vis = False` right after resolving, mirroring what
`eval_task` already does ("eval is always headless"). The `episode_length_s`
clamp eval applies is not needed here: export collects no episodes.
Add a regression test that drives the real `export_task` with env build
monkeypatched out (no Genesis runtime) and asserts the cfg handed to
`build_env` has the viewer off and the .ts + .metadata.json are produced.
This was referenced May 24, 2026
KraHsu
added a commit
that referenced
this pull request
Jun 5, 2026
fix(export): force vis=False so export runs headless
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
genelab export <trainable-task> <ckpt> -f torchscript|onnxcrashes on anydisplay-less machine (CI / remote server) with:
and there's no CLI override to disable the viewer (
No such option: --env.simulation.vis).Root cause
export_task(src/genelab/cli/_export.py) resolves the play env viaresolve_env_cfg(task_id, play=True). Trainable tasks setsimulation.vis=play(e.g.
examples/inverted_pendulum/.../env_cfg.py), so the play env has theviewer on.
interactive_scene.py:198wiresshow_viewer=self._sim_cfg.vis, sobuilding that env on a machine with no display raises. Export only probes obs
shapes — it never renders — so it must force the viewer off, exactly as
eval_taskalready does (eval_task.py:74, "eval is always headless").Fix
Set
env_cfg.simulation.vis = Falseright after resolving the env cfg inexport_task. Theepisode_length_s > 30clampeval_taskapplies is notneeded here — export collects no episodes (verified).
Test
Adds
tests/test_export.py::test_export_task_forces_headless_vis: drives thereal
export_taskwith env resolution/build monkeypatched out (no Genesisruntime, no display), starting from a fake play env cfg with
vis=True, andasserts (a) the cfg handed to
build_envhasvis is Falseand (b) the realexporter produces the
.ts+.metadata.json.tests/test_export.py— 7 passed; ruff clean + formatted.Reference audit
find_referencing_symbols(export_task)→ only caller issrc/genelab/cli/__init__.py::export_cmd(line 394/397). The change adds a lineinside the function body; no symbol renamed/removed, no caller affected.
Verification gap (please confirm on H100/H200)
This change targets the exact
vis -> show_viewerknob and mirrors the proveneval_taskapproach. I could not fully reproduce the original crash on thedev box because it has
libEGL+ offscreen Qt (env build succeeds even withvis=True). A realgenelab exportrun got past env build headless, thenfailed on an unrelated
rsl_rl did not expose an actor module(the localinverted-pendulum checkpoints look like smoke artifacts) — so no green
.tswasproduced end-to-end locally. Please run, with a good checkpoint:
🤖 Generated with Claude Code