nv_ingest_api.util.system package#

Submodules#

nv_ingest_api.util.system.hardware_info module#

class nv_ingest_api.util.system.hardware_info.SystemResourceProbe(hyperthread_weight: float = 0.75)[source]#

Bases: object

Detects the effective CPU core count available to the current process, optionally applying a weighting factor for hyperthreads (SMT).

It attempts to reconcile information from: 1. Linux Cgroup v2 CPU limits (cpu.max) 2. Linux Cgroup v1 CPU limits (cpu.cfs_quota_us, cpu.cfs_period_us) 3. OS scheduler affinity (os.sched_getaffinity) 4. OS reported CPU counts (psutil.cpu_count for logical/physical)

Prioritizes Cgroup quota limits. If the limit is based on core count (affinity/OS), it applies hyperthreading weight if psutil provides physical/logical counts.

get_details() Dict[str, Any][source]#

Returns a dictionary with all detected information.

get_effective_cores() float | None[source]#

Returns the primary result: the effective core limit, potentially weighted.

Module contents#