Skip to main content

Module gpu

Module gpu 

Source
Expand description

GPU device enumeration for NVDEC/NVENC scheduling.

NVIDIA detection loads libcuda via dlopen, calls cuInit + cuDeviceGetCount + cuDeviceGetName. This works on minimal container images where the nvidia-smi binary may be absent but the driver’s user-mode libraries are bind-mounted by the NVIDIA Container Toolkit. AMD/Intel detection scans /sys/bus/pci/devices on Linux.

Structs§

GpuDevice
GpuUtilization
Per-GPU live utilisation snapshot. Read on every load tick (5 s cadence) by the Phase 2 (2026-05-07) worker_load reporter and folded into the WsGpuLeaseEntry for the wire. NVIDIA values come from NVML; Intel values come from sysfs gt_cur_freq_mhz / gt_max_freq_mhz for a coarse “busy” proxy + mem_info_vram_* for memory; AMD is currently a no-op (returns all zeros) — radeontop / amdsmi integration is the proper fix and is deferred per the brief’s “Phase 1 stand-in for Intel; AMD skipped” guidance.
GpuUtilizationReader
One-shot accumulator that opens NVML once and reads per-GPU utilisation for every NVIDIA device on each load tick. Holding the NVML handle across reads avoids the init cost (microseconds) on every tick and is the documented pattern.

Enums§

GpuVendor

Functions§

detect_gpus
has_nvidia
manufacturer_label
Human-readable manufacturer label. Used by the WS hello frame’s WsGpuInfo.manufacturer field and by the admin inventory page’s “by manufacturer” rollup. Stays in lockstep with vendor_label in transcoder/src/capabilities.rs so the registration POST + the hello frame agree on the spelling.
supports_av1_encode