|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
43 #ifndef __DEEPSTREAM_MULTIMODEL_APP_H__
44 #define __DEEPSTREAM_MULTIMODEL_APP_H__
49 #include "nvdsmeta_schema.h"
57 #define MM_MAX_STREAMS_DEFAULT 16
58 #define MM_MAX_BATCH 1024
59 #define MM_MAX_MODELS 32
60 #define MM_DEFAULT_REST_PORT 9000
61 #define MM_DEFAULT_REST_IP "0.0.0.0"
68 #define MM_MODEL_VERSION_DEFAULT "1"
69 #define MM_MODEL_KEY_SEP '@'
77 #define MM_PROCESS_MODE_PGIE 1
78 #define MM_PROCESS_MODE_SGIE 2
84 #define MM_SHADOW_GIE_OFFSET 100
86 #define MM_MUX_WIDTH 1920
87 #define MM_MUX_HEIGHT 1080
88 #define MM_MUX_PUSH_TIMEOUT 33333
112 #define MODELMUX_CONTEXT_TYPE_ROUTING "nvidia.deepstream.modelmux.routing"
114 #define MODELMUX_CONTEXT_FIELD_REV "revision"
121 #define MODELMUX_TYPE_REV_SHARED (modelmux_rev_shared_get_type ())
163 #define MM_BACKEND_AT_PGIE (1u << 0)
164 #define MM_BACKEND_AT_SGIE (1u << 1)
228 const gchar * config_file,
229 const gchar * group);
696 #define MM_GPU_ANY (-1)
822 #define MM_ACCT_MAX 256
823 #define MM_ROLE_PRIMARY 0
824 #define MM_ROLE_SHADOW 1
825 #define MM_ROLE_SLOTS 2
999 void (*ota_rollback_cb) (gpointer owner,
const gchar * from_key,
1000 const gchar * to_key);
1037 void model_key_split (
const gchar * key, gchar ** name_out, gchar ** version_out);
1060 const gchar * model_name,
const gchar *
version);
1066 const gchar *
version,
const gchar * engine,
1067 const gchar * config_file, gint gpu, guint batch);
1082 const gchar * name,
const gchar *
version);
1092 gboolean * derive_failed);
1113 const gchar * config_file,
1114 const gchar * engine_file,
1121 const gchar * config_file,
1122 const gchar * engine_file,
1131 const gchar * camera_id,
1132 const gchar ** primary,
const gchar ** shadow,
1133 const gchar ** primary_version,
1134 const gchar ** shadow_version,
1135 gboolean * primary_is_default,
1136 gboolean * shadow_is_default);
1140 const gchar * config_file,
const gchar * engine_file,
1141 const gchar *
version, guint unique_id, guint max_streams,
1143 GstElement * parent_pipeline, GstElement * container,
1144 const GHashTable * stream_names, guint inst);
1163 GstElement * parent_pipeline, GstElement * container,
1166 const gchar * model_name, gint gpu, GstPad * in_pad,
1167 guint branch_serial,
1168 GstElement ** in_q_out, GstElement ** out_q_out,
1169 GstElement ** conv_out, gboolean * cap_overflow,
1175 const gchar * cfg_override, guint batch);
1193 guint delay_seconds);
1214 const gchar * f_model,
const gchar * f_version);
1236 const gchar ** name,
const gchar **
version,
1237 const gchar ** backend, guint * gie, gint * gpu,
1238 guint * streams,
const gchar ** state,
1239 gboolean * serving, gchar ** engine);
1245 const gchar * from_version,
const gchar *
version,
1246 const gchar * config_file,
const gchar * engine_file,
1247 gint * http,
const gchar ** err_code,
1248 const gchar ** reason,
const gchar ** hint);
1254 const gchar *
version,
const gchar * config_file,
1255 const gchar * engine_file, gint * http,
1256 const gchar ** err_code,
const gchar ** reason,
1257 const gchar ** hint);
1265 const gchar *
version, gint * http,
1266 const gchar ** err_code,
const gchar ** reason,
1267 const gchar ** hint);
1273 const gchar *
version, gint * http,
1274 const gchar ** err_code,
const gchar ** reason,
1275 const gchar ** hint);
1289 guint x_offset, guint y_offset,
const gchar * text,
1290 const gchar * role);
1305 const gchar * name,
const gchar * cam_id,
1306 const gchar * primary,
const gchar * shadow,
1307 gint p_gpu, gint s_gpu,
1308 gboolean p_via_default, gboolean s_via_default);
1315 const gchar * primary,
const gchar * shadow,
1316 gint p_gpu, gint s_gpu,
1317 gboolean p_via_default, gboolean s_via_default);
1335 const gchar * cfg_override, gint gpu,
1347 const gchar *
const cfgs[],
1348 const gint gpus[], guint n,
1359 gint * out, guint cap);
1367 const gchar * key,
const gchar * cfg_override);
1376 const gchar * name,
const gchar *
version,
1389 const gchar * name,
const gchar * cam_id);
1411 const gchar * key, guint * out, guint cap,
1412 gboolean default_only);
1419 const gchar * config,
const gchar * engine,
1426 const gchar * name,
const gint gpus[],
1427 const gchar *
const engines[], guint n,
1440 gboolean shadow,
const gchar * name);
1446 gboolean shadow,
const gchar * name);
1455 const gchar * f_version,
const gchar * f_stream,
1484 GstPadProbeInfo * info,
1490 GstPadProbeInfo * info,
1496 const gchar * event,
const gchar * name,
const gchar *
version,
1497 gint gpu, gboolean ok,
const gchar * detail);
1505 guint * streams, gchar ** streams_csv);
1512 guint n,
const gchar * primary,
const gchar * shadow,
1513 gint p_gpu, gint s_gpu,
1514 gboolean p_via_default, gboolean s_via_default);
1520 const gchar * model,
const gchar * shadow, gint p_gpu, gint s_gpu,
1521 gboolean p_via_default, gboolean s_via_default);
1526 const gchar * model, gint gpu, gboolean via_default);
1536 const guint * src_ids, guint n, guint ** out);
1547 guint n,
const gchar * primary,
const gchar * shadow);
1568 const gchar * key,
const gint * gpus, guint n_gpus,
1569 gint * serving_gpu, guint * serving_streams, gchar ** serving_csv);
gboolean compact_idle_models_across_pools
auto-compact under-full shards of a model back into fewer shards when streams drain (default TRUE).
gboolean modelmux_config_apply_properties(GstElement *element, const gchar *config_file, const gchar *group)
Apply every key of @group in @config_file to @element as the property of the same name,...
guint next_uid
unique-id base for this role's models
GHashTable * idx_to_stream
available pad indices (GINT)
G_GNUC_INTERNAL gchar * get_infer_engine_str(ModelBin *model_bin)
gchar * modelmux_config_derive(const gchar *base_cfg, const gchar *engine, gint gpu, gint gie, const gchar *model_name, const gchar *version)
gboolean auto_gpu_scale
[multimodel] auto-gpu-scale (default 0): ELASTIC multi-GPU scale-out without any per-model gpu config...
guint modelmux_bin_num_streams(ModelMuxBin *ib)
void modelmux_bin_bump_routing_revision(ModelMuxBin *ib)
ModelMuxSgieBin * modelmux_sgie_new(GstElement *parent, const gchar *name, const ModelMuxConfig *config)
gboolean model_bin_has_capacity(ModelBin *model_bin)
GstPad * model_pool_attach(ModelPool *rb, guint stream_id, const gchar *model_name, gint gpu, GstPad *in_pad, guint branch_serial, GstElement **in_q_out, GstElement **out_q_out, GstElement **conv_out, gboolean *cap_overflow, ModelBin **attached_bin_out)
ModelPool: the live INVENTORY of one role's (Primary or Shadow) instantiated models,...
guint n
in-scope source ids; NULL/n==0 => ALL streams
GstPad * model_bin_attach(ModelBin *model_bin, guint stream_id)
void modelmux_config_clear(ModelMuxConfig *config)
GQueue * col_free_idx
recycled DISPLAY columns [0,max_streams)
gint out_idx
requested sink pad on combined display mux
A model definition from the [model-*] config groups.
GstElement * in_demux
ModelMuxBin batched sink (entry)
const G_GNUC_INTERNAL gchar * modelmux_bin_source_name(ModelMuxBin *ib, guint sid)
gboolean modelmux_bin_attach_stream(ModelMuxBin *ib, guint stream_id, const gchar *name, const gchar *cam_id, const gchar *primary, const gchar *shadow, gint p_gpu, gint s_gpu, gboolean p_via_default, gboolean s_via_default)
gchar * modelmux_bin_route_json(ModelMuxBin *ib, const gchar *f_camera)
A config-time per-sensor model binding, parsed from a [stream-model-<sensor_id>] group.
gboolean lane_leaky
copy-lane nvvideoconvert output-buffers (0 = element default).
const gchar *const * markers
NULL-terminated config-file markers that identify this backend (see modelmux_detect_model_type).
GPtrArray * pending_routes
ModelMuxPendingRouteNote*: routes ACCEPTED but still waiting on a warming target, mirrored from the c...
gboolean modelmux_bin_update_routing(ModelMuxBin *ib, guint stream_id, const gchar *primary, const gchar *shadow, gint p_gpu, gint s_gpu, gboolean p_via_default, gboolean s_via_default)
GstPad * modelmux_sgie_get_sink(ModelMuxSgieBin *sgie_bin)
gboolean s_via_default
origin the deferred apply will record
ModelStatus modelmux_bin_load_model_instances(ModelMuxBin *ib, const gchar *key, const gchar *const cfgs[], const gint gpus[], guint n, guint batch)
One role branch (Primary or Shadow) attached for a stream: the model this role is currently routed to...
const ModelMuxConfig * config
canonical key "name@version" (gchar*, owned) -> BASE-shard ModelBin* (no value destructor: bins are t...
gpointer next_shard
deliberate gpus[] placement: this shard is DESIRED STATE (not overflow) – never auto scaled-in or com...
GHashTable * stream_names
lock-free mirror of g_hash_table_size(streams), kept in sync under lock.
gboolean modelmux_bin_load_defaults(ModelMuxBin *ib)
guint max_streams
monotonic uid allocator (never reused)
gint gpu
OPT custom base config for this version (NULL=catalog)
guint mux_height
mux surface resolution, all muxers (default 1920)
gchar * ota_old_key
rollback COPY of config_file for a BY-CONFIG OTA (NULL when the OTA was engine-only): a failed/reject...
void modelmux_bin_clear_pending_model(ModelMuxBin *ib, guint stream_id)
gboolean modelmux_version_is_int(const gchar *v)
gboolean version_artifact
a NEW version must bring its own config/engine.
gboolean via_default
requested instance gpu for this role's model (MM_GPU_ANY = no constraint).
gchar * modelmux_sgie_route_json(ModelMuxSgieBin *sgie_bin)
gpointer ota_rollback_owner
const G_GNUC_INTERNAL gchar * modelmux_resolve_role(ModelBin *model_bin, guint source_id)
One row of the backend registry.
GstPad * branch_tap_pad
requested src pad on the bin's input demux
GstElement * in_q
OPTIONAL copy converter: tee -> nvvideoconvert -> in_q (NULL = zero-copy passthrough lane).
const gchar * model_status_str(ModelStatus s)
const DefaultModelRef * modelmux_bin_get_default(ModelMuxBin *ib, gboolean shadow)
const gchar * modelmux_sgie_model_name(ModelMuxSgieBin *sgie_bin)
ModelPool * role
model name routed for this role
gulong zero_stream_drop_probe
infer.src ref while drained to zero
GstPad * verify_queue_pad
gchar * ota_new_key
identity-rename rollback COPIES (API_DESIGN.md 5.3): the pre-update ("name@FROM") and post-update ("n...
gboolean multi_gpu_scale
gpus[] instance groups are the PLUGIN's to scale (vs delegated to the backend's own instance_group)
gboolean modelmux_bin_update_in_flight(ModelMuxBin *ib, const gchar *name)
gint conv_gpu
placement was CROSS-device at creation: the bin carries a migration pair.
const gchar * gpu_key
config key that pins the device inside @cfg_section
gboolean modelmux_bin_is_configured_default(ModelMuxBin *ib, const gchar *name, const gchar *version)
const gchar * engine_prop
property carrying a PREBUILT engine.
gchar * shadow_version
shadow model NAME (NULL => default_shadow)
gboolean shard_compact
[multimodel] enable: 0 => bypass the inference bin (decode->display passthrough)
void modelmux_bin_set_rev_shared(ModelMuxBin *ib, ModelMuxRevShared *rev)
gchar * key
placement pin (model/routing default{}.gpu); MM_GPU_ANY = any instance
ModelStatus
ModelBin lifecycle (applies to EVERY ModelBin, any role).
ModelMuxBin * modelmux_bin_new(GstElement *pipeline, const gchar *name, guint max_streams, const ModelMuxConfig *config)
GstElement * conv_in
nvstreammux (legacy)
G_GNUC_INTERNAL void modelmux_role_set(ModelBin *model_bin, const gchar *role)
ModelMuxRevShared * modelmux_rev_shared_ref(ModelMuxRevShared *rev)
GMutex free_lock
guards pending_frees ONLY (separate from lock so a deferred-free idle can deregister even when the sc...
void modelmux_config_register_version(ModelMuxConfig *config, const gchar *name, const gchar *version, const gchar *engine, const gchar *config_file, gint gpu, guint batch)
G_GNUC_INTERNAL void modelmux_schedule_dump(ModelMuxBin *ib, guint delay_seconds)
gpointer promote_ctx
live ModelMuxPromoteCtx* while a passthru->model promote is mid-drain for THIS stream,...
GHashTable * streams_pending
retired name_slot strings (lazy-allocated)
gboolean model_pool_unload_model(ModelPool *rb, const gchar *model_name)
GstElement * conv_out
nvinfer
ModelBin * bin
cached canonical "name@version" (NULL <=> no default) – what every guard compares
gint column
global source_id from nvmultiurisrcbin
guint max_streams
optional DEFT checkpoint version (NULL=unset)
gchar * version
cached engine path (provenance); set when the bin warms to READY
gint p_gpu
TRUE: the apply DROPS the shadow lane
guint64 modelmux_bin_routing_revision(ModelMuxBin *ib)
gboolean copy_primary_buffer
measurement window seconds (default 5, clamp >=1)
gint out
frames through this role's nvinfer (cumulative)
gboolean pinned
device the model's own CONFIG FILE pins (nvinfer gpu-id / inferserver gpu_ids), parsed ONCE at creati...
gchar * ota_old_engine
rollback COPIES while an OTA awaits nvinfer's confirm; committed (freed) on success,...
gchar * default_shadow_version
default shadow model NAME (NULL=>none)
struct _ModelMuxSgieBin ModelMuxSgieBin
guint dump_source_id
pending debug dump source id, under free_lock
gint gpu
model VERSION ("1", ...); NULL only with name
guint mux_width
per-model nvstreammux properties (from [muxer]; captured at create so the drain-recovery recreate pat...
gchar * version
model name (must match a [model-name-*] catalog entry)
ModelMuxUnloadGpuResult modelmux_bin_unload_model_gpus(ModelMuxBin *ib, const gchar *key, const gint *gpus, guint n_gpus, gint *serving_gpu, guint *serving_streams, gchar **serving_csv)
void modelmux_sgie_set_overlay_slot(ModelMuxSgieBin *sgie_bin, guint slot)
GstPad * zero_stream_drop_pad
nvstreamdemux
guint modelmux_bin_active_stream_ids(ModelMuxBin *ib, guint **out)
gchar * shadow
primary model VERSION (NULL => default_primary_version)
GHashTable * streams_cancelled
SET stream_id(GINT) -> 1: a detach arrived while the attach was still pending -> the attach aborts on...
GType modelmux_rev_shared_get_type(void)
gboolean engine_file
a raw .engine is a meaningful artifact for this backend (nvinfer swaps it in via model-engine-file; T...
@ MODEL_WARMED
engine still building/loading; cannot attach yet
guint batch_size
max concurrent streams.
GMutex versions_lock
guards versions[] / num_versions – the ONLY ModelMuxConfig state mutable at RUNTIME: modelmux_config_...
void modelmux_bin_free(ModelMuxBin *ib)
void modelmux_rev_shared_unref(ModelMuxRevShared *rev)
gint shutting_down
set before free so async sources stop rescheduling
gboolean gie_id
the element carries a gie identity: unique-id to stamp into object meta and operate-on-gie-id to filt...
gboolean unified
max concurrent streams batch cap
ModelType type
per-model batch / max streams (clamped)
ModelStatus modelmux_bin_load_into_pool(ModelMuxBin *ib, gboolean shadow, const gchar *key, const gchar *cfg_override)
void modelmux_bin_set_stream_identity(ModelMuxBin *ib, guint stream_id, const gchar *name, const gchar *cam_id)
guint branch_serial
stable DISPLAY column [0,max_streams): primary -> out_mux slot=column (tile row 0),...
void modelmux_config_resolve_models(const ModelMuxConfig *config, const DefaultModelRef *def_primary, const DefaultModelRef *def_shadow, const gchar *camera_id, const gchar **primary, const gchar **shadow, const gchar **primary_version, const gchar **shadow_version, gboolean *primary_is_default, gboolean *shadow_is_default)
gint floor
dumps seen since attach (skip pipeline-fill warmup)
gint modelmux_bin_model_status(ModelMuxBin *ib, gboolean shadow, const gchar *name)
guint model_mux_push_timeout
const ModelBackendInfo * modelmux_backend(ModelType type)
The registry row for @type.
gboolean modelmux_bin_try_inplace(ModelMuxBin *ib, const guint *src_ids, guint n, const gchar *primary, const gchar *shadow)
void modelmux_bin_set_default(ModelMuxBin *ib, gboolean shadow, const gchar *name, const gchar *version, gint gpu)
GstElement * out_q
queue: [conv ->] in_q -> ModelBin (persistent on swap)
guint next_limbo_gie
gie-unique-id allocator for limbo models
guint positions
MM_BACKEND_AT_* mask: where this backend is allowed to run.
guint per_model_max_streams
gint modelmux_config_version_gpu(const ModelMuxConfig *config, const gchar *name, const gchar *version)
gboolean modelmux_bin_key_serving(ModelMuxBin *ib, const gchar *key, guint *streams, gchar **streams_csv)
void modelmux_bin_promote_passthru(ModelMuxBin *ib, guint stream_id, const gchar *model, const gchar *shadow, gint p_gpu, gint s_gpu, gboolean p_via_default, gboolean s_via_default)
gchar * pending_model
model-sharding=0 overflow: this branch bypasses inference entirely – tee -> queue -> out_mux,...
gulong tap_probe_id
debug tap probe pad (held until teardown)
gint active_streams
flag to enable unified A/B display batch
GHashTable * stream_wiring
stream_id(GINT) -> ModelMuxStreamEntry
gint modelmux_config_version_gie(const ModelMuxConfig *config, const gchar *name, const gchar *version)
gint process_mode
one display batch (TRUE) vs per-role
guint modelmux_bin_model_gpus(ModelMuxBin *ib, const gchar *key, gint *out, guint cap)
gchar * engine_file
nvinfer/nvinferserver config-file-path
gint infer_base
source in_count at this role's epoch start
GstElement * parent_pipeline
guint inst
canonical instance id "name@version" – the hash key in the pool's models map + the limbo map,...
GstPad * modelmux_bin_get_src(ModelMuxBin *ib)
One ACCEPTED-but-not-yet-applied model/routing, mirrored down from the control layer so the status vi...
gboolean mux_live_source
mux surface resolution, all muxers (default 1080)
gboolean inplace_reload
supports nvinfer's native in-place engine/config hot-swap (model/update)
DefaultModelRef default_ref
borrowed: stream_id -> name (overlay)
gboolean model_bin_detach(ModelBin *model_bin, guint stream_id)
GstPad * tee_src
queue: ModelBin -> combined mux (persistent)
GQueue * free_idx
drops stale late nvinfer output
gint default_primary_gpu
default shadow model VERSION (NULL=>none)
guint64 routing_revision
monotonic; bumps on every APPLIED model/routing, default switch or model/update (under ib->lock); sur...
GstElement * out_mux
splits the batched input -> per-stream
gchar * ota_old_version
guards retired[] + the ota_* rollback stash: the nvinfer 'model-updated' confirm callback runs on nvi...
GstPad * verify_head_pad
debug tap probe id
gboolean modelmux_bin_unload_model(ModelMuxBin *ib, const gchar *key)
gchar * role
Modelbin name.
GstElement * infer
xfer-in (nvdsxfer) mux->infer: migrates the batch to THIS shard's device – nvinfer rejects input surf...
gboolean attach_perf_metric
combined mux flush us (default 33333 ~= 30fps)
ModelStatus modelmux_bin_load_model(ModelMuxBin *ib, const gchar *key, const gchar *cfg_override, gint gpu, guint batch)
GstElement * parent_pipeline
ModelMuxBin GstBin.
#define MM_MAX_STREAMS_DEFAULT
guint modelmux_bin_model_batch(ModelMuxBin *ib, const gchar *key)
gchar * shadow
deferred primary target key, or NULL
gboolean modelmux_sgie_update(ModelMuxSgieBin *sgie_bin, const gchar *name, const gchar *from_version, const gchar *version, const gchar *config_file, const gchar *engine_file, gint *http, const gchar **err_code, const gchar **reason, const gchar **hint)
ModelMuxRoleAttach prim
entry point + fan-out to roles
GPtrArray * retired
the in-flight reload is a group-rollback COMPENSATING re-trigger of the PREVIOUS engine: its confirm ...
gchar * config
OPT engine swapped into the effective config (NULL=base)
guint modelmux_bin_update_routing_scoped(ModelMuxBin *ib, const guint *src_ids, guint n, const gchar *primary, const gchar *shadow, gint p_gpu, gint s_gpu, gboolean p_via_default, gboolean s_via_default)
guint copy_buffer_pool_size
copy on the SHADOW lane (nvvideoconvert dp=1; def 1)
guint64 modelmux_rev_shared_get(ModelMuxRevShared *rev)
Current value; 0 for a NULL @rev, which is the same answer a stage that has not negotiated the contex...
GstElement * bin
PIPELINE device ([multimodel] gpu-id): the model mux batches decoder buffers, which live on that devi...
void model_pool_free(ModelPool *rb)
gboolean mux_live_source
1 = pgie, 2 = sgie (from the element)
gboolean copy_shadow_buffer
copy on the PRIMARY lane (nvvideoconvert dp=1; def 0)
G_GNUC_INTERNAL GstPadProbeReturn modelmux_status_query_probe(GstPad *pad, GstPadProbeInfo *info, gpointer udata)
GMutex prov_lock
next ModelBin* of the SAME model (shard chain; NULL = last).
gint infer
role delivered count at epoch start
gchar * engine
positive-integer version this override applies to
const GHashTable * stream_names
background engine warm-up
G_GNUC_INTERNAL void modelmux_post_model_event(GstElement *src, const gchar *event, const gchar *name, const gchar *version, gint gpu, gboolean ok, const gchar *detail)
gboolean perf_on
nvinfer vs nvinferserver
ModelStatus modelmux_bin_prepare_model(ModelMuxBin *ib, gboolean shadow, const gchar *name)
gchar * modelmux_bin_status_json(ModelMuxBin *ib, const gchar *f_model, const gchar *f_version, const gchar *f_stream, gint f_sid)
gpointer ota_group
an OTA reload is in flight (set at trigger)
void modelmux_sgie_bump_routing_revision(ModelMuxSgieBin *sgie_bin)
ModelStatus model_bin_status(ModelBin *model_bin)
G_GNUC_INTERNAL GstPadProbeReturn modelmux_control_query_probe(GstPad *pad, GstPadProbeInfo *info, gpointer udata)
GstPad * src_ghost
combined display nvstreammux
const ModelMuxConfig * config
parent pipeline
gboolean modelmux_bin_model_on_gpu(ModelMuxBin *ib, const gchar *key, gint gpu)
gboolean modelmux_bin_reload_model_multi(ModelMuxBin *ib, const gchar *name, const gint gpus[], const gchar *const engines[], guint n, const gchar *version)
guint64 modelmux_rev_shared_bump(ModelMuxRevShared *rev)
Increment and return the new value.
gboolean modelmux_sgie_route(ModelMuxSgieBin *sgie_bin, const gchar *name, const gchar *version, gint *http, const gchar **err_code, const gchar **reason, const gchar **hint)
gboolean model_pool_load_model(ModelPool *rb, const gchar *model_name, const gchar *cfg_override, guint batch)
void model_bin_load(ModelBin *model_bin)
GMutex lock
guards streams/pools for the periodic dump
gboolean owns_placement
the BACKEND schedules its own device(s), so the plugin cannot claim to have placed it (status reports...
gchar * model
a zero-drop swap/clear probe is in flight
guint modelmux_bin_passthru_streams(ModelMuxBin *ib, const guint *src_ids, guint n, guint **out)
gboolean conv_cross
PER-SHARD placement recorded at creation (-1 = the config's device).
ModelPlacementPolicy
Stream placement policy across a multi-GPU instance group ([multimodel] placement-policy) – applies o...
gboolean modelmux_backend_at_position(ModelType type, gint process_mode)
TRUE iff @type may run at @process_mode (MM_PROCESS_MODE_PGIE / _SGIE).
gint over
established steady in-flight depth (min gap post-warm)
gint placement_policy
[multimodel] placement-policy (pack|spread): how unconstrained streams are placed across a multi-GPU ...
gint modelmux_config_file_process_mode(const gchar *config_file)
guint model_bin_num_streams(ModelBin *model_bin)
const gchar * modelmux_infer_plugin_str(ModelType type)
gchar * default_shadow
default primary model VERSION (e.g.
GHashTable * limbo_models
canonical key "name@version" -> ModelBin* (warm, role Unknown; promoted into a role pool on first use...
gchar * key
model checkpoint version (provenance/status); NULL => fall back to the engine basename
gint last_src_fn
consecutive dump samples with buffered above floor+slack (a 1-sample excursion is in-flight churn,...
gboolean modelmux_overlay_enabled(void)
guint perf_metric_interval_sec
enable fps/latency measurement (default FALSE)
gint gie
placement recorded at load/update (-1 = config's device)
gboolean model_sharding
dedup-on-idle policy (default TRUE).
void modelmux_bin_clear_default(ModelMuxBin *ib, gboolean shadow)
gint gpu
shard instance index (0 = base; 1+ = overflow shards auto-created when a shard fills).
gchar * version
optional prebuilt engine override (NULL=config's)
gboolean modelmux_sgie_unload(ModelMuxSgieBin *sgie_bin, const gchar *name, const gchar *version, gint *http, const gchar **err_code, const gchar **reason, const gchar **hint)
GHashTable * stream_cam_ids
stream_id(GINT) -> gchar* ROUTABLE camera_id (stream/add's camera_id).
gboolean ota_compensating
this shard's confirm outcome, recorded for the group resolution (prov_lock)
gchar * default_primary_version
default primary model NAME (catalog ref)
ModelMuxRevShared * rev_shared
the PIPELINE-WIDE revision, shared with every other nvmodelmux stage through a GstContext (see MODELM...
const G_GNUC_INTERNAL gchar * modelmux_role_get(ModelBin *model_bin)
const gchar * config_group
config-file group whose keys ARE the element's property names, applied one by one (see modelmux_confi...
const ModelCatalogEntry * modelmux_config_update_model(ModelMuxConfig *config, const gchar *name, const gchar *config_file, const gchar *engine_file, const gchar *version)
GstPad * tap_pad
recycled combined-mux sink index
G_GNUC_INTERNAL gint modelmux_role_idx(const gchar *role)
gboolean ota_await
owning ModelMuxBin* for the deferred rollback rename (a limbo bin has pool==NULL, so the confirm call...
G_GNUC_INTERNAL gboolean modelmux_debug_enabled(void)
GstElement * demux
xfer-out (nvdsxfer) infer->demux: brings the batch back to the PIPELINE device ([multimodel] gpu-id) ...
void modelmux_pending_route_note_free(gpointer note)
gint out_base
role infer count at epoch start
gboolean gpu_ids_list
a derived config pins the device as gpu_ids: [N] inside an infer_config block (Triton grammar) rather...
@ MODEL_BACKEND_N
nvdsvisionencoder (object embeddings)
GstElement * modelmux_sgie_get_infer(ModelMuxSgieBin *sgie_bin)
ModelPool * model_pool_new(const gchar *role, guint base_uid, guint max_streams, GstElement *parent_pipeline, GstElement *container, const ModelMuxConfig *config, const GHashTable *stream_names)
#define MM_ACCT_MAX
max source_id tracked (flat, lock-free)
gboolean modelmux_bin_reload_model(ModelMuxBin *ib, const gchar *name, const gchar *config, const gchar *engine, const gchar *version)
gchar * primary_version
primary model NAME (NULL => default_primary)
gchar * engine
owning ModelPool* (back-ptr; for the slot-derived role lookup in the overlay)
gboolean modelmux_bin_model_loaded(ModelMuxBin *ib, const gchar *name)
gint warm
last delivered frame_num
gint modelmux_config_file_gie_id(const gchar *config_file)
guint modelmux_bin_unload_versions(ModelMuxBin *ib, const gchar *name, guint *present)
gint modelmux_config_file_gpu(const gchar *config_file)
guint num_streams
lock-free mirror of idx_to_stream: idx -> stream_id (-1 = free), max_streams entries.
const gchar * cfg_section
config-file section holding this backend's scalar keys, WITHOUT brackets ("property",...
const ModelCatalogEntry * modelmux_config_register_model(ModelMuxConfig *config, const gchar *name, const gchar *config_file, const gchar *engine_file, const gchar *version, guint max_streams)
guint modelmux_bin_streams_on_model(ModelMuxBin *ib, gboolean shadow, const gchar *key, guint *out, guint cap, gboolean default_only)
void model_key_split(const gchar *key, gchar **name_out, gchar **version_out)
GstPad * demux_src
unique lifetime suffix for deferred-free-safe branch-local element names
const gchar * modelmux_sgie_model_version(ModelMuxSgieBin *sgie_bin)
gboolean modelmux_config_has_other_version(const ModelMuxConfig *config, const gchar *name, const gchar *version)
@ MODEL_INFERSERVER
nvinfer (TensorRT; default)
gulong verify_head_probe_id
debug copy-verify head probe pad
guint gpu
[multimodel] gpu-id: the PIPELINE device – where the decoders, the shared input demux and the combine...
gint last_out_fn
frames delivered downstream for this role (cumul.)
gint modelmux_config_file_operate_on_gie(const gchar *config_file)
void model_bin_free(ModelBin *model_bin)
A per-version artifact override from a [model-<name>-<version>] config group: the engine/checkpoint a...
guint max_streams
nvinfer gie-unique-id (for provenance)
void modelmux_bin_set_pending_model(ModelMuxBin *ib, guint stream_id, const gchar *model, gint gpu, gboolean via_default)
gulong verify_queue_probe_id
debug copy-verify queue probe pad
G_GNUC_INTERNAL ModelBin * modelmux_perf_find_bin_for_source(ModelPool *pool, guint source_id)
const gchar * config_prop
property that takes the model's config FILE, or NULL when the element has no such property and is con...
gint default_shadow_gpu
requested instance placement of the runtime default (model/routing default{}.gpu); -1 = any instance.
GstElement * conv
owning role bin
GstPad * modelmux_sgie_get_src(ModelMuxSgieBin *sgie_bin)
guint modelmux_config_version_batch(const ModelMuxConfig *config, const gchar *name, const gchar *version)
GPtrArray * retired_names
gchar * modelmux_config_resolve_version_cfg(const ModelMuxConfig *config, const gchar *name, const gchar *version, gboolean *derive_failed)
gulong branch_tap_probe_id
debug branch-in tap pad (held until teardown)
GList * pending_sources
ModelMuxTrackedSource* deferred dynamic-op idles/timeouts; guarded by free_lock and cancelled before ...
guint debug_interval
MM_DEBUG_INTERVAL: dump cadence in frames
gchar * version
model NAME; NULL => no default for this role
gboolean unified_batch
default cap for a model if unset
guint combined_mux_push_timeout
per-model mux flush us (default 10000 = 10ms)
ModelType type
Primary/Shadow.
gchar * config_file
logical model name, e.g.
const gchar * element
gst factory name – also the name status/logs report as "backend"
gboolean model_pool_detach(ModelPool *rb, guint stream_id, const gchar *model_name)
gboolean log_enabled
MM_DEBUG: single switch for ALL debug logs
guint batch
OPT per-VERSION gie-unique-id (-1 = unset).
GThread * load_thread
ModelStatus, accessed atomically
gint frame_count
batches seen on the combined-mux src; written atomically by the streaming thread (probe) and reset to...
gboolean modelmux_sgie_load(ModelMuxSgieBin *sgie_bin, const gchar *name, const gchar *version, const gchar *config_file, const gchar *engine_file, gint *http, const gchar **err_code, const gchar **reason, const gchar **hint)
G_GNUC_INTERNAL void modelmux_fmt_route_cell(gchar *buf, gsize n, const ModelMuxRoleAttach *ra)
@ MODEL_VISION_ENCODER
nvinferserver (Triton backend)
gchar * primary
camera id this binding applies to (matches sensor-id-list)
GstElement * mux
the GstBin
ModelType
Inference backend element used inside a ModelBin.
@ MODEL_SERVING
engine loaded, idle (0 streams); ready to take streams
void modelmux_sgie_free(ModelMuxSgieBin *sgie_bin)
struct _ModelMuxRevShared ModelMuxRevShared
The counter itself: refcounted (each stage holds one ref) and self-locking, so it can be read while a...
ModelType modelmux_detect_model_type(const gchar *config_file)
const ModelCatalogEntry * modelmux_config_find_model(const ModelMuxConfig *config, const gchar *name)
const G_GNUC_INTERNAL gchar * model_version_str(ModelBin *model_bin)
gboolean ever_attached
TRUE once any stream has attached.
gboolean ota_ok
owning ModelMuxOtaGroup* (bin-internal) while a GROUPED model/update awaits per-shard confirms: the w...
guint max_streams
multimodel config
G_GNUC_INTERNAL void modelmux_debug_configure(ModelMuxBin *ib)
gint s_gpu
requested placement per role (MM_GPU_ANY=any)
gint status
TRUE once a stream has ever attached.
GstPad * out_mux_sink
requested src pad on the per-stream tee
guint perf_timer_id
perf-metric tick g_timeout id (0=none/off)
gboolean clear_shadow
deferred shadow target key, or NULL
gchar * model_key(const gchar *name, const gchar *version)
gboolean modelmux_sgie_get_info(ModelMuxSgieBin *sgie_bin, guint idx, const gchar **name, const gchar **version, const gchar **backend, guint *gie, gint *gpu, guint *streams, const gchar **state, gboolean *serving, gchar **engine)
gint req_gpu
when passthru AND awaiting deferred promotion: the model this stream is MAPPED to but which is still ...
gchar * modelmux_sgie_status_json(ModelMuxSgieBin *sgie_bin, const gchar *f_model, const gchar *f_version)
ModelBin * model_bin_new(const gchar *name, const gchar *role, const gchar *config_file, const gchar *engine_file, const gchar *version, guint unique_id, guint max_streams, const ModelMuxConfig *config, GstElement *parent_pipeline, GstElement *container, const GHashTable *stream_names, guint inst)
gint cfg_gpu
the migration pair's current TARGET device
GList * pending_frees
ModelMuxFreeCtx* deferred branch-teardowns awaiting g_idle; cancelled in _free() so a queued idle nev...
void modelmux_sgie_set_rev_shared(ModelMuxSgieBin *sgie_bin, ModelMuxRevShared *rev)
gpointer owner
THIS role's runtime default designation (see DefaultModelRef).
void modelmux_draw_label(struct _NvDsBatchMeta *bmeta, struct _NvDsFrameMeta *fm, guint x_offset, guint y_offset, const gchar *text, const gchar *role)
gboolean passthru
debug copy-verify context
guint mux_width
auto-shard streams when per-model cap exceeded.
GHashTable * models
ModelMuxBin GstBin that owns the elements
void modelmux_bin_set_pending_routes(ModelMuxBin *ib, GPtrArray *notes)
DefaultModelRef: a role's RUNTIME default model DESIGNATION – embedded in that role's ModelPool ("thi...
ModelMuxRevShared * modelmux_rev_shared_new(void)
A new counter at revision 0, refcount 1.
const GHashTable * stream_names
borrowed, READ-ONLY reference data only: model catalog, policy flags (placement/ sharding/leaky) and ...
gchar * modelmux_bin_name_serving_streams(ModelMuxBin *ib, const gchar *name)
Per-stream bookkeeping inside the ModelMuxBin: ONE record per attached stream (the routing-table row)...
gint * slot_stream
idx(GINT) -> stream_id(GINT)
@ MODEL_FAILED
engine loaded, >=1 stream attached
guint compact_poll_id
debounce g_timeout id for shard compaction (0=none)
gboolean modelmux_bin_detach_stream(ModelMuxBin *ib, guint stream_id)
GstPad * modelmux_bin_get_sink(ModelMuxBin *ib)
gboolean gie_ids_from_config
1 = pgie, 2 = sgie; forwarded to every inference element this stage builds
gint last_in_fn
frames that entered the bin (in_demux)