Documentation ¶
Index ¶
- Constants
- Variables
- func CheckForGPUInfoFile() bool
- func GetGPUInfo() ([]byte, error)
- type GPUManager
- type NvidiaGPUManager
- func (n *NvidiaGPUManager) GetDevices() []*ecs.PlatformDevice
- func (n *NvidiaGPUManager) GetDriverVersion() string
- func (n *NvidiaGPUManager) GetGPUIDsUnsafe() []string
- func (n *NvidiaGPUManager) Initialize() error
- func (n *NvidiaGPUManager) SetDevices()
- func (n *NvidiaGPUManager) SetDriverVersion(version string)
- func (n *NvidiaGPUManager) SetGPUIDs(gpuIDs []string)
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 ¶
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
Click to show internal directories.
Click to hide internal directories.