gpu

package
v1.52.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 7 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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