Documentation
¶
Overview ¶
Package memory tracks the NVIDIA per-GPU memory usage.
Index ¶
Constants ¶
View Source
const Name = "accelerator-nvidia-memory"
View Source
const SubSystem = "accelerator_nvidia_memory"
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(gpudInstance *components.GPUdInstance) (components.Component, error)
Types ¶
type GetVirtualMemoryFunc ¶ added in v0.9.0
type GetVirtualMemoryFunc func(context.Context) (*gopsutilmem.VirtualMemoryStat, error)
GetVirtualMemoryFunc is the function type for getting virtual memory stats. This allows for dependency injection in tests.
type Memory ¶ added in v0.9.0
type Memory struct {
// Represents the GPU UUID.
UUID string `json:"uuid"`
// BusID is the GPU bus ID from the nvml API.
// e.g., "0000:0f:00.0"
BusID string `json:"bus_id"`
TotalBytes uint64 `json:"total_bytes"`
TotalHumanized string `json:"total_humanized"`
ReservedBytes uint64 `json:"reserved_bytes"`
ReservedHumanized string `json:"reserved_humanized"`
UsedBytes uint64 `json:"used_bytes"`
UsedHumanized string `json:"used_humanized"`
FreeBytes uint64 `json:"free_bytes"`
FreeHumanized string `json:"free_humanized"`
UsedPercent string `json:"used_percent"`
// Supported is true if the memory is supported by the device.
Supported bool `json:"supported"`
// IsUnifiedMemory is true when the GPU uses unified memory architecture
// (shared CPU/GPU memory) and traditional NVML memory APIs are not supported.
// In this case, system memory values are reported instead.
// ref. https://docs.nvidia.com/dgx/dgx-spark/known-issues.html
IsUnifiedMemory bool `json:"is_unified_memory"`
}
func (Memory) GetUsedPercent ¶ added in v0.9.0
Click to show internal directories.
Click to hide internal directories.