Skip to content

fix(cloudxr): add opt-in to avoid autoTSSkey mapping abort#579

Draft
nv-mhaselton wants to merge 3 commits into
mainfrom
mhaselton/streamsdk-v4l2
Draft

fix(cloudxr): add opt-in to avoid autoTSSkey mapping abort#579
nv-mhaselton wants to merge 3 commits into
mainfrom
mhaselton/streamsdk-v4l2

Conversation

@nv-mhaselton

Copy link
Copy Markdown
Contributor

Add NV_CXR_RUNTIME_JOIN_MAIN_THREAD to join the runtime on the main thread instead of a worker thread, avoiding a "Couldn't create autoTSSkey mapping" abort seen on some platforms. Default keeps the original worker-thread behavior.

Add NV_CXR_RUNTIME_JOIN_MAIN_THREAD to join the runtime on the main thread
instead of a worker thread, avoiding a "Couldn't create autoTSSkey mapping"
abort seen on some platforms. Default keeps the original worker-thread behavior.
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d21ad1be-45b5-4422-88a9-b8b2f7027391

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mhaselton/streamsdk-v4l2

Comment @coderabbitai help to get the list of available commands and usage tips.

# and can run the signal handler. Otherwise Ctrl+C is not processed while we're
# inside the native nv_cxr_service_join() call.
def join_then_destroy() -> None:
join_on_main = os.environ.get("NV_CXR_RUNTIME_JOIN_MAIN_THREAD", "").strip().lower()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the feature flag here? It will add burdens for users (then our support on educating users) to set the flag accordingly.

Can handle this automatically based on whether we are capable of "Couldn't create autoTSSkey mapping"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, this is a draft branch, and the feature flag should not exist to begin with

The runtime is spawned with start_new_session=True, so it isn't killed
with the embedding process, and Python does not run atexit handlers on
signal-driven termination. A signalled shutdown (e.g. pkill of the
embedding streamer) therefore orphaned the runtime, which kept holding
the streaming port and made the next start fail with
ERROR_STREAMSDK_PORT_UNAVAILABLE.

Install SIGTERM/SIGINT handlers in CloudXRLauncher that run stop() (which
already killpg's the runtime's process group) and then chain to the
previously installed handler so embedding apps keep their own shutdown
behavior. No-op off the main thread, where signal handlers can't be set.
Add a --mode {window,xr} flag to camera_viz.py that overrides
display.mode from the YAML, and forward extra args through
camera_viz.sh run, so one config drives both a local window and a
headless XR (CloudXR) run without editing the file.

Fix two `set -o pipefail` bugs in _install_deps.sh that blocked setup:
- the Jetson cuda-nvrtc probe used `find /usr ... | grep -q`, whose
  pipeline fails when find hits an unreadable /usr subdir, falsely
  flagging cuda-nvrtc as missing even when libnvrtc is present;
- the isaacteleop dist-info probe `ls ... | head -1` aborted the first
  full install on a fresh venv (glob matches nothing) before it ran.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants