Documentation
¶
Index ¶
Constants ¶
const GBtoMB = 1024
GBtoMB is a conversion constant from GB to MB (1 GB = 1024 MB)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComputeInstance ¶
type ComputeInstance struct {
mock.ComputeInstance
Info nvml.ComputeInstanceInfo
}
ComputeInstance provides a reusable compute instance implementation
func NewComputeInstanceFromInfo ¶
func NewComputeInstanceFromInfo(info nvml.ComputeInstanceInfo) *ComputeInstance
NewComputeInstanceFromInfo creates a new compute instance
func (*ComputeInstance) SetMockFuncs ¶
func (ci *ComputeInstance) SetMockFuncs()
SetMockFuncs configures all the mock function implementations for the compute instance
type CudaComputeCapability ¶
CudaComputeCapability represents CUDA compute capability
type Device ¶
type Device struct {
mock.Device
sync.RWMutex
Config gpus.Config // Embedded configuration
UUID string
PciBusID string
Minor int
Index int
MigMode int
GpuInstances map[*GpuInstance]struct{}
GpuInstanceCounter uint32
MemoryInfo nvml.Memory
}
Device provides a reusable device implementation
func NewDeviceFromConfig ¶
NewDeviceFromConfig creates a new device from the provided GPU configuration
func (*Device) SetMockFuncs ¶
func (d *Device) SetMockFuncs()
SetMockFuncs configures all the mock function implementations for the device
type GpuInstance ¶
type GpuInstance struct {
mock.GpuInstance
sync.RWMutex
Info nvml.GpuInstanceInfo
ComputeInstances map[*ComputeInstance]struct{}
ComputeInstanceCounter uint32
MIGProfiles gpus.MIGProfileConfig
}
GpuInstance provides a reusable GPU instance implementation
func NewGpuInstanceFromInfo ¶
func NewGpuInstanceFromInfo(info nvml.GpuInstanceInfo, profiles gpus.MIGProfileConfig) *GpuInstance
NewGpuInstanceFromInfo creates a new GPU instance
func (*GpuInstance) SetMockFuncs ¶
func (gi *GpuInstance) SetMockFuncs()
SetMockFuncs configures all the mock function implementations for the GPU instance
type Option ¶
type Option func(*options) error
func WithCUDADriverVersion ¶
TODO: Add a string implementation using generics
func WithDriverVersion ¶
func WithNVMLVersion ¶
type Server ¶
type Server struct {
mock.Interface
mock.ExtendedInterface
Devices []nvml.Device
DriverVersion string
NvmlVersion string
CudaDriverVersion int
}
Server provides a reusable server implementation
func NewServerWithGPUs ¶
func NewServerWithGPUs(driverVersion, nvmlVersion string, cudaDriverVersion int, gpuConfigs ...gpus.Config) *Server
NewServerWithGPUs creates a new server with heterogeneous GPU configurations
func (*Server) SetMockFuncs ¶
func (s *Server) SetMockFuncs()
SetMockFuncs configures all the mock function implementations for the server