ovRTX Clash Sample App#
The ovRTX clash sample app is the developer viewer of standalone ovclash. It renders a
USD stage with ovRTX, NVIDIA’s RTX
rendering runtime, outside Kit, runs queries through the
ovclash Suite and lists their results. It lives in
samples/ovrtx_clash_sample_app/.
This page is for maintainers. It covers what the app shows, why it does not ship, how to launch,
validate and debug it, where its version pins live, and the implementation rules of its scene
backends. The Architecture glossary defines the implementation terms.
The sample README, samples/ovrtx_clash_sample_app/README.md, covers the prerequisites (its
“Prerequisites” section), the viewer environment (“Viewer environment”), the app’s command line
(“App command line”), one-shot runs (“One-shot runs”), the user interface (“Using the viewer”),
how a query runs (“Clash queries”), the viewer’s environment variables (“Environment variables”)
and a map of the code (“How the code works”).
What it demonstrates#
The app runs the non-Kit clash path on one of two scene backends:
ovstage(the default) opens one Stage and inspects and edits it through public stock ovstage APIs. It lends that Stage toovclash_suite.ClashDetectionand to ovRTX. Queries therefore see unsaved edits, and the source file is never opened again. Viewer code imports no Python OpenUSD on this path.openusdis the parity reference. It uses Python OpenUSD (usd-core) for inspection and edits, and the clash runtime opens the stage from its file.
On both backends, a query saves its results in the working clash
store. Detection does not change the stage or the rendered
scene. A one-shot run also exports a viewer session layer. The
interactive viewer is a docked ovui (omni.ui) workspace. Its ovRTX
render target follows the size of the viewport panel.
With point clouds enabled, the viewer narrows search set A to the
Points prims at or under it. This is a viewer convention; the Suite runtime does not apply it. See
Point clouds in search set A.
Packaging#
The app is a developer tool, not part of the product. Packaging keeps it out of both artifacts:
Artifact |
Rule |
Result |
|---|---|---|
SDK install tree |
|
|
Python wheel |
|
The app is not in the list. |
The shipped changelog drops entries whose first line mentions ovRTX.
Launching it#
Run these commands from the ovclash directory. The two backends are independent: each
has its own install tree and its own viewer venv. Before you begin, build and install the backend
with build_<backend> --release --install, and check the prerequisites in the “Prerequisites”
section of the sample README. Setup needs access to the public package indexes, unless you name
local wheels as the “Environment variables” section of the sample README describes.
Goal |
Linux |
Windows |
|---|---|---|
Interactive viewer, ovstage backend |
|
|
Interactive viewer, OpenUSD backend |
|
|
One-shot run, ovstage backend |
|
|
Prepare or refresh a viewer venv |
|
|
Prepare the ovstage venv through the build wrapper |
– |
|
Setup notes:
Pass
--backend openusdto setup for the OpenUSD venv.build.bat --setup-ovrtx-viewerrunssetup_ovrtx_viewer.batwith its defaultovstagebackend and builds nothing. It forwards--build-local-ovui, which installs an editable local ovui checkout, and--build-local-ovstage, which skips the ovstage wheel for a local ovstage build. On Linux, pass these options tosetup_ovrtx_viewer.shdirectly.In a Windows build tree, the
setup_ovrtx_viewerCMake target prepares the venv for that tree’s backend.
The launchers do not build the backend. Each checks the library that OVCLASH_LIB names,
by default _build/install/<backend>/bin/ovclash.dll on Windows or
_build/install/<backend>/lib/libovclash.so on Linux. When it is missing, the launcher
exits and names the command to run, for example
ovstage ovclash native library not found: <path> followed by
Run: ./build_ovstage.sh --release --install. Only the viewer venv is created automatically.
What a successful start looks like:
Setup ends with
ovRTX viewer environment ready: <venv python>and exits with 0. A failed setup printserror: <reason>and exits with 1; a failed package download or install ends with pip’s own error. To set up without the indexes, name local wheels withOVRTX_WHEEL_PATH,OVSTAGE_WHEEL_PATHorOVCLASH_PIP_OVERRIDE_DIRand run setup again;--dry-runprints the commands first.An interactive launcher prints
Launching ovclash ovRTX viewer:and the app command line, and the viewer window opens.A one-shot run prints its JSON summary on stdout and exits with 0. Its fields are listed under Validation.
The default ovui==0.2.0 wheels require CPython 3.12. The wrappers prefer the
Packman CPython 3.12 under _build/deps/target-deps/python, which a
build bootstraps. Without it, they fall back to py -3 or python on Windows and to python3 or
python on Linux. When that interpreter is CPython 3.12, setup uses it. When it is another
version, setup stops with
error: The default ovui==0.2.0 wheels require CPython 3.12; found <implementation>:<version>.
and further hints: build once so that the Packman interpreter exists, or run setup with CPython
3.12 directly, adding --force-recreate to replace an existing venv. Core ovclash still supports
Python 3.10 or newer.
The sample directory also has run_ovrtx_clash_sample_app.bat and
run_ovrtx_clash_sample_app.sh. They differ from the backend launchers:
They run
launch_ovrtx_viewer.pywithOVCLASH_LIBset to the_build/install/openusdlibrary unless it is already set.They leave the launcher’s
--backendatovstage. Pass--backend openusdto them, because the app rejects a backend that differs from the loaded library.They do not set
OVCLASH_DISABLE_BUNDLED_PLUGIN_PATHS. On Windows, they add no native directories toPATHorOVCLASH_DLL_DIRS.
What the launchers and setup do#
The launch_rtx_viewer_* wrappers:
set
OVCLASH_VIEWER_BACKENDto their backend;set
OVCLASH_LIBto the backend’s install tree unless it is already set;on Windows, put the install tree’s native directories on
PATHandOVCLASH_DLL_DIRS. On Linux, only the ovstage wrapper sets a search path,LD_LIBRARY_PATH;put
python/andsamples/onPYTHONPATH, so the viewer uses the checkout’s Python packages with the installed native library and needs no wheel;set
OVCLASH_DISABLE_BUNDLED_PLUGIN_PATHS=1unless it is already set;run
launch_ovrtx_viewer.py --backend <backend>, preferring the Packman interpreter.
The ovstage wrappers also set OVCLASH_OVSTAGE_ROOT to an ovstage checkout beside the repository
root unless it is already set. When that checkout’s _build directory holds a built ovstage
runtime, they add it to the library search path. build_ovstage.* builds against the ovstage SDK
staged under _build/deps/pip-deps/ unless local ovstage mode is on.
Set OVCLASH_OVSTAGE_ROOT explicitly when a sibling ovstage checkout must not be picked up.
The variables that the wrappers set; a value you set first wins, except for
OVCLASH_VIEWER_BACKEND:
Variable |
Values |
Required |
Default |
Effect |
|---|---|---|---|---|
|
|
No |
The wrapper’s backend |
Selects the scene backend. The launcher’s |
|
Absolute path of the native library |
No |
The backend’s install tree |
The library that the launcher checks and the app loads |
|
A directory |
No |
ovstage wrappers: an |
A built runtime under its |
|
A flag |
No |
|
The ovclash loader adds no OpenUSD plugin paths; |
setup_ovrtx_viewer.py installs, in one pip command, the backend’s requirements file, the
pinned ovRTX wheel, the stock ovstage wheel and ovui into the venv:
Only
requirements_openusd.txtaddsusd-core.Every default source is a public package index, and no credential is involved. The ovRTX wheel comes from NVIDIA’s public package index, the one the PyPI
ovrtxrelease installs from, and ovstage (ovstage==<OVSTAGE_VERSION>) andovuifrom pip’s configured index.When setup downloads the pinned ovRTX wheel, pip installs it only when its SHA-256 matches the pin in
OVRTX_WHEEL_SHA256. A wheel fromOVRTX_WHEEL_PATHor an override directory is installed as it is.After an ovstage build, setup installs the ovstage wheel that the build downloaded and verified against
OVSTAGE_SHA256SUMS, from_build/deps/downloads/ovstage, so it needs no index for ovstage. A cached file that no longer matches its pin is not used.For the ovstage backend, setup checks the required public ovstage APIs after it installs. The launcher checks them again before it starts the UI, also with
--skip-setup.
Setup reads these overrides from the environment (setup_ovrtx_viewer.py). For ovstage the first
match wins: OVSTAGE_WHEEL_PATH, a wheel in an override directory, OVSTAGE_PIP_REQUIREMENT, the
build’s verified cached wheel, then ovstage==<OVSTAGE_VERSION>.
Variable |
Values |
Required |
Default |
Effect |
|---|---|---|---|---|
|
The path of an ovRTX wheel file |
No |
Unset: the pinned wheel, with its digest enforced |
Installs that wheel as it is. A path that does not exist stops setup. |
|
The path of an ovstage wheel file |
No |
Unset |
Installs that wheel. A path that does not exist stops setup. |
|
A directory |
No |
Unset |
Searched for the pinned ovRTX and ovstage wheel file names when the matching |
|
A pip requirement |
No |
Unset |
Installs ovstage from that requirement when no local ovstage wheel is found |
|
An ovstage version |
No |
The |
The ovstage version that setup looks for and installs |
|
A pip requirement or a wheel path |
No |
|
Replaces the ovui requirement, and skips the CPython 3.12 check |
The app itself reads OVRTX_PYTHON_PATH, a directory to import ovrtx from, such as a local
ovRTX checkout’s public/python. It retries from there when importing the installed ovrtx or
checking its API fails; the app’s --ovrtx-python-path option takes precedence.
Run either script with --help for its options.
Building ovui from a local checkout#
--build-local-ovui installs an editable local ovui checkout. Setup looks for it in this
order:
the directory that
OVUI_SOURCE_ROOT,OVUI_ROOTorOVUI_REPO_ROOTnames, or itsovuisubdirectory;the checkout whose
pythondirectoryOVUI_PYTHON_PATHnames;an
ovuidirectory in the project directory or one of its parents.
On Windows the build needs the Vulkan headers and loader. Setup uses the first complete source in this order:
Vulkan_INCLUDE_DIRwithVulkan_LIBRARY.VULKAN_SDK, or the newest SDK underOVUI_VULKAN_SDK_PARENTor<system drive>/VulkanSDK.An existing vcpkg install for
OVUI_VULKAN_TRIPLET(defaultx64-windows).vcpkg installofvulkan-headersandvulkan-loader, with the vcpkg fromVCPKG_INSTALLATION_ROOT,VCPKG_ROOT,OVUI_VCPKG_ROOTorPATH. When no vcpkg exists andgitis available, setup first clones and bootstraps vcpkg intoOVUI_VCPKG_ROOT(default_build/deps/vcpkg).
Setup reads these variables from the environment:
Variable |
Values |
Required |
Default |
Effect |
|---|---|---|---|---|
|
An ovui checkout, or a directory with an |
No |
Unset |
The checkouts that setup tries first, in this order |
|
The |
No |
Unset |
Names the checkout through its |
|
The Vulkan include directory and loader library |
No; Windows only, both together |
Unset |
The first Vulkan source |
|
A Vulkan SDK directory |
No; Windows only |
Unset |
The second Vulkan source |
|
A directory that holds Vulkan SDK versions |
No; Windows only |
Unset; |
Its newest complete SDK is the second source when |
|
A vcpkg triplet |
No; Windows only |
|
The triplet of the vcpkg install |
|
A vcpkg root directory |
No; Windows only |
Unset: vcpkg on |
The vcpkg that installs the headers and loader, tried in this order. Setup clones and bootstraps vcpkg into |
When a source is missing or fails, setup prints error: with a message that names the fix, and
exits with 1:
No local ovui checkout, with a message that contains
but no local ovui source checkout was found.: setOVUI_SOURCE_ROOT.No Vulkan source and no
git, with a message that containsVulkan SDK and vcpkg were not found, and git is not on PATH to bootstrap a local vcpkg checkout.: install the LunarG Vulkan SDK or vcpkg, or setOVUI_VCPKG_ROOT.A failed
vcpkg install, with a message that containsvcpkg failed while installing ovui's Vulkan build prerequisites.: run the vcpkg command that the message names by hand, or setVULKAN_SDK, orVulkan_INCLUDE_DIRwithVulkan_LIBRARY.
The Python launcher#
launch_ovrtx_viewer.py:
creates the venv, or reruns setup when the venv lacks a required package,
omni.uior, for ovstage, the required public ovstage APIs, or when an installed ovRTX, ovstage or ovui has another version than setup installs, as after a pin update. It stops when setup leaves such a version in place.stale_viewer_packages()insetup_ovrtx_viewer.pycompares the versions; the import checks alone pass with any version;prepares the process environment for ovui, the ovRTX binaries, the OpenUSD plugins and the shader caches;
starts
samples/ovrtx_clash_sample_app/ovrtx_clash_sample_app.pywith the venv Python in the output directory and forwards the arguments after--to it.
The launcher exposes ovRTX’s core OpenUSD plugins only through OV_PXR_PLUGINPATH_2511. It
keeps them and the _build/install/<backend>/plugins/usd trees out of
PXR_PLUGINPATH_NAME, because mixing the two plugin registries can crash Python
usd-core.
Its options:
Option |
Meaning |
|---|---|
|
Scene backend, default |
|
Viewer venv, default |
|
Working directory of the app, for viewer state and the ovRTX cache. Default |
|
Initial interactive render size and window size hint, default |
|
Rerun setup before launching. An existing venv is updated, not recreated. |
|
Do not create or update the venv unless |
|
Run the app in the launcher’s Python process. |
|
Keep the console open after an in-process error, so the traceback stays readable. |
Version pins#
Pin |
Source of truth |
Override |
|---|---|---|
ovRTX wheel |
|
|
ovstage wheel |
the |
the |
ovui |
|
|
Python OpenUSD (OpenUSD viewer and smoke only) |
|
– |
Default pins name official releases, and setup installs them from public package indexes only. Pin an ovRTX or ovstage version only once it is published there: a public source tree must set up with its default pins.
The ovRTX version and its wheel digests are written in several files. Change all of them
together, and take each digest from that wheel’s #sha256= link on the ovrtx page of
OVRTX_PACKAGE_INDEX, NVIDIA’s public package index:
OVRTX_VERSIONand theOVRTX_WHEEL_SHA256table insetup_ovrtx_viewer.py;OVRTX_VERSIONand theOVRTX_WHEEL_URLSandOVRTX_WHEEL_SHA256tables insamples/ovrtx_clash_sample_app/config.py;_OVRTX_VERSIONand the three_OVRTX_WHEEL_SHA256values inscripts/test_ovrtx_sample.cmake;the expected version in
test_viewer_release_pins_agree_across_setup_sample_and_cmake(tests/python_tests/test_ovrtx_viewer_scripts.py), which fails when the code copies disagree;the ovRTX row of the dependency table in the “Viewer environment” section of the sample README.
CI does not render (see Validation), so run the render smoke on a GPU
machine after an ovRTX bump, for example with --one-shot --render-smoke --require-ovrtx after
-- on a backend launcher. With --require-ovrtx, a render failure fails the run with its
error; with --render-smoke alone, the run prints ovrtx render smoke skipped: <reason> and
reports the reason as render_skipped in its JSON summary. Run it as a normal desktop process,
as the “Rendering” section of the sample README advises.
The usd-core version is also written in several files. Change them together:
usd-coreinsamples/ovrtx_clash_sample_app/requirements_openusd.txt;the
viewer-openusdextra inpython/pyproject.toml;_PYTHON_USD_CORE_VERSIONinscripts/test_ovrtx_sample.cmake;the expected version in
test_only_openusd_requirements_install_python_usd(tests/python_tests/test_ovrtx_backend_environments.py), which checks onlyrequirements_openusd.txt;the requirements row of the dependency table in the “Viewer environment” section of the sample README;
the
viewer-openusdrow of Compatibility (docs/consumer/compatibility.md).
The OVSTAGE_VERSION file is the ovstage pin of the whole project. The backend builds,
the wheel and the viewer setup all read it. After you change it, run
python scripts/sync_ovstage_version.py --write:
It rewrites the
ovstage==pin inpython/pyproject.tomland the documented default, theDefaults tosentence, inREADME.mdand in the “Environment variables” section of the sample README.It fails unless each file holds exactly one such pin or sentence.
An ovstage wheel build runs it with
--checkand stops when a file is stale.
Validation#
The test_ovrtx_sample CMake target validates the app; scripts/test_ovrtx_sample.cmake
implements it. It runs against the installed native library of the build tree’s backend.
It installs its Python dependencies into a separate venv,
_build/deps/venv/ovrtx_sample_<backend>. It:
runs the canonical Warp buffer-view unittest,
test_runtime.ClashRuntimeTests.test_report_buffers_can_be_viewed_as_warp_arrays, once Warp has started in a separate probe process;runs the one-shot smoke on
tests/data/mesh_mesh_overlapping.usda;checks that the exported
viewer_session.usdacomposes that source scene.
Details:
For the ovstage backend, it installs the stock ovstage wheel through
setup_ovrtx_viewer.py, which checks the required public APIs.Warp is a native third-party runtime, and on some hosts starting it ends the process natively, without a Python traceback.
scripts/run_with_warp_runtime_probe.pytherefore first runsimport warp,warp.init()and zero-copy CPU Warp arrays over NumPy buffers in a process that loads no ovclash code, and prints each step before it takes it:When that process ends natively before its last step, the step fails by default. On Windows that is an NTSTATUS error code such as 0xC0000409, or exit code 3; elsewhere a signal.
Only when
OVCLASH_ALLOW_WARP_STARTUP_SKIPis true does the step skip the Warp unittest instead, with a CMake warning, and still run the one-shot smoke. It is read from-Don a directcmake -Prun, which wins, or from the environment, the form a--validaterun passes on. Set it only on a host where Warp is known not to start.A Python error, a hang or an early exit of the probe, and a native end after its last step, such as a crash at interpreter exit, fail the step with or without the switch.
A host without a usable CUDA driver normally passes the probe, because Warp falls back to its CPU device.
The Warp unittest and the one-shot smoke run with
PYTHONFAULTHANDLER=1, so a crash that Python still sees prints its Python stack.On Linux aarch64 the OpenUSD backend’s smoke skips with a message:
usd-corehas no wheel for that platform.The smoke’s stdout, including the JSON result, goes to
ovrtx_clash_sample_app_smoke/one-shot.login the build tree’s validation directory,_build/validation/<backend>/<generator>/<configuration>/.<generator>isvsorninja. A build directory outside_build/compilegets anexternal-<id>namespace instead.validate_allincludes the target.
By default the smoke does not render. It covers detection, result persistence and session-layer export, and installs no ovRTX:
Set
OVCLASH_TEST_OVRTXto add the render smoke, which needs a GPU and Vulkan. A true CMake variable enables it, and so does any non-empty environment value,OFFincluded.CI leaves it unset, so no CI job renders. A passing run without rendering does not prove ovRTX rendering; record the GPU coverage that you skipped.
Without rendering the step needs no GPU, but it installs its Python packages from the package indexes. To drop it from a
--validaterun, for example on a host without access to them, setOVCLASH_VALIDATE_EXCLUDE_TARGETS=test_ovrtx_sample.
With rendering enabled:
The smoke reuses an installed default ovRTX release only after
ovrtx_release_ready()insetup_ovrtx_viewer.pyverifies its pinned archive digest, files and API. Otherwise it installs the pinned URL with that digest enforced.It always reinstalls a wheel from
OVRTX_WHEEL_PATHor a pip override directory.A non-empty
OVRTX_PYTHON_PATHuses that ovRTX instead of installing one.On OpenUSD, the render runs in a child process limited by
OVCLASH_RENDER_SMOKE_TIMEOUT_SECONDS(default 120). Cold shader compilation can exceed that limit; the “One-shot runs” section of the sample README gives the value for a cold-cache run.On ovstage, the render runs in the owning process on the Stage that is already open. The renderer closes before its owner.
The smoke reads these variables:
Variable |
Values |
Required |
Default |
Effect |
|---|---|---|---|---|
|
A true CMake variable, or any non-empty environment value |
No |
Unset: no rendering |
Adds the render smoke |
|
Seconds |
No |
|
Limits the OpenUSD render child process |
|
A CMake boolean, from |
No |
False |
Skips the Warp unittest, with a warning, when Warp ends natively at startup |
A one-shot run saves its query and results in one_shot.ovclashdb, writes
viewer_session.usda and reports that path as session_layer in the JSON result on
stdout. Through a launcher, these files land in _build/viewer/<backend>/<configuration>
unless you pass --output-dir. The “One-shot runs” section of the sample README lists the
point-cloud and render variants. samples/ovrtx_clash_sample_app/main.py writes these fields, all
of them on every run:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
string |
Yes |
An absolute path |
The source stage |
|
integer |
Yes |
– |
The overlap count of the query |
|
string |
Yes |
A path in the output directory |
The exported |
|
string |
Yes |
– |
A one-line summary of the phase times |
|
array of objects |
Yes |
|
The duration and memory use of each phase |
|
array of objects |
Yes |
|
The finer timings |
|
string or |
Yes |
|
Why |
|
string or |
Yes |
The |
The Warp kernel cache that the run used |
The Python tests under tests/sample_app_tests/ run in the opt-in
test_python_sample_app target. CI appends it to the --validate run of every build job outside
a release; add it to a local run through OVCLASH_VALIDATE_EXTRA_TARGETS. Tests that need Python
pxr skip where it is unavailable.
tests/diagnostics/rtx_viewer_ovstage_isolation.py is an opt-in check of the real ovstage
integration. Run it in the prepared ovstage viewer venv, which has no usd-core:
It checks one source open, the shared Stage identity, queries over unsaved edits, saving to a new file, New Stage and that no Python OpenUSD module is imported.
--renderadds rendering on the shared Stage, pixel checks of a live parent transform and its reversal before commit, a query while ovRTX stays attached, a resize and explicit resource closure. It needs the ovRTX wheel and a GPU. On a host without them, leave out--render. Run a GPU diagnostic as a normal desktop process: a restricted agent sandbox can render but block the renderer’s shutdown, as the “Rendering” section of the sample README notes.
The “Developer checks” section of the sample README gives the environment and the command. Each
run creates a new run directory under --output-dir, by default
_build/rtx_viewer_isolation_acceptance, and prints its path first.
Debugging the native library under the viewer#
On Windows, the rtx_viewer target (source/RtxViewerDebugEntrypoint.cpp) supports F5
debugging in the Visual Studio solution:
It embeds the packaged Python runtime and runs
launch_ovrtx_viewer.py --skip-setup --in-process --wait-on-errorin one process.It loads
ovclash.dllfrom the build output directory, next to its PDB (program database).Its output directory is the launchers’
_build/viewer/<backend>/<configuration>root for the selected configuration.
See Visual Studio solutions and F5 debugging in the Technical Guide.
On Linux there is no such target: rtx_viewer and setup_ovrtx_viewer are Windows-only
(CMake targets).
Scene ownership and modules#
On the default ovstage scene backend, one OvstageScene (scene/ovstage.py) owns the Stage:
It opens the source file once with the ovstage population API. It owns inspection and edits.
A query borrows that Stage through
ClashDetection.attach_ovstage(), unsaved edits included, and passes the composition of its query lease. Default selection reads the borrowed Stage. The clash runtime evaluates every finite time in private native populations of that composition and never evaluates or advances the Stage. Viewer code never reopens the file, and the binding never destroys the Stage.ovRTX attaches to the same Stage with
renderer.attach_ovstage(). The scene detaches the renderer before it destroys the Stage.
Viewer code on this path imports no Python OpenUSD. It composes typed USDA user and viewer overlays through public ovstage APIs. Using ovclash with an ovstage Stage gives the attach and owner-operation rules that any Stage owner follows.
These modules hold the rules of Viewer implementation rules. The
module map in the “How the code works” section of the sample README lists the other
viewer_parts/ modules, including the mixins that panels.py and properties.py compose.
Module |
What it owns |
|---|---|
|
|
|
|
|
|
|
|
|
Bounded read and write helpers for inspection and Default publication |
|
The ovRTX renderer wrapper: stepping, frame mapping and renderer ownership |
|
The main loop, including the wait for a running query |
|
Query start: scope resolution and the query lease |
|
The result table |
|
The Query Management settings pane, including the point-cloud label and the ROI (region of interest) rows |
|
Query execution on the borrowed Stage or in the isolated worker |
Point clouds in search set A#
When a query enables point clouds, the viewer narrows search set A to the Points prims at or under
its paths and leaves search set B untouched. The “Point-cloud queries” section of the sample README
describes what a user sees. The runtime does not do this: it always runs mesh vs mesh and adds point
vs mesh (Point clouds are additive), so
without the narrowing a search set A that also holds meshes would still produce mesh-vs-mesh
results. The Kit clash detection window applies the same convention.
How the viewer narrows the set:
On ovstage,
viewer_parts/clash_controller.pyselects the paths from the scene’s prim index (type_name == "Points") before it takes the query lease. WithSETTING_IGNORE_INVISIBLE_PRIMSon, the default, it skips invisible prims.On OpenUSD,
clash_flow.pyresolves the same set with Python OpenUSD.The Suite ABI and
omni.physxclashdetectioncorestay free ofpxr.
Consequences:
The label
Point Cloud(s) in Searchset Ain Query Management is a promise of this app, not of the runtime.A
UsdGeomPointsprim in search set B still clashes as a point cloud.On ovstage, a point cloud inside an instanced asset contributes no geometry. The viewer reports a warning on the progress line.
Point-cloud ROI fields#
Point Cloud Inclusion ROI and Point Cloud Exclusion ROI (roi_include_path,
roi_exclude_path) are stored with the query. Query duplication, export and import keep them. No
ovclash code applies them, because ovclash has no point-cloud extraction step; see
Settings.
Query Management always hides the exclusion row, as the Kit clash query window does.
The inclusion row stays visible, so that the stored value can be inspected and edited. Its tooltip says that the value is stored but not applied.
Viewer implementation rules#
Owner gate.
Every public
OvstageScenemethod exceptstage_info()and the revision properties enters the process-wide ovstage owner gate (run_ovstage_owner_operation) first, and the scene’s reentrant lock second. WithOVCLASH_VIEWER_OWNER_EVALUATION, native time evaluation already holds the gate when it calls back into the scene, so every path keeps this lock order.The native gate also serializes the lifecycle of file-backed ovstage contexts, of the private populations that replay a query composition, and of attached
evaluate_timecallbacks. Collision work and data-plane reads do not take it. The scene never holds the gate while it waits for a clash call.Renderer preparation, stepping and frame mapping run as one operation (
run_renderer_operation()), so a query lease cannot start between publication and mapping.CUDA frame mappings stay owned until their release. Detaching a renderer releases its outstanding frames first.
The renderer wrapper destroys only a renderer that it created.
Query leases.
A query takes an exclusive scene lease (
acquire_query_scene()) before its worker starts. While the lease is active, the scene rejects edits, inspection and rendering withRuntimeError. The viewer therefore holds editing, playback, render commits, reload and save until detection and persistence finish.The lease publishes Default once, with the viewer layer muted, and reports the composition of that publication as a
QueryComposition: the exact source string the Stage was opened from, which stays the original file after Save As, and the texts of the surviving"/"references (StockLayers.active_texts()), in the order they were added. It captures both under the scene lock, after the publication composed every deferred change, so they equal the population sealed at the lease ordinal. The scene is not published again until the lease closes, and closing restores the saved mutes and time.OVCLASH_VIEWER_OWNER_EVALUATIONis a sample-only diagnostic. It keeps the earlier owner-evaluated attachment, in which the clash runtime publishes every sample time on the scene throughevaluate_timewith the authored-transform capability, for A/B checks.While the worker runs, the main loop waits up to 16 ms for it after each native UI tick (
_CLASH_WORKER_YIELD_SECONDS). The native UI tick can hold the GIL through vsync. The wait gives the worker’s Python steps, and with owner evaluation its owner callbacks, time to run.
Publications. A publication is one write of the viewer’s composed scene into its Stage, sealed at a new ordinal; a Default publication writes the Default-time values.
Every publication takes a new ordinal, reserved before the native calls. A failed attempt therefore never reuses an ordinal. An unchanged frame reuses its publication.
A query lease reserves ordinal capacity, so that it can always restore the previous time and layer mutes.
A failed restoration, or a layer replacement that applied only in part, quarantines the scene. Edits, inspection and rendering then fail until the scene is closed and reopened.
A save folds the pending user edits into the baseline layer before it writes the composition wrapper. It writes the wrapper to a temporary sibling file and then replaces the target atomically. When the write fails, the previous references are restored.
When a save commits but the following publication fails,
SceneSavePublicationErrorkeeps the saved path and reports the failed step. A failed write of the clash data file beside the stage is reported separately, and the clash data stays marked unsaved.
Renderer refresh. After the first successful step of an attached renderer, ovRTX needs fresh viewer notices before it produces a frame. Unmuting the viewer layer, as a query lease or source inspection does, requires the same refresh. The wrapper records that step, publishes the viewer layer again and steps once more inside the same owner operation. It then exposes only the refreshed frame.
Camera and drag previews.
A camera-only update writes the camera matrix to the renderer and inspection columns through public ovstage attributes, at one new sealed ordinal. It does not repopulate USD. It does not rewrite the camera’s reset-stack flag, which the full publication already set, because that write would force extra synchronization with RTX.
A drag preview writes the local matrices, reset-stack flags and transform-op orders of every dragged prim in one publication. With an attached renderer, it computes the incremental GPU transform hierarchy before sealing that ordinal; the default CPU hierarchy alone leaves RTX geometry at its previous pose. It invalidates the cached composed transforms, so descendants, reset boundaries and bounds are recomputed.
On ovstage, mouse callbacks queue the latest pose. The main frame loop publishes it at most 30 times per second, immediately before rendering. This keeps native write and synchronization waits outside UI input dispatch. Release commits the final pose and clears any queued preview.
Prims that consume the dragged prims through references or inherits update at the next full composition: gesture commit, time change, query or save.
While a private viewer prim collides with a source path, previews use full composition instead, so that they cannot overwrite the stronger viewer opinions.
Default visibility. Default visibility values that the viewer wrote are restored before the next population. Population skips unchanged values, so coalesced resampling can leave flattened instance children with stale derived visibility. At that transition, and after source composition changes, the scene repairs the renderer visibility from the source hierarchy before it seals the publication.
Caches.
Stock inspection caches hierarchy and transform records only for the current publication.
Native attached reads keep the prototype associations of instance roots until the owner seals another ordinal or a source reset retires them. The associations are read lazily, once per ordinal.
With
OVCLASH_VIEWER_OWNER_EVALUATION, a numeric query on the borrowed Stage uses the poses that stock population published. For the lease, it keeps only the instance roots excluded from collision. It discards them when the instance links, renderer membership, prim count or retained change history no longer match. No sampled transform or geometry value is cached. When the owner’s time evaluation or the association read fails, the next request for the same time asks the owner for a new publication instead of reusing the old one.
Result table. Result rows keep their formatted strings. They create native
SimpleStringModel objects only when a cell model is accessed, so a large query does not allocate
every column model before its rows are shown.
Viewer population and inspection#
The ovstage scene backend populates one Stage, then runs Python inspection and the Default publication, and only then attaches the renderer. On a large stage each of these phases costs load time. Measure population, inspection, renderer attachment and the first frame as separate phases.
Regression tests in tests/sample_app_tests/ pin the rules of this section with call, copy and
allocation budgets, for example test_ovstage_path_lists.py, test_ovstage_path_strings.py,
test_ovstage_core_values.py, test_ovstage_publication_buffers.py and
test_ovstage_mesh_geometry_batches.py.
The scene creates its first Stage inside an owner operation, before it populates the source
file. When that operation returns, the gate finds the omni client that the new Stage loaded and
configures its process-wide retry policy, so that the policy applies to the file population.
OVCLASH_OMNI_CLIENT_RETRY_MAX_MS sets that policy and defaults to 0, which disables reconnect
retries. Without this order, the policy would not apply yet, and an unreachable
Nucleus payload would stall the first population for the runtime’s
own reconnect window. See the
environment variables.
Population descriptor#
population_desc() in scene/ovstage_inspection.py describes the RENDERING-domain population:
Two mutually exclusive selectors, one for non-light prims and one for
LightAPIprims, so every prim matches exactly one. A third, all-prim selector would repeat population work for every prim.Both selectors take
purposeonly when it is authored, so that a schema-fallback purpose cannot overwrite the inherited rendering purpose.Every selected property also publishes four metadata fields:
typeName,custom,allowedTokensanddefault. Prims publishtypeNameandinstanceable, and the stage publishes its metadata.
The description is an ovstage population.Desc, whose fields all have defaults in ovstage; the
viewer sets them as follows:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
|
No (ovstage default |
|
The RENDERING domain populates the renderer’s prims and columns |
|
sequence of |
No (ovstage default empty) |
Two selectors: prims without |
Each selects every property except the renderer-owned ones (the |
|
sequence of |
No (ovstage default empty) |
|
The prim metadata that each selector publishes |
|
sequence of |
No (ovstage default empty) |
|
The property metadata that each selector publishes |
|
sequence of |
No (ovstage default empty) |
|
The stage metadata that the population publishes |
Inspection, editing, the geometry fallback and saving rely on these fields. They make the viewer’s
population much more expensive than a clash-geometry population. Do not narrow the descriptor to a
property whitelist: a value clip can supply builtins such as widths, velocities and
primvars:displayOpacity that have neither an authored declaration nor a Default opinion.
test_parent_value_clips_preserve_child_property_types_and_time_values in
tests/sample_app_tests/test_ovstage_stock_publication.py covers those three.
Reducing the metadata cost needs a narrower or on-demand metadata API in ovstage.
Inspection reads#
A selected-path read can share one prim list among many sparse property groups.
ReadPathLists(scene/ovstage_path_lists.py) copies each distinct list once into an owned, read-onlyuint64array. Paths are decoded only for the returned rows. The list work is therefore O(P + R) for P prims and R returned rows, not O(P * C) for C groups that share the list.The cache holds a native reference on every cached list handle, so a handle cannot be recycled while it is cached. It keeps at most 64 lists and 64 MiB per read; one larger list may be kept alone. It releases every reference before the read, the query and the dictionary close, also on failure.
Known columns on explicit paths are read through
query_from_path_list, without a scene-wide attribute-discovery query.scene/ovstage_path_strings.pydecodes paths in batches through the public dictionary API. Its path and token caches belong to one Stage, so native token decoding scales with the number of distinct tokens. Composing a path string still costs O(path components).The core read stores compact four-field records (
CoreValueinscene/ovstage_core_values.py) and reads unused core payloads as presence only. It still traverses the instance-expanded RENDERING-domain population, which can be much larger than the authored prim inventory.StockInspection._readreadsis_arrayandis_deleteonce per native group, because they are constant across the group’s rows, and decides array omission once per group.
Default publication#
Local poses and reset flags are written from contiguous owned buffers:
float64with shape (N, 4, 4) andboolwith shape (N). They do not go through public transform snapshots.scene/ovstage_geometry_batches.pywrites Default fallback mesh geometry in batches of meshes that share one field set, through the public ragged-array write API. One staging window holds at most 4,096 meshes and 128 MiB of write payload. A mesh larger than the byte budget is written alone. Avoid a query, a write and a wait per mesh.The first render after a renderer attaches needs one more full publication; see Renderer refresh in Viewer implementation rules.
replace_user_edits([])returns the current revision without publishing when no user opinions exist, the scene is clean and no source recomposition is pending. Its health checks run first. Clearing real edits, or publishing pending view changes, still advances the revision.
Where to read next#
Topic |
Document |
|---|---|
Prerequisites, viewer environment, app options, one-shot runs, user interface, how a query runs, environment variables and the module map |
The “Prerequisites”, “Viewer environment”, “App command line”, “One-shot runs”, “Using the viewer”, “Clash queries”, “Environment variables” and “How the code works” sections of the sample README, |
How the other samples are organized, packaged and tested |
|
Build entrypoints and backend trees |
Backends and trees in Local Development |
Backend roles |
|
Viewer selection and transform benchmark |
|