debug

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountGPUs

func CountGPUs() int

CountGPUs returns number of Nvidia GPUs.

func GPUInfo

func GPUInfo()

GPUInfo prints out nvidia GPU information to console.

func GPUMemory

func GPUMemory(typeOpt ...string) (uint64, error)

GPUMemory returns specified memory information in MiB unit

`typeOpt`: type of memory info. Can be "used", "total", "free". Default="total"

func UsedCPUMem

func UsedCPUMem() float64

UsedRAM returns used-up RAM in MiB since last check.

func UsedGPUMem

func UsedGPUMem() float64

UsedGPUMem returns used-up GPU memory in MiB since last check. If error occurs, it will log to console and return -1.

Types

type Machine

type Machine struct {
	CPUMemTotal uint64
	CPUMemUsed  uint64

	GPUs        int // number of GPUs
	GPUMemTotal uint64
	GPUMemUsed  uint64
}

type SI

type SI struct {
	Uptime       time.Duration // time since boot
	Loads        [3]float64    // 1, 5, and 15 minute load averages, see e.g. UPTIME(1)
	Procs        uint64        // number of current processes
	TotalRam     uint64        // total usable main memory size [kB]
	FreeRam      uint64        // available memory size [kB]
	SharedRam    uint64        // amount of shared memory [kB]
	BufferRam    uint64        // memory used by buffers [kB]
	TotalSwap    uint64        // total swap space size [kB]
	FreeSwap     uint64        // swap space still available [kB]
	TotalHighRam uint64        // total high memory size [kB]
	FreeHighRam  uint64        // available high memory size [kB]
	// contains filtered or unexported fields
}

Go-ized http://man7.org/linux/man-pages/man2/sysinfo.2.html

Jump to

Keyboard shortcuts

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