Liking cljdoc? Tell your friends :D

hive-system.gpu.probe

nvidia-smi probe satisfying IGpuStatus.

Authoritative source for VRAM observability. The OllamaGpuExecutor's gpu-status returns -1 for VRAM fields because ollama doesn't expose them reliably; this probe shells out to nvidia-smi for the truth.

Uses hive-system.protocols/IShell so a mock shell can drive tests without launching real subprocesses (DIP). Default ctor wires the stateless hive-system.shell.core/exec! convenience.

Output schema (ok branch): {:vram-free-mb long :vram-total-mb long :inflight 0 ; probe doesn't track in-flight calls :queued 0 ; idem :backend-id :nvidia-smi}

Err branch tags: :gpu/no-driver — nvidia-smi missing on PATH or returned non-zero :gpu/probe-parse — nvidia-smi output couldn't be parsed :gpu/transport-failed — exec layer raised

nvidia-smi probe satisfying IGpuStatus.

Authoritative source for VRAM observability. The OllamaGpuExecutor's
gpu-status returns -1 for VRAM fields because ollama doesn't expose them
reliably; this probe shells out to nvidia-smi for the truth.

Uses hive-system.protocols/IShell so a mock shell can drive tests
without launching real subprocesses (DIP). Default ctor wires the
stateless hive-system.shell.core/exec! convenience.

Output schema (ok branch):
  {:vram-free-mb  long
   :vram-total-mb long
   :inflight      0          ; probe doesn't track in-flight calls
   :queued        0          ; idem
   :backend-id    :nvidia-smi}

Err branch tags:
  :gpu/no-driver       — nvidia-smi missing on PATH or returned non-zero
  :gpu/probe-parse     — nvidia-smi output couldn't be parsed
  :gpu/transport-failed — exec layer raised
raw docstring

nvidia-smi-probeclj

(nvidia-smi-probe)
(nvidia-smi-probe
  {:keys [shell command timeout-ms]
   :or {shell (shell/make-shell) command default-cmd timeout-ms 5000}})

Build an NvidiaSmiProbe.

Options: :shell — IShell impl (default: hive-system.shell.core/make-shell) :command — argv vector (default: nvidia-smi memory.free,memory.total CSV) :timeout-ms — exec timeout (default 5000)

Build an NvidiaSmiProbe.

Options:
  :shell      — IShell impl (default: hive-system.shell.core/make-shell)
  :command    — argv vector (default: nvidia-smi memory.free,memory.total CSV)
  :timeout-ms — exec timeout (default 5000)
sourceraw docstring

parse-csv-lineclj

(parse-csv-line line)

Parse one CSV line of <free>, <total> integer MiB values.

Parse one CSV line of `<free>, <total>` integer MiB values.
sourceraw docstring

parse-nvidia-smi-csvclj

(parse-nvidia-smi-csv stdout)

Parse stdout of nvidia-smi --query-gpu=memory.free,memory.total --format=csv,noheader,nounits. Single-GPU host: returns the first parsed line. Multi-GPU: same — for v1 we surface the first card; the probe can be parameterised later.

Parse stdout of `nvidia-smi --query-gpu=memory.free,memory.total --format=csv,noheader,nounits`.
Single-GPU host: returns the first parsed line. Multi-GPU: same — for
v1 we surface the first card; the probe can be parameterised later.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close