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 ¶
- Variables
- func AccelPreference(p *typesv1.CapabilityProfile) []string
- func BestAccel(p *typesv1.CapabilityProfile) string
- func BestVRAMMB(p *typesv1.CapabilityProfile) uint64
- func Detect(ctx context.Context, dataDir string) (*typesv1.CapabilityProfile, error)
- func DiskFreeBytes(path string) (uint64, error)
- type NVIDIAGPU
Constants ¶
This section is empty.
Variables ¶
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 ¶
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
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
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.