Skip to content

NVIDIA GPU Module 🟑 BETA

The botnvidia crate reports NVIDIA GPU availability and utilisation by invoking nvidia-smi through SafeCommand.

The Admin guide path: GPU checks belong to Admin.

When to use

  • Deciding whether a local model can run on this host.
  • Reading GPU and CPU utilisation for a capacity check.
  • Explaining why a local engine reports no GPU even though a device is installed.

Before you start

Check Requirement
Feature The nvidia Cargo feature is compiled into the server.
Tooling nvidia-smi available on PATH; the crate never calls a shell directly.
Authority botserver/crates/botnvidia/src/lib.rs.

Steps

  1. Call has_nvidia_gpu(). It builds nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits through SafeCommand and returns true only when the command succeeds.
  2. Call get_gpu_utilization() for per-device gpu and memory values, parsed from the CSV output into a map. A failed command is an error, not a zero value.
  3. Call get_system_metrics() for a SystemMetrics value: global CPU usage from sysinfo, plus GPU usage when a GPU was detected.
  4. Use the result when selecting a local engine in the Multimodal Module or sending data to the Time-Series Database Module.

Verify

Check Expected result
GPU present has_nvidia_gpu() is true.
Utilisation get_gpu_utilization() returns gpu and memory entries parsed from nvidia-smi.
No GPU SystemMetrics::gpu_usage is None; CPU usage is still reported.
Command failure An error is returned; no unwrap, expect or panic is reached.

Roll back

  1. No state is changed by these calls. Remove any scheduling or automation you added around them.
  2. If the tool was installed only for this check, remove it from PATH and confirm has_nvidia_gpu() returns false.