gpu

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package gpu samples accelerator telemetry across vendors.

NVIDIA/AMD/Intel are read through their vendor CLIs (nvidia-smi, rocm-smi, xpu-smi). We shell out deliberately: NVML and Level Zero have no stable in-process Go API without cgo-linking driver libraries, and the vendor CLIs are their documented interfaces. Tool presence is cached for the process lifetime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseNvidiaSMI

func ParseNvidiaSMI(b []byte) []core.GPUDevice

ParseNvidiaSMI reads CSV rows of index,name,temp,memused,memtotal,util,power,driver_version. The name may contain commas; the last six fields are always fixed. Exported so the remote ssh path can parse nvidia-smi output gathered from another host with the exact same rules.

func ParseRocmSMI

func ParseRocmSMI(b []byte) []core.GPUDevice

ParseRocmSMI reads rocm-smi --json output keyed by "cardN". Values may be strings or single-element arrays depending on version. Exported so the remote ssh path can parse rocm-smi output gathered from another host.

func Sample

func Sample(ctx context.Context) []core.GPUDevice

Sample collects devices from every vendor present on the host.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL