Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteEventSet(es EventSet)
- func GetCudaDriverVersion() (*uint, *uint, error)
- func GetDeviceCount() (uint, error)
- func GetDriverVersion() (string, error)
- func Init() error
- func ParseMigDeviceUUID(uuid string) (string, uint, uint, error)
- func RegisterEvent(es EventSet, event int) error
- func RegisterEventForDevice(es EventSet, event int, uuid string) error
- func Shutdown() error
- type Accounting
- type ClockInfo
- type ComputeInstance
- type ComputeInstanceInfo
- type ComputeInstanceProfileInfo
- type CudaComputeCapabilityInfo
- type Device
- func (d *Device) CreateGPUInstance(profileInfo *GPUInstanceProfileInfo) (gpuInstance GPUInstance, err error)
- func (d *Device) GPUInstanceRemainingCapacity(profileInfo *GPUInstanceProfileInfo) (count int, err error)
- func (d *Device) GetAllRunningProcesses() ([]ProcessInfo, error)
- func (d *Device) GetAttributes() (attr DeviceAttributes, err error)
- func (d *Device) GetComputeInstanceId() (id int, err error)
- func (d *Device) GetComputeRunningProcesses() ([]uint, []uint64, error)
- func (d *Device) GetDeviceHandleFromMigDeviceHandle() (device *Device, err error)
- func (d *Device) GetDeviceMode() (mode *DeviceMode, err error)
- func (d *Device) GetGPUInstanceByID(id int) (gpuInstance GPUInstance, err error)
- func (d *Device) GetGPUInstanceId() (id int, err error)
- func (d *Device) GetGPUInstancePossiblePlacements(profileInfo *GPUInstanceProfileInfo) (placement GPUInstancePlacement, count int, err error)
- func (d *Device) GetGPUInstanceProfileInfo(profile int) (profileInfo GPUInstanceProfileInfo, err error)
- func (d *Device) GetGPUInstances(profileInfo *GPUInstanceProfileInfo) (gpuInstances []GPUInstance, err error)
- func (d *Device) GetGraphicsRunningProcesses() ([]uint, []uint64, error)
- func (d *Device) GetMaxMigDeviceCount() (count int, err error)
- func (d *Device) GetMigDeviceHandleByIndex(index int) (migDevice *Device, err error)
- func (d *Device) GetMigDevices() ([]*Device, error)
- func (d *Device) GetMigMode() (currentMode, pendingMode int, err error)
- func (d *Device) GetMigParentDevice() (*Device, error)
- func (d *Device) GetMigParentDeviceLite() (*Device, error)
- func (d *Device) IsMigDeviceHandle() (isMigDevice bool, err error)
- func (d *Device) IsMigEnabled() (bool, error)
- func (d *Device) SetMigMode(mode int) (activationStatus error, err error)
- func (d *Device) Status() (status *DeviceStatus, err error)
- type DeviceAttributes
- type DeviceMemory
- type DeviceMode
- type DeviceStatus
- type Display
- type ECCErrorsInfo
- type Event
- type EventSet
- type GPUInstance
- func (g *GPUInstance) ComputeInstanceRemainingCapacity(profileInfo *GPUInstanceProfileInfo) (count int, err error)
- func (g *GPUInstance) CreateComputeInstance(profileInfo *ComputeInstanceProfileInfo) (computeInstance ComputeInstance, err error)
- func (g *GPUInstance) Destroy() (err error)
- func (g *GPUInstance) GetComputeInstanceByID(id int) (computeInstance ComputeInstance, err error)
- func (g *GPUInstance) GetComputeInstanceProfileInfo(profile int, engProfile int) (profileInfo ComputeInstanceProfileInfo, err error)
- func (g *GPUInstance) GetComputeInstances(profileInfo *ComputeInstanceProfileInfo) (computeInstances []ComputeInstance, err error)
- func (g *GPUInstance) GetInfo() (info GPUInstanceInfo, err error)
- type GPUInstanceInfo
- type GPUInstancePlacement
- type GPUInstanceProfileInfo
- type MemoryInfo
- type ModeState
- type P2PLink
- type P2PLinkType
- type PCIInfo
- type PCIStatusInfo
- type PCIThroughputInfo
- type PerfState
- type ProcessInfo
- type ProcessType
- type ThrottleReason
- type UtilizationInfo
Constants ¶
const ( DEVICE_MIG_DISABLE = C.NVML_DEVICE_MIG_DISABLE DEVICE_MIG_ENABLE = C.NVML_DEVICE_MIG_ENABLE )
Enable or disable MIG mode
const ( GPU_INSTANCE_PROFILE_1_SLICE = C.NVML_GPU_INSTANCE_PROFILE_1_SLICE GPU_INSTANCE_PROFILE_2_SLICE = C.NVML_GPU_INSTANCE_PROFILE_2_SLICE GPU_INSTANCE_PROFILE_3_SLICE = C.NVML_GPU_INSTANCE_PROFILE_3_SLICE GPU_INSTANCE_PROFILE_4_SLICE = C.NVML_GPU_INSTANCE_PROFILE_4_SLICE GPU_INSTANCE_PROFILE_7_SLICE = C.NVML_GPU_INSTANCE_PROFILE_7_SLICE GPU_INSTANCE_PROFILE_COUNT = C.NVML_GPU_INSTANCE_PROFILE_COUNT )
GPU Instance Profiles
const ( COMPUTE_INSTANCE_PROFILE_1_SLICE = C.NVML_COMPUTE_INSTANCE_PROFILE_1_SLICE COMPUTE_INSTANCE_PROFILE_2_SLICE = C.NVML_COMPUTE_INSTANCE_PROFILE_2_SLICE COMPUTE_INSTANCE_PROFILE_3_SLICE = C.NVML_COMPUTE_INSTANCE_PROFILE_3_SLICE COMPUTE_INSTANCE_PROFILE_4_SLICE = C.NVML_COMPUTE_INSTANCE_PROFILE_4_SLICE COMPUTE_INSTANCE_PROFILE_7_SLICE = C.NVML_COMPUTE_INSTANCE_PROFILE_7_SLICE COMPUTE_INSTANCE_PROFILE_COUNT = C.NVML_COMPUTE_INSTANCE_PROFILE_COUNT )
Compute Instance Profiles
const ( COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED = C.NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT = C.NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT )
Compute Instance Engine Profiles
const ( PerfStateMax = 0 PerfStateMin = 15 PerfStateUnknown = 32 )
const (
XidCriticalError = C.nvmlEventTypeXidCriticalError
)
Variables ¶
Functions ¶
func DeleteEventSet ¶
func DeleteEventSet(es EventSet)
func GetCudaDriverVersion ¶
func GetDeviceCount ¶
func GetDriverVersion ¶
func RegisterEvent ¶
func RegisterEventForDevice ¶
Types ¶
type Accounting ¶
type ComputeInstance ¶
type ComputeInstance struct {
// contains filtered or unexported fields
}
Opaque ComputeInstance type
func (*ComputeInstance) Destroy ¶
func (c *ComputeInstance) Destroy() (err error)
ComputeInstance.Destroy()
func (*ComputeInstance) GetInfo ¶
func (c *ComputeInstance) GetInfo() (info ComputeInstanceInfo, err error)
ComputeInstance.GetInfo()
type ComputeInstanceInfo ¶
type ComputeInstanceInfo struct { Device *Device GPUInstance GPUInstance ID uint32 ProfileID uint32 }
type ComputeInstanceInfo C.nvmlComputeInstanceInfo_t Generated using `go tool cgo -godefs mig.go`
type ComputeInstanceProfileInfo ¶
type ComputeInstanceProfileInfo struct { ID uint32 SliceCount uint32 InstanceCount uint32 MultiprocessorCount uint32 }
type ComputeInstanceProfileInfo C.nvmlComputeInstanceProfileInfo_t Generated using `go tool cgo -godefs mig.go`
type Device ¶
type Device struct { UUID string Path string Model *string Power *uint Memory *uint64 CPUAffinity *uint PCI PCIInfo Clocks ClockInfo Topology []P2PLink CudaComputeCapability CudaComputeCapabilityInfo // contains filtered or unexported fields }
func NewDeviceByUUID ¶
func NewDeviceLite ¶
func NewDeviceLiteByUUID ¶
func (*Device) CreateGPUInstance ¶
func (d *Device) CreateGPUInstance(profileInfo *GPUInstanceProfileInfo) (gpuInstance GPUInstance, err error)
Device.CreateGPUInstance()
func (*Device) GPUInstanceRemainingCapacity ¶
func (d *Device) GPUInstanceRemainingCapacity(profileInfo *GPUInstanceProfileInfo) (count int, err error)
Device.GPUInstanceRemainingCapacity()
func (*Device) GetAllRunningProcesses ¶
func (d *Device) GetAllRunningProcesses() ([]ProcessInfo, error)
func (*Device) GetAttributes ¶
func (d *Device) GetAttributes() (attr DeviceAttributes, err error)
Device.GetAttributes()
func (*Device) GetComputeInstanceId ¶
Device.GetComputeInstanceId()
func (*Device) GetComputeRunningProcesses ¶
func (*Device) GetDeviceHandleFromMigDeviceHandle ¶
Device.GetMigDeviceHandleByIndex()
func (*Device) GetDeviceMode ¶
func (d *Device) GetDeviceMode() (mode *DeviceMode, err error)
func (*Device) GetGPUInstanceByID ¶
func (d *Device) GetGPUInstanceByID(id int) (gpuInstance GPUInstance, err error)
Device.GetGPUInstanceByID()
func (*Device) GetGPUInstanceId ¶
Device.GetGPUInstanceId()
func (*Device) GetGPUInstancePossiblePlacements ¶
func (d *Device) GetGPUInstancePossiblePlacements(profileInfo *GPUInstanceProfileInfo) (placement GPUInstancePlacement, count int, err error)
Device.GetGPUInstancePossiblePlacements()
func (*Device) GetGPUInstanceProfileInfo ¶
func (d *Device) GetGPUInstanceProfileInfo(profile int) (profileInfo GPUInstanceProfileInfo, err error)
Device.GetGPUInstanceProfileInfo()
func (*Device) GetGPUInstances ¶
func (d *Device) GetGPUInstances(profileInfo *GPUInstanceProfileInfo) (gpuInstances []GPUInstance, err error)
Device.GetGPUInstances()
func (*Device) GetGraphicsRunningProcesses ¶
func (*Device) GetMaxMigDeviceCount ¶
Device.GetMaxMigDeviceCount()
func (*Device) GetMigDeviceHandleByIndex ¶
Device.GetMigDeviceHandleByIndex()
func (*Device) GetMigDevices ¶
func (*Device) GetMigMode ¶
Device.GetMigMode()
func (*Device) GetMigParentDevice ¶
func (*Device) GetMigParentDeviceLite ¶
func (*Device) IsMigDeviceHandle ¶
Device.IsMigDeviceHandle()
func (*Device) IsMigEnabled ¶
func (*Device) SetMigMode ¶
Device.SetMigMode()
func (*Device) Status ¶
func (d *Device) Status() (status *DeviceStatus, err error)
type DeviceAttributes ¶
type DeviceAttributes struct { MultiprocessorCount uint32 GpuInstanceSliceCount uint32 ComputeInstanceSliceCount uint32 MemorySizeMB uint64 }
type DeviceAttributes C.nvmlDeviceAttributes_t Generated using `go tool cgo -godefs mig.go`
type DeviceMemory ¶
type DeviceMode ¶
type DeviceMode struct { DisplayInfo Display Persistence ModeState AccountingInfo Accounting }
type DeviceStatus ¶
type DeviceStatus struct { Power *uint FanSpeed *uint Temperature *uint Utilization UtilizationInfo Memory MemoryInfo Clocks ClockInfo PCI PCIStatusInfo Processes []ProcessInfo Throttle ThrottleReason Performance PerfState }
type ECCErrorsInfo ¶
type Event ¶
type EventSet ¶
type EventSet struct {
// contains filtered or unexported fields
}
func NewEventSet ¶
func NewEventSet() EventSet
type GPUInstance ¶
type GPUInstance struct {
// contains filtered or unexported fields
}
Opaque GPUInstance type
func (*GPUInstance) ComputeInstanceRemainingCapacity ¶
func (g *GPUInstance) ComputeInstanceRemainingCapacity(profileInfo *GPUInstanceProfileInfo) (count int, err error)
GPUInstance.ComputeInstanceRemainingCapacity()
func (*GPUInstance) CreateComputeInstance ¶
func (g *GPUInstance) CreateComputeInstance(profileInfo *ComputeInstanceProfileInfo) (computeInstance ComputeInstance, err error)
GPUInstance.CreateComputeInstance()
func (*GPUInstance) GetComputeInstanceByID ¶
func (g *GPUInstance) GetComputeInstanceByID(id int) (computeInstance ComputeInstance, err error)
GPUInstance.GetComputeInstanceByID()
func (*GPUInstance) GetComputeInstanceProfileInfo ¶
func (g *GPUInstance) GetComputeInstanceProfileInfo(profile int, engProfile int) (profileInfo ComputeInstanceProfileInfo, err error)
GPUInstance.GetComputeInstanceProfileInfo()
func (*GPUInstance) GetComputeInstances ¶
func (g *GPUInstance) GetComputeInstances(profileInfo *ComputeInstanceProfileInfo) (computeInstances []ComputeInstance, err error)
GPUInstance.GetComputeInstances()
func (*GPUInstance) GetInfo ¶
func (g *GPUInstance) GetInfo() (info GPUInstanceInfo, err error)
GPUInstance.GetInfo()
type GPUInstanceInfo ¶
type GPUInstanceInfo struct { Device *Device ID uint32 ProfileID uint32 Placement GPUInstancePlacement }
type GPUInstanceInfo_t C.nvmlGpuInstanceInfo_t Generated using `go tool cgo -godefs mig.go`
type GPUInstancePlacement ¶
type GPUInstancePlacement C.nvmlGpuInstancePlacement_t Generated using `go tool cgo -godefs mig.go`
type GPUInstanceProfileInfo ¶
type GPUInstanceProfileInfo struct { ID uint32 IsP2pSupported uint32 SliceCount uint32 InstanceCount uint32 MultiprocessorCount uint32 CopyEngineCount uint32 DecoderCount uint32 EncoderCount uint32 JpegCount uint32 OfaCount uint32 MemorySizeMB uint64 }
type GPUInstanceProfileInfo C.nvmlGpuInstanceProfileInfo_t Generated using `go tool cgo -godefs mig.go`
type MemoryInfo ¶
type MemoryInfo struct { Global DeviceMemory ECCErrors ECCErrorsInfo }
type P2PLink ¶
type P2PLink struct { BusID string Link P2PLinkType }
type P2PLinkType ¶
type P2PLinkType uint
const ( P2PLinkUnknown P2PLinkType = iota P2PLinkCrossCPU P2PLinkSameCPU P2PLinkHostBridge P2PLinkMultiSwitch P2PLinkSingleSwitch P2PLinkSameBoard SingleNVLINKLink TwoNVLINKLinks ThreeNVLINKLinks FourNVLINKLinks FiveNVLINKLinks SixNVLINKLinks SevenNVLINKLinks EightNVLINKLinks NineNVLINKLinks TenNVLINKLinks ElevenNVLINKLinks TwelveNVLINKLinks )
func GetNVLink ¶
func GetNVLink(dev1, dev2 *Device) (link P2PLinkType, err error)
func GetP2PLink ¶
func GetP2PLink(dev1, dev2 *Device) (link P2PLinkType, err error)
func (P2PLinkType) String ¶
func (t P2PLinkType) String() string
type PCIStatusInfo ¶
type PCIStatusInfo struct { BAR1Used *uint64 Throughput PCIThroughputInfo }
type PCIThroughputInfo ¶
type ProcessInfo ¶
type ProcessInfo struct { PID uint Name string MemoryUsed uint64 Type ProcessType }
type ProcessType ¶
type ProcessType uint
const ( Compute ProcessType = iota Graphics ComputeAndGraphics )
func (ProcessType) String ¶
func (t ProcessType) String() string
type ThrottleReason ¶
type ThrottleReason uint
const ( ThrottleReasonGpuIdle ThrottleReason = iota ThrottleReasonApplicationsClocksSetting ThrottleReasonSwPowerCap ThrottleReasonHwSlowdown ThrottleReasonSyncBoost ThrottleReasonSwThermalSlowdown ThrottleReasonHwThermalSlowdown ThrottleReasonHwPowerBrakeSlowdown ThrottleReasonDisplayClockSetting ThrottleReasonNone ThrottleReasonUnknown )
func (ThrottleReason) String ¶
func (r ThrottleReason) String() string