NVIDIA DeepStream SDK API Reference

9.2 Release
sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_perf.h File Reference

Go to the source code of this file.

Data Structures

struct  ModelMuxPerfCounter
 
struct  _MmPerf
 

Macros

#define MM_PERF_DEFAULT_INTERVAL_SEC   5
 
#define MM_PERF_MIN_INTERVAL_SEC   1
 
#define MM_PERF_MAX_SOURCES   256
 

Typedefs

typedef struct _MmPerf ModelMuxPerf
 

Functions

static void modelmux_perf_counter_record (ModelMuxPerfCounter *c, guint64 lat_us)
 Hot-path record: count one frame; if lat_us>0 also add a latency sample. More...
 
void modelmux_perf_counter_tick (ModelMuxPerfCounter *c, gint64 now_us)
 Recompute fps/lat_ms from the delta since the previous tick; advance the window. More...
 
void modelmux_perf_counter_clear (ModelMuxPerfCounter *c)
 Zero a counter (totals + snapshot). More...
 
ModelMuxPerf * modelmux_perf_new (void)
 
void modelmux_perf_free (ModelMuxPerf *p)
 
static void modelmux_perf_mark_bin_in (ModelMuxPerf *p, gint64 now_us)
 HOT PATH: stamp the batch arrival time at the BIN's inference head. More...
 
void modelmux_perf_mark_bin_out (ModelMuxPerf *p, gint64 now_us, gint source_id)
 HOT PATH: called once per output frame at the BIN's inference tail. More...
 
void modelmux_perf_tick (ModelMuxPerf *p, gint64 now_us)
 Caller-locked: tick the aggregate + every active per-source counter. More...
 
void modelmux_perf_get_model (const ModelMuxPerf *p, gdouble *fps, gdouble *lat_ms)
 Caller-locked: read the aggregate snapshot. More...
 
void modelmux_perf_get_source (const ModelMuxPerf *p, gint source_id, gdouble *fps, gdouble *lat_ms)
 Caller-locked: read a per-source snapshot (0/0 if unknown source or NULL). More...
 
gboolean modelmux_gpu_stats (gint gpu, guint *util_pct, guint *mem_used_mb, guint *mem_total_mb)
 WHOLE-device stats via NVML (dlopen'd lazily; FALSE = NVML/device unavailable). More...
 

Macro Definition Documentation

◆ MM_PERF_DEFAULT_INTERVAL_SEC

#define MM_PERF_DEFAULT_INTERVAL_SEC   5

◆ MM_PERF_MAX_SOURCES

#define MM_PERF_MAX_SOURCES   256

◆ MM_PERF_MIN_INTERVAL_SEC

#define MM_PERF_MIN_INTERVAL_SEC   1

Typedef Documentation

◆ ModelMuxPerf

typedef struct _MmPerf ModelMuxPerf

Function Documentation

◆ modelmux_gpu_stats()

gboolean modelmux_gpu_stats ( gint  gpu,
guint *  util_pct,
guint *  mem_used_mb,
guint *  mem_total_mb 
)

WHOLE-device stats via NVML (dlopen'd lazily; FALSE = NVML/device unavailable).

Attribution to a model is by CO-LOCATION only (which instances run there).

◆ modelmux_perf_counter_clear()

void modelmux_perf_counter_clear ( ModelMuxPerfCounter *  c)

Zero a counter (totals + snapshot).

◆ modelmux_perf_counter_record()

static void modelmux_perf_counter_record ( ModelMuxPerfCounter *  c,
guint64  lat_us 
)
inlinestatic

Hot-path record: count one frame; if lat_us>0 also add a latency sample.

Lock-free.

Definition at line 88 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_perf.h.

References ModelMuxPerfCounter::frames, ModelMuxPerfCounter::lat_n, and ModelMuxPerfCounter::lat_sum_us.

◆ modelmux_perf_counter_tick()

void modelmux_perf_counter_tick ( ModelMuxPerfCounter *  c,
gint64  now_us 
)

Recompute fps/lat_ms from the delta since the previous tick; advance the window.

The FIRST tick (last_ts_us==0) only establishes the baseline (reports 0). Caller-locked.

◆ modelmux_perf_free()

void modelmux_perf_free ( ModelMuxPerf *  p)

◆ modelmux_perf_get_model()

void modelmux_perf_get_model ( const ModelMuxPerf *  p,
gdouble *  fps,
gdouble *  lat_ms 
)

Caller-locked: read the aggregate snapshot.

◆ modelmux_perf_get_source()

void modelmux_perf_get_source ( const ModelMuxPerf *  p,
gint  source_id,
gdouble *  fps,
gdouble *  lat_ms 
)

Caller-locked: read a per-source snapshot (0/0 if unknown source or NULL).

◆ modelmux_perf_mark_bin_in()

static void modelmux_perf_mark_bin_in ( ModelMuxPerf *  p,
gint64  now_us 
)
inlinestatic

HOT PATH: stamp the batch arrival time at the BIN's inference head.

Definition at line 111 of file sources/gst-plugins/gst-nvmodelmux/gstnvmodelmux_perf.h.

References _MmPerf::t_enter_us.

◆ modelmux_perf_mark_bin_out()

void modelmux_perf_mark_bin_out ( ModelMuxPerf *  p,
gint64  now_us,
gint  source_id 
)

HOT PATH: called once per output frame at the BIN's inference tail.

Derives the batch latency (now - t_enter, identical for every frame of the batch) and records it into the aggregate and the frame's per-source counter. now_us should be sampled ONCE per batch by the caller and passed unchanged for every frame of that batch.

◆ modelmux_perf_new()

ModelMuxPerf* modelmux_perf_new ( void  )

◆ modelmux_perf_tick()

void modelmux_perf_tick ( ModelMuxPerf *  p,
gint64  now_us 
)

Caller-locked: tick the aggregate + every active per-source counter.