NVIDIA DeepStream SDK API Reference

9.2 Release
ModelMuxConfig Struct Reference

Detailed Description

Collaboration diagram for ModelMuxConfig:

Data Fields

guint batch_size
 max concurrent streams. More...
 
guint per_model_max_streams
 
gboolean unified_batch
 default cap for a model if unset
More...
 
gint process_mode
 one display batch (TRUE) vs per-role
More...
 
gboolean gie_ids_from_config
 1 = pgie, 2 = sgie; forwarded to every inference element this stage builds
More...
 
gboolean enable
 
gboolean shard_compact
 [multimodel] enable: 0 => bypass the inference bin (decode->display passthrough)
More...
 
gboolean compact_idle_models_across_pools
 auto-compact under-full shards of a model back into fewer shards when streams drain (default TRUE). More...
 
gboolean model_sharding
 dedup-on-idle policy (default TRUE). More...
 
guint mux_width
 auto-shard streams when per-model cap exceeded. More...
 
guint mux_height
 mux surface resolution, all muxers (default 1920) More...
 
gboolean mux_live_source
 mux surface resolution, all muxers (default 1080) More...
 
guint model_mux_push_timeout
 
guint combined_mux_push_timeout
 per-model mux flush us (default 10000 = 10ms)
More...
 
gboolean attach_perf_metric
 combined mux flush us (default 33333 ~= 30fps)
More...
 
guint perf_metric_interval_sec
 enable fps/latency measurement (default FALSE)
More...
 
gboolean copy_primary_buffer
 measurement window seconds (default 5, clamp >=1)
More...
 
gboolean copy_shadow_buffer
 copy on the PRIMARY lane (nvvideoconvert dp=1; def 0) More...
 
guint copy_buffer_pool_size
 copy on the SHADOW lane (nvvideoconvert dp=1; def 1) More...
 
gboolean lane_leaky
 copy-lane nvvideoconvert output-buffers (0 = element default). More...
 
guint gpu
 [multimodel] gpu-id: the PIPELINE device – where the decoders, the shared input demux and the combined display mux live (default 0). More...
 
gint placement_policy
 [multimodel] placement-policy (pack|spread): how unconstrained streams are placed across a multi-GPU instance group. More...
 
gboolean auto_gpu_scale
 [multimodel] auto-gpu-scale (default 0): ELASTIC multi-GPU scale-out without any per-model gpu configuration. More...
 
ModelCatalogEntry models [MM_MAX_MODELS]
 model registry: built from [MultiModelInference] default primary (+ optional shadow). More...
 
guint num_models
 
ModelVersionArtifact versions [MM_MAX_MODELS *4]
 PER-VERSION artifacts: optional engine/config overrides per (name, version), parsed from [model-<name>-<version>] blocks. More...
 
guint num_versions
 
GMutex versions_lock
 guards versions[] / num_versions – the ONLY ModelMuxConfig state mutable at RUNTIME: modelmux_config_register_version (model/load|update trigger) and modelmux_control_registry_unregister_version (OTA rollback) mutate on the main loop under api_control_lock, while GET model/status resolves placements on the CIVETWEB thread under ib->lock only. More...
 
gchar * default_primary
 
gchar * default_primary_version
 default primary model NAME (catalog ref) More...
 
gchar * default_shadow
 default primary model VERSION (e.g. More...
 
gchar * default_shadow_version
 default shadow model NAME (NULL=>none)
More...
 
gint default_primary_gpu
 default shadow model VERSION (NULL=>none)
More...
 
gint default_shadow_gpu
 requested instance placement of the runtime default (model/routing default{}.gpu); -1 = any instance. More...
 
StreamModelBinding bindings [MM_MAX_STREAMS_DEFAULT]
 config-time per-sensor model bindings ([stream-model-<sensor_id>] groups). More...
 
guint num_bindings
 

Field Documentation

◆ attach_perf_metric

gboolean ModelMuxConfig::attach_perf_metric

combined mux flush us (default 33333 ~= 30fps)

[multimodel] perf metrics: when attach_perf_metric is on, the plugin measures per-model (aggregate) and per-(stream,role) fps + inference latency and reports them additively in model/status. OFF (default) => zero overhead, model/status byte-identical to before.

Definition at line 341 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ auto_gpu_scale

gboolean ModelMuxConfig::auto_gpu_scale

[multimodel] auto-gpu-scale (default 0): ELASTIC multi-GPU scale-out without any per-model gpu configuration.

When every shard of a model is at capacity and a NEW shard must grow, pick the healthiest OTHER device instead of the model's own – but ONLY when that device is IDENTICAL to the model's (same compute capability + device name), so the existing TensorRT engine is legally reused (deserialize in seconds; a mismatched device would silently trigger a minutes-long rebuild). The overflow shard is UNPINNED: compaction migrates its streams back and reclaims it when load drops (scale-in). Heterogeneous boxes / single-GPU: behaves exactly as auto-gpu-scale=0.

Definition at line 388 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ batch_size

guint ModelMuxConfig::batch_size

max concurrent streams.

Definition at line 289 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ bindings

StreamModelBinding ModelMuxConfig::bindings

config-time per-sensor model bindings ([stream-model-<sensor_id>] groups).

Empty => every stream uses the defaults (fully backward-compatible).

Definition at line 428 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ combined_mux_push_timeout

guint ModelMuxConfig::combined_mux_push_timeout

per-model mux flush us (default 10000 = 10ms)

Definition at line 336 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ compact_idle_models_across_pools

gboolean ModelMuxConfig::compact_idle_models_across_pools

auto-compact under-full shards of a model back into fewer shards when streams drain (default TRUE).

Make-before-break, zero-drop. Set 0 to keep grown shards until they empty naturally.

Definition at line 309 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ copy_buffer_pool_size

guint ModelMuxConfig::copy_buffer_pool_size

copy on the SHADOW lane (nvvideoconvert dp=1; def 1)

Definition at line 352 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ copy_primary_buffer

gboolean ModelMuxConfig::copy_primary_buffer

measurement window seconds (default 5, clamp >=1)

[multimodel] buffer-copy-mode: which per-(stream,role) lane(s) DEEP-COPY the decoded frame via an nvvideoconvert (disable-passthrough=1) spliced BEFORE that lane's queue. A copy lane releases the upstream decoder buffer at fan-out, so a SLOW lane can no longer backpressure the decoder when per-model fps differ; the other (passthrough) role stays zero-copy (no element added). Config string none|primary|shadow|both -> these two derived flags. Default: shadow. "none" => byte-identical to before (no converter on any lane).

Definition at line 350 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ copy_shadow_buffer

gboolean ModelMuxConfig::copy_shadow_buffer

copy on the PRIMARY lane (nvvideoconvert dp=1; def 0)

Definition at line 351 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ default_primary

gchar * ModelMuxConfig::default_primary

◆ default_primary_gpu

gint ModelMuxConfig::default_primary_gpu

default shadow model VERSION (NULL=>none)

Definition at line 420 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ default_primary_version

gchar * ModelMuxConfig::default_primary_version

default primary model NAME (catalog ref)

Definition at line 417 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ default_shadow

gchar * ModelMuxConfig::default_shadow

default primary model VERSION (e.g.

1)

Definition at line 418 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ default_shadow_gpu

gint ModelMuxConfig::default_shadow_gpu

requested instance placement of the runtime default (model/routing default{}.gpu); -1 = any instance.

Applied to every stream that RESOLVES to the default (add/bind/sweep).

Definition at line 424 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ default_shadow_version

gchar * ModelMuxConfig::default_shadow_version

default shadow model NAME (NULL=>none)

Definition at line 419 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ enable

gboolean ModelMuxConfig::enable

◆ gie_ids_from_config

gboolean ModelMuxConfig::gie_ids_from_config

1 = pgie, 2 = sgie; forwarded to every inference element this stage builds

TRUE when every catalog model declares a DISTINCT gie-unique-id, so this stage adopts the configured ids (making operate-on-gie-id knowable from config, as with a plain nvinfer). FALSE when any two overlap – the stage then falls back to the historical monotonic allocator for ALL models, so ids stay unambiguous and an existing config keeps working unchanged. All-or-nothing on purpose: a mix of configured and allocated ids would be the least predictable outcome.

Definition at line 302 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ gpu

guint ModelMuxConfig::gpu

[multimodel] gpu-id: the PIPELINE device – where the decoders, the shared input demux and the combined display mux live (default 0).

A model bin ON this device carries NO migration elements (mux links straight to nvinfer); a bin pinned to ANOTHER device carries an nvdsxfer pair: xfer-in migrates the batched surfaces to the shard's device (nvinfer rejects cross-GPU input memory), xfer-out brings the batch back to THIS device so demux/display/OSD stay on the pipeline gpu. Cross-device placement requires CUDA peer access (NVLink/PCIe P2P) + the nvdsxfer factory; otherwise the placement is rejected at bin creation.

Definition at line 373 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ lane_leaky

gboolean ModelMuxConfig::lane_leaky

copy-lane nvvideoconvert output-buffers (0 = element default).

Size to the slow lane's depth to keep the copy from backpressuring the converter.
[multimodel] lane-leaky: leak policy of the per-(stream,role) in_q/out_q lane queues. TRUE (default, existing behaviour): leaky=downstream – a full lane drops its OLDEST buffer instead of blocking, so a stalled/slow model can never backpressure the shared tee + input demux and stall the OTHER streams (freshness over completeness; live sources keep moving when per-model fps mismatch). FALSE: non-leaky lanes guarantee COMPLETENESS (every frame reaches every routed model) but a slower A/B twin then backpressures the lane and can stall mismatched-fps siblings sharing the tee.

Definition at line 363 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ model_mux_push_timeout

guint ModelMuxConfig::model_mux_push_timeout

◆ model_sharding

gboolean ModelMuxConfig::model_sharding

dedup-on-idle policy (default TRUE).

When a model goes idle as a lone redundant warm copy (no twin), TRUE moves it out of its role pool (primary/shadow) into the shared limbo pool so a later request from EITHER role reuses that one warm copy without a reload – fewer warm copies overall. FALSE keeps it role-tagged in its pool. The configured default model is never moved. Redundant twins are freed either way.

Definition at line 318 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ models

ModelCatalogEntry ModelMuxConfig::models

model registry: built from [MultiModelInference] default primary (+ optional shadow).

No per-camera mapping – every stream uses the default models. MODEL CATALOG: model NAME -> base config (+ auto-detected backend type), parsed from the [model-name-<idx>] blocks. A catalog entry is metadata only – it is NOT instantiated until a role ref (default_primary/shadow) or the model/load API loads a concrete (name, version) instance from it. version/engine_file on a catalog entry are unset (per-instance, runtime).

Definition at line 397 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ mux_height

guint ModelMuxConfig::mux_height

mux surface resolution, all muxers (default 1920)

Definition at line 333 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ mux_live_source

gboolean ModelMuxConfig::mux_live_source

mux surface resolution, all muxers (default 1080)

1=live/RTSP, 0=file – a source property (def TRUE)

Definition at line 334 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ mux_width

guint ModelMuxConfig::mux_width

auto-shard streams when per-model cap exceeded.

TRUE (default): overflow streams get a new shard of the same model (scale-out, existing behaviour). FALSE: streams beyond the per-model batch cap are silently ignored – matching nvinfer behaviour when more streams than batch-size arrive.

Definition at line 332 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ num_bindings

guint ModelMuxConfig::num_bindings

◆ num_models

guint ModelMuxConfig::num_models

◆ num_versions

guint ModelMuxConfig::num_versions

◆ per_model_max_streams

guint ModelMuxConfig::per_model_max_streams

◆ perf_metric_interval_sec

guint ModelMuxConfig::perf_metric_interval_sec

enable fps/latency measurement (default FALSE)

Definition at line 342 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ placement_policy

gint ModelMuxConfig::placement_policy

[multimodel] placement-policy (pack|spread): how unconstrained streams are placed across a multi-GPU instance group.

See ModelPlacementPolicy.

Definition at line 377 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ process_mode

gint ModelMuxConfig::process_mode

one display batch (TRUE) vs per-role

Definition at line 294 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ shard_compact

gboolean ModelMuxConfig::shard_compact

[multimodel] enable: 0 => bypass the inference bin (decode->display passthrough)

Definition at line 305 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ unified_batch

gboolean ModelMuxConfig::unified_batch

default cap for a model if unset

Definition at line 293 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ versions

ModelVersionArtifact ModelMuxConfig::versions

PER-VERSION artifacts: optional engine/config overrides per (name, version), parsed from [model-<name>-<version>] blocks.

Consulted when a (name,version) is instantiated (default, per-sensor, or load). Absent => the model's base catalog config/engine is used.

Definition at line 402 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.

◆ versions_lock

GMutex ModelMuxConfig::versions_lock

guards versions[] / num_versions – the ONLY ModelMuxConfig state mutable at RUNTIME: modelmux_config_register_version (model/load|update trigger) and modelmux_control_registry_unregister_version (OTA rollback) mutate on the main loop under api_control_lock, while GET model/status resolves placements on the CIVETWEB thread under ib->lock only.

Readers may already hold api_control_lock and/or ib->lock, so the LOCK ORDER is (api_control_lock | ib->lock) -> versions_lock, and versions_lock NEVER wraps another lock: critical sections copy out what they need and release – never file I/O (modelmux_config_derive runs strictly after unlock). Initialised wherever the ModelMuxConfig is (re)zeroed (modelmux_config_parse / gst_modelmux_build defaults); cleared in modelmux_config_clear.

Definition at line 415 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_priv.h.


The documentation for this struct was generated from the following file: