hardware

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hardware detects the node's compute capability and produces the typesv1.CapabilityProfile sent at enrollment and in heartbeats.

Platform-specific probes live in build-tagged files (hw_darwin.go, hw_linux.go, hw_windows.go); this file holds the shared assembly.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is stamped by the linker (goreleaser) and reported in the profile.

Functions

func AccelPreference added in v0.6.0

func AccelPreference(p *typesv1.CapabilityProfile) []string

AccelPreference returns the ordered accelerator chain the runtime artifact fetcher should try for this profile: the native backend of each detected GPU, then vulkan when it is available for that GPU's vendor, then the CPU build. Always non-empty; BestAccel is its head.

func BestAccel

func BestAccel(p *typesv1.CapabilityProfile) string

BestAccel returns the accelerator backend the runtime artifact fetcher should prefer for this profile.

func BestVRAMMB

func BestVRAMMB(p *typesv1.CapabilityProfile) uint64

BestVRAMMB returns the largest detected GPU memory (system RAM on Apple Silicon's unified memory); 0 when no usable GPU was found.

func Detect

func Detect(ctx context.Context, dataDir string) (*typesv1.CapabilityProfile, error)

Detect probes the local machine. Failures of individual probes degrade gracefully (e.g. no GPU -> CPU-only profile) rather than failing detection.

func DiskFreeBytes added in v0.4.0

func DiskFreeBytes(path string) (uint64, error)

DiskFreeBytes reports free space for unprivileged writes on the volume holding path (the model store's "free" figure in /api/v1/status).

Types

type NVIDIAGPU added in v0.9.4

type NVIDIAGPU struct {
	Name          string
	DriverVersion string
	VRAMMB        uint64
	// ComputeCap is the CUDA compute capability ("8.9"); empty when the
	// driver does not report one.
	ComputeCap string
	// RunsCUDA is false only when the capability is known to be below what
	// the CUDA build needs.
	RunsCUDA bool
	// Warning is the same line detection logs for a card below the floor;
	// empty otherwise.
	Warning string
}

NVIDIAGPU is one NVIDIA card as its driver reports it, for diagnostics (`tera doctor`): what the capability profile cannot carry, and the operator-facing explanation when the published CUDA build cannot run on the card.

func ProbeNVIDIA added in v0.9.4

func ProbeNVIDIA(ctx context.Context) []NVIDIAGPU

ProbeNVIDIA asks the NVIDIA driver about its GPUs for diagnostics: the driver version, the compute capability when the driver reports it, and the explanation for a card the published CUDA build cannot run on. It logs nothing. Nil when there is no NVIDIA driver tool or no GPU.

Jump to

Keyboard shortcuts

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