brgpu

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Copyright 2024 Shanghai Biren Technology Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Shanghai Biren Technology Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Shanghai Biren Technology Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Shanghai Biren Technology Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Shanghai Biren Technology Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Shanghai Biren Technology Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	BirenVendorID = "1ee0"
)

Variables

View Source
var (
	CdiFeature         bool
	OverwriteCdiConfig bool
)
View Source
var (
	MountHostPath bool
)

Functions

func Allocate

func Allocate(g utils.Graph, mustIncludeNodes []string, size int) []string

func Device2Graph

func Device2Graph(devices []string) (*utils.Graph, error)

func NewBrGPUManager

func NewBrGPUManager(devDirectory string, gpuConfig GPUConfig) *brGPUManager

func PathExists

func PathExists(path string) (bool, error)

Types

type ContainerRuntime

type ContainerRuntime string
const (
	RuntimeKata ContainerRuntime = "kata"
	RuntimeRunc ContainerRuntime = "runc"
)

type DevicesInfo

type DevicesInfo struct {
	PhysicalNum int
	Instances   []Instance
	SVICount    int
}

type DevicesInfoList

type DevicesInfoList []DevicesInfo

func DeviceDiscover added in v0.7.3

func DeviceDiscover() (DevicesInfoList, error)

func (DevicesInfoList) AllCardIDs

func (d DevicesInfoList) AllCardIDs() []string

func (DevicesInfoList) FilterByName

func (d DevicesInfoList) FilterByName(resourceName string) DevicesInfoList

func (DevicesInfoList) ResourceNames

func (d DevicesInfoList) ResourceNames() []string

type GPUConfig

type GPUConfig struct {
	GPUPartitionSize string
}

GPUConfig stores the settings used to configure the GPUs on a node.

type Instance

type Instance struct {
	UUID         string
	Memory       int
	ResourceName string
	CardID       string
}

type Lister

type Lister struct {
	ResUpdateChan    chan dpm.PluginNameList
	Heartbeat        chan bool
	MountAllDevice   bool
	MountDriDevice   bool
	DevicesInfoList  DevicesInfoList
	PFDeviceInfoList PFDeviceInfoList
	Runtime          string
	MountHostPath    bool
}

func (*Lister) Discover

func (l *Lister) Discover(pluginListCh chan dpm.PluginNameList)

func (*Lister) GetResourceNamespace

func (l *Lister) GetResourceNamespace() string

func (*Lister) NewPlugin

func (l *Lister) NewPlugin(resourceLastName string) dpm.PluginInterface

type MountPath

type MountPath struct {
	HostPath      string
	ContainerPath string
}

type PFDeviceInfo

type PFDeviceInfo struct {
	Addr    string
	VFs     []VFDeviceInfo
	VFCount int
}

type PFDeviceInfoList

type PFDeviceInfoList []PFDeviceInfo

func (PFDeviceInfoList) Contain

func (p PFDeviceInfoList) Contain(pciaddr string) bool

func (PFDeviceInfoList) FilterByName

func (p PFDeviceInfoList) FilterByName(resourceName string) PFDeviceInfoList

func (PFDeviceInfoList) ResourceNames

func (p PFDeviceInfoList) ResourceNames() []string

type Plugin

type Plugin struct {
	PFDevices PFDeviceInfoList
	BRGPUs    DevicesInfoList
	Runtime   string
	Heartbeat chan bool

	MountAllDevice bool
	MountDriDevice bool
	MountHostPath  bool
	TopoGraph      *utils.Graph
	// contains filtered or unexported fields
}

func (*Plugin) Allocate

func (*Plugin) GetDevicePluginOptions

func (p *Plugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)

func (*Plugin) GetNumaNode

func (d *Plugin) GetNumaNode(idx int) (bool, int, error)

func (*Plugin) ListAndWatch

func (*Plugin) Start

func (p *Plugin) Start() error

func (*Plugin) Stop

func (p *Plugin) Stop() error

type VFDeviceInfo

type VFDeviceInfo struct {
	DeviceID     string
	IOMMUGroup   string
	Addr         string
	ResourceName string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL