gpu

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GPUInfoDirPath is the directory where gpus and driver info are saved
	GPUInfoDirPath = "/var/lib/ecs/gpu"
	// NvidiaGPUInfoFilePath is the file path where gpus and driver info are saved
	NvidiaGPUInfoFilePath = GPUInfoDirPath + "/nvidia-gpu-info.json"
)

Variables

View Source
var GPUInfoFileExists = CheckForGPUInfoFile
View Source
var GetGPUInfoJSON = GetGPUInfo

Functions

func CheckForGPUInfoFile

func CheckForGPUInfoFile() bool

func GetGPUInfo

func GetGPUInfo() ([]byte, error)

Types

type GPUManager

type GPUManager interface {
	Initialize() error
	SetGPUIDs([]string)
	GetGPUIDsUnsafe() []string
	SetDevices()
	GetDevices() []*ecs.PlatformDevice
	SetDriverVersion(string)
	GetDriverVersion() string
}

GPUManager encompasses methods to get information on GPUs and their driver

func NewNvidiaGPUManager

func NewNvidiaGPUManager() GPUManager

NewNvidiaGPUManager is used to obtain NvidiaGPUManager handle

type NvidiaGPUManager

type NvidiaGPUManager struct {
	DriverVersion string                `json:"DriverVersion"`
	GPUIDs        []string              `json:"GPUIDs"`
	GPUDevices    []*ecs.PlatformDevice `json:"-"`
	// contains filtered or unexported fields
}

NvidiaGPUManager is used as a wrapper for NVML APIs and implements GPUManager interface

func (*NvidiaGPUManager) GetDevices

func (n *NvidiaGPUManager) GetDevices() []*ecs.PlatformDevice

GetDevices returns the GPU devices as PlatformDevices

func (*NvidiaGPUManager) GetDriverVersion

func (n *NvidiaGPUManager) GetDriverVersion() string

GetDriverVersion is a getter for nvidia driver version

func (*NvidiaGPUManager) GetGPUIDsUnsafe

func (n *NvidiaGPUManager) GetGPUIDsUnsafe() []string

GetGPUIDs returns the GPUIDs

func (*NvidiaGPUManager) Initialize

func (n *NvidiaGPUManager) Initialize() error

Initialize sets the fields of Nvidia GPU Manager struct

func (*NvidiaGPUManager) SetDevices

func (n *NvidiaGPUManager) SetDevices()

func (*NvidiaGPUManager) SetDriverVersion

func (n *NvidiaGPUManager) SetDriverVersion(version string)

SetDriverVersion is a setter for nvidia driver version

func (*NvidiaGPUManager) SetGPUIDs

func (n *NvidiaGPUManager) SetGPUIDs(gpuIDs []string)

SetGPUIDs sets the GPUIDs

Directories

Path Synopsis
Package mock_gpu is a generated GoMock package.
Package mock_gpu is a generated GoMock package.

Jump to

Keyboard shortcuts

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