gpuinfo

package
v0.0.0-...-30e6a6e Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2012 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PollGPUMemory

func PollGPUMemory() chan GPU

Returns a GPU{} struct every ~1s, or blocks indefinitely if there is no known way to get the spare GPU memory information. Polling is terminated by calling close() on the channel

func PollNvidiaGPUMemory

func PollNvidiaGPUMemory() chan GPU

Types

type ChannelWriter

type ChannelWriter struct {
	// contains filtered or unexported fields
}

func (*ChannelWriter) Write

func (cw *ChannelWriter) Write(content []byte) (n int, err error)

type GPU

type GPU interface {
	Total() int
	Used() int
	Free() int
	String() string
}

type NVGpu

type NVGpu struct {
	MemTotal string `xml:"memory_usage>total"`
	MemUsed  string `xml:"memory_usage>used"`
	MemFree  string `xml:"memory_usage>free"`
}

func (NVGpu) Free

func (g NVGpu) Free() int

func (NVGpu) Total

func (g NVGpu) Total() int

func (NVGpu) Used

func (g NVGpu) Used() int

type NVResult

type NVResult struct {
	Gpus []NVGpu `xml:"gpu"`
}

func Parse

func Parse(x []byte) NVResult

func (NVResult) Free

func (v NVResult) Free() int

func (NVResult) String

func (v NVResult) String() string

func (NVResult) Total

func (v NVResult) Total() int

func (NVResult) Used

func (v NVResult) Used() int

Jump to

Keyboard shortcuts

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