Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetBinaryPath ¶ added in v1.0.3
func SetBinaryPath(path string)
SetBinaryPath set the path of nvidia-smi
Types ¶
type GPU ¶
type GPU struct { // Zero based index of the GPU. Can change at each boot. Index string `json:"index"` // This value is the globally unique immutable alphanumeric identifier of the GPU. // It does not correspond to any physical label on the board. UUID string `json:"uuid"` // Percent of time over the past sample period during which one or more kernels was executing on the GPU. // The sample period may be between 1 second and 1/6 second depending on the product. UtilizationGPU string `json:"utilizationGPU"` // Total installed GPU memory. units, MiB MemoryTotal string `json:"memoryTotal"` // Total memory allocated by active contexts. units, MiB MemoryUsed string `json:"memoryUsed"` // Total free memory. units, MiB MemoryFree string `json:"memoryFree"` // The version of the installed NVIDIA display driver. // This is an alphanumeric string. DriverVersion string `json:"driverVersion"` // The official product name of the GPU. This is an alphanumeric string Name string `json:"name"` // This number matches the serial number physically printed on each board. It is a globally unique immutable alphanumeric value. Serial string `json:"serial"` // The last measured power draw for the entire board, in watts. // On Ampere or newer devices, returns average power draw over 1 sec. // On older devices, returns instantaneous power draw. Only available if power management is supported. // This reading is accurate to within +/- 5 watts. PowerDraw string `json:"powerDraw"` // The software power limit in watts. Set by software like nvidia-smi. // On Kepler devices Power Limit can be adjusted using [-pl | --power-limit=] switches. PowerLimit string `json:"powerLimit"` // Core GPU temperature. in degrees C. Temperature string `json:"temperature"` // The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec". Timestamp string `json:"timestamp"` }
GPU information
type GPUComputeApp ¶
type GPUComputeApp struct { // The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec". Timestamp string `json:"timestamp"` // The official product name of the GPU. // This is an alphanumeric string. For all products. Name string `json:"name"` // This value is the globally unique immutable alphanumeric identifier of the GPU. // It does not correspond to any physical label on the board. UUID string `json:"uuid"` // Process ID of the compute application PID string `json:"pid"` // Process Name ProcessName string `json:"processName"` // Amount memory used on the device by the context. // Not available on Windows when running in WDDM mode because Windows KMD manages all the memory not NVIDIA driver. UsedMemory string `json:"usedMemory"` }
GPUComputeApp processes having compute context on the device.
func GetProcesses ¶
func GetProcesses(ctx context.Context, indexOrUUIDs ...string) (result []GPUComputeApp, err error)
GetProcesses returns processes having compute context on the device Note: if no processes running, empty result return
func (*GPUComputeApp) String ¶
func (c *GPUComputeApp) String() string
Click to show internal directories.
Click to hide internal directories.