hardware

package
v0.1.7-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinimumVRAMBytes = uint64(8 * 1024 * 1024 * 1024)
	// MinimumRAMBytes is the "16 GB installed" floor. Windows reports usable
	// RAM after hardware reservations, so a real 16 GB machine shows ~15.9 GB;
	// a strict 16 GiB compare would fail every 16 GB gaming PC. 15 GiB usable
	// only admits machines with at least 16 GB installed in practice.
	MinimumRAMBytes  = uint64(15 * 1024 * 1024 * 1024)
	MinimumDiskBytes = uint64(40 * 1024 * 1024 * 1024)
)
View Source
const (
	StatusPass        = "pass"
	StatusFail        = "fail"
	StatusWarn        = "warn"
	StatusUnsupported = "unsupported"
	StatusSkipped     = "skipped"
)

Variables

View Source
var NvidiaSMIQueryArgs = []string{
	"--query-gpu=name,uuid,memory.total,driver_version,temperature.gpu,power.draw,power.limit,utilization.gpu",
	"--format=csv,noheader,nounits",
}

Functions

func WriteHuman

func WriteHuman(w io.Writer, report DoctorReport)

func WriteJSON

func WriteJSON(w io.Writer, report DoctorReport) error

Types

type CheckResult

type CheckResult struct {
	Name        string         `json:"name"`
	Status      string         `json:"status"`
	Message     string         `json:"message"`
	Remediation string         `json:"remediation,omitempty"`
	Details     map[string]any `json:"details,omitempty"`
}

type CommandRunner

type CommandRunner interface {
	Run(ctx context.Context, name string, args ...string) ([]byte, error)
}

type DoctorOptions

type DoctorOptions struct {
	DiskPath string
	HTTPSURL string
	WSSURL   string
	Timeout  time.Duration
	Runner   CommandRunner
}

type DoctorReport

type DoctorReport struct {
	GeneratedAt time.Time     `json:"generated_at"`
	OS          string        `json:"os"`
	Arch        string        `json:"arch"`
	Overall     string        `json:"overall"`
	Checks      []CheckResult `json:"checks"`
	GPUs        []GPU         `json:"gpus,omitempty"`
}

func RunDoctor

func RunDoctor(ctx context.Context, opts DoctorOptions) DoctorReport

type ExecRunner

type ExecRunner struct{}

func (ExecRunner) Run

func (ExecRunner) Run(ctx context.Context, name string, args ...string) ([]byte, error)

type GPU

type GPU struct {
	Name               string  `json:"name"`
	UUID               string  `json:"uuid"`
	VRAMTotalMB        int64   `json:"vram_total_mb"`
	DriverVersion      string  `json:"driver_version"`
	TemperatureC       int     `json:"temperature_c"`
	PowerDrawW         float64 `json:"power_draw_w"`
	PowerLimitW        float64 `json:"power_limit_w"`
	UtilizationPercent int     `json:"utilization_percent"`
}

func DetectNvidiaGPUs

func DetectNvidiaGPUs(ctx context.Context, runner CommandRunner) ([]GPU, error)

func ParseNvidiaSMICSV

func ParseNvidiaSMICSV(input string) ([]GPU, error)

Jump to

Keyboard shortcuts

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