Documentation
¶
Index ¶
- Variables
- func Marshal(d Device) *sonm.GPUDevice
- func MarshalDevices(d []Device) []*sonm.GPUDevice
- func WithOpenClDeviceVersion(version string) func(*sonm.GPUDevice) error
- func WithOpenClDeviceVersionSpec(major, minor int32) func(*sonm.GPUDevice) error
- func WithVendorId(id uint) func(*sonm.GPUDevice) error
- type Device
- func GetGPUDevices() ([]Device, error)
- func GetGPUDevicesUsingOpenCL() ([]Device, error)
- func NewDevice(name, vendorName string, maxClockFrequency, maxMemorySize uint64, ...) (Device, error)
- func Unmarshal(proto *sonm.GPUDevice) (Device, error)
- func UnmarshalDevices(d []*sonm.GPUDevice) ([]Device, error)
- type Option
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedPlatform = errors.New("the platform is not currently supported to expose GPU devices")
)
View Source
var Nvidias = []uint64{
4318,
}
View Source
var Radeons = []uint64{
4098,
16915456,
}
Functions ¶
func MarshalDevices ¶
func MarshalDevices(d []Device) []*sonm.GPUDevice
func WithOpenClDeviceVersion ¶
WithOpenClDeviceVersion option sets OpenCL version.
The format must be: `OpenCL <major.minor> <vendor-specific information>`.
func WithVendorId ¶
Types ¶
type Device ¶
type Device interface { // Name returns GPU model name. Name() string // VendorId returns an unique device vendor identifier. An example of a // unique device identifier could be the PCIe ID. VendorId() uint // VendorName returns GPU vendor name. VendorName() string // VendorType returns GPU vendor type. could be nvidia, radeon or none VendorType() sonm.GPUVendorType // MaxMemorySize returns the total maximum memory size the device can hold // in bytes. MaxMemorySize() uint64 // MaxClockFrequency returns maximum configured clock frequency of the // device in MHz. MaxClockFrequency() uint // OpenCLDeviceVersionMajor returns the OpenCL major version supported by the // device. OpenCLDeviceVersionMajor() int // OpenCLDeviceVersionMinor returns the OpenCL minor version supported by the // device. OpenCLDeviceVersionMinor() int Hash() []byte }
Device describes a GPU device.
func GetGPUDevices ¶
GetGPUDevices returns a list of available GPU devices on the machine.
func UnmarshalDevices ¶
Click to show internal directories.
Click to hide internal directories.