ggml: Export GPU UUIDs

This enables matching up devices and information reported by the backend
with system management libraries such as nvml to get accurate free
memory reporting.
This commit is contained in:
Jesse Gross
2025-04-24 11:48:49 -07:00
committed by Jesse Gross
parent f15ffc4320
commit aaa7818000
6 changed files with 151 additions and 0 deletions

View File

@@ -124,6 +124,10 @@ type DeviceMemory struct {
// may not be persistent across instances of the runner.
Name string
// UUID is a unique persistent identifier for the device for matching
// with system management libraries
UUID string
// Weights is the per-layer memory needed for the model weights.
Weights []Memory
@@ -152,6 +156,10 @@ func (m DeviceMemory) LogValue() slog.Value {
attrs = append(attrs, slog.Any("Graph", m.Graph))
}
if len(attrs) > 0 && m.UUID != "" {
attrs = append([]slog.Attr{slog.String("UUID", m.UUID)}, attrs...)
}
return slog.GroupValue(attrs...)
}