Documentation
¶
Index ¶
- Constants
- Variables
- func GpuModeLabel(mode string) string
- func RemoveAllNodeGpuLabels(ctx context.Context, client kubernetes.Interface) error
- func SetNodeGpuModeLabel(ctx context.Context, client kubernetes.Interface, mode string, ...) error
- type CheckGpuStatus
- type CheckWslGPU
- type ConfigureContainerdRuntime
- type ContainerdInstalled
- type CudaInstalled
- type CudaNotInstalled
- type CurrentNodeInK8s
- type DisableNouveauModule
- type GPUEnablePrepare
- type GpuDevicePluginInstalled
- type InstallContainerToolkitModule
- type InstallCudaDriver
- type InstallDriversModule
- type InstallNvidiaContainerToolkit
- type InstallPlugin
- type InstallPluginModule
- type NodeLabelingModule
- type NodeUnlabelingModule
- type NvidiaGraphicsCard
- type PatchK3sDriver
- type PrintGpuStatus
- type PrintPluginsStatus
- type RemoveContainerRuntimeConfig
- type RemoveNodeLabels
- type RestartContainerdModule
- type RestartK3sServiceModule
- type RestartPlugin
- type UninstallCudaModule
- type UninstallNvidiaDrivers
- type UpdateNodeGPUInfo
- type UpdateNvidiaContainerToolkitSource
- type WriteNouveauBlacklist
Constants ¶
const ( CPUType = "cpu" // force to use CPU, no GPU NvidiaCardType = "nvidia" // discrete NVIDIA card, handled by HAMi GB10ChipType = "nvidia-gb10" // NVIDIA GB10 Superchip & unified system memory AppleMChipType = "apple-m" // Apple M-series SoC IntelType = "intel" // Intel integrated GPU (unified memory) AMDType = "amd" // AMD integrated GPU (Ryzen AI Max) IntelGpuType = "intel-gpu" // Intel discrete GPU (not handled yet) AmdGpuType = "amd-gpu" // AMD discrete GPU (not handled yet) MooreSocType = "moore-soc" // Moore Threads SoC )
const (
GpuLabelGroup = "gpu.bytetrade.io"
)
Variables ¶
var ( GpuDriverLabel = GpuLabelGroup + "/driver" GpuCudaLabel = GpuLabelGroup + "/cuda" GpuCudaSupportedLabel = GpuLabelGroup + "/cuda-supported" // GpuType is the legacy single-value node label (gpu.bytetrade.io/type). // olares-cli no longer writes it: a node's supported modes are now // advertised through the existence-based per-mode labels returned by // GpuModeLabel. It is still cleaned up on unlabel so stale values left by // older installs don't linger. GpuType = GpuLabelGroup + "/type" )
var AllGpuModeTypes = []string{ NvidiaCardType, GB10ChipType, AppleMChipType, IntelType, AMDType, IntelGpuType, AmdGpuType, MooreSocType, }
AllGpuModeTypes is the set of non-cpu modes olares-cli knows how to label a node with. It is used to strip every per-mode label on unlabel. cpu is never labeled — every node implicitly supports cpu workloads.
Functions ¶
func GpuModeLabel ¶
GpuModeLabel returns the existence-based per-mode node label key for a mode, e.g. GpuModeLabel(NvidiaCardType) == "gpu.bytetrade.io/nvidia". A node supports the mode iff it carries this label (value is "true"); a node may carry several at once.
func RemoveAllNodeGpuLabels ¶
func RemoveAllNodeGpuLabels(ctx context.Context, client kubernetes.Interface) error
RemoveAllNodeGpuLabels strips every gpu.bytetrade.io GPU label from the current node: the driver / cuda / cuda-supported labels, all per-mode existence labels (gpu.bytetrade.io/<mode>), and the legacy gpu.bytetrade.io/type label.
func SetNodeGpuModeLabel ¶
func SetNodeGpuModeLabel(ctx context.Context, client kubernetes.Interface, mode string, driver, cuda, cudaSupported *string) error
SetNodeGpuModeLabel marks the current node as supporting `mode` by setting the existence label gpu.bytetrade.io/<mode>=true. The write is additive: labels for other modes the node already advertises are left untouched, so a node with several accelerators (e.g. nvidia + intel) accumulates one label per mode. The optional driver / cuda / cudaSupported values refresh the corresponding gpu.bytetrade.io/{driver,cuda,cuda-supported} labels (used by the nvidia path); a nil pointer means "leave that label as-is". The legacy gpu.bytetrade.io/type label is intentionally never written.
Types ¶
type CheckGpuStatus ¶
type CheckGpuStatus struct {
common.KubeAction
}
type CheckWslGPU ¶
type CheckWslGPU struct {
}
func (*CheckWslGPU) CheckNvidiaSmiFileExists ¶
func (t *CheckWslGPU) CheckNvidiaSmiFileExists() bool
func (*CheckWslGPU) Execute ¶
func (t *CheckWslGPU) Execute(runtime *common.KubeRuntime)
type ConfigureContainerdRuntime ¶
type ConfigureContainerdRuntime struct {
common.KubeAction
}
type ContainerdInstalled ¶
type ContainerdInstalled struct {
common.KubePrepare
}
type CudaInstalled ¶
type CudaInstalled struct {
common.KubePrepare
}
type CudaNotInstalled ¶
type CudaNotInstalled struct {
common.KubePrepare
CudaInstalled
}
type CurrentNodeInK8s ¶
type CurrentNodeInK8s struct {
common.KubePrepare
}
type DisableNouveauModule ¶
type DisableNouveauModule struct {
common.KubeModule
}
func (*DisableNouveauModule) Init ¶
func (m *DisableNouveauModule) Init()
type GPUEnablePrepare ¶
type GPUEnablePrepare struct {
common.KubePrepare
}
type GpuDevicePluginInstalled ¶
type GpuDevicePluginInstalled struct {
common.KubePrepare
}
type InstallContainerToolkitModule ¶
type InstallContainerToolkitModule struct {
common.KubeModule
manifest.ManifestModule
Skip bool // enableGPU && ubuntuVersionSupport
SkipCudaCheck bool
}
func (*InstallContainerToolkitModule) Init ¶
func (m *InstallContainerToolkitModule) Init()
func (*InstallContainerToolkitModule) IsSkip ¶
func (m *InstallContainerToolkitModule) IsSkip() bool
type InstallCudaDriver ¶
type InstallCudaDriver struct {
common.KubeAction
manifest.ManifestAction
}
type InstallDriversModule ¶
type InstallDriversModule struct {
common.KubeModule
manifest.ManifestModule
Skip bool // enableGPU && ubuntuVersionSupport
// log a failure message and then exit
// instead of silently skip the jobs when:
// 1. no card is found (which skips the driver installation)
// 2. no driver is found (which skips the container toolkit installation)
FailOnNoInstallation bool
}
func (*InstallDriversModule) Init ¶
func (m *InstallDriversModule) Init()
func (*InstallDriversModule) IsSkip ¶
func (m *InstallDriversModule) IsSkip() bool
type InstallNvidiaContainerToolkit ¶
type InstallNvidiaContainerToolkit struct {
common.KubeAction
}
type InstallPlugin ¶
type InstallPlugin struct {
common.KubeAction
}
type InstallPluginModule ¶
type InstallPluginModule struct {
common.KubeModule
Skip bool // enableGPU && ubuntuVersionSupport
}
func (*InstallPluginModule) Init ¶
func (m *InstallPluginModule) Init()
func (*InstallPluginModule) IsSkip ¶
func (m *InstallPluginModule) IsSkip() bool
type NodeLabelingModule ¶
type NodeLabelingModule struct {
common.KubeModule
}
func (*NodeLabelingModule) Init ¶
func (l *NodeLabelingModule) Init()
type NodeUnlabelingModule ¶
type NodeUnlabelingModule struct {
common.KubeModule
}
func (*NodeUnlabelingModule) Init ¶
func (l *NodeUnlabelingModule) Init()
type NvidiaGraphicsCard ¶
type NvidiaGraphicsCard struct {
common.KubePrepare
ExitOnNotFound bool
}
type PatchK3sDriver ¶
type PatchK3sDriver struct {
common.KubeAction
}
type PrintGpuStatus ¶
type PrintGpuStatus struct {
common.KubeAction
}
type PrintPluginsStatus ¶
type PrintPluginsStatus struct {
common.KubeAction
}
type RemoveContainerRuntimeConfig ¶
type RemoveContainerRuntimeConfig struct {
common.KubeAction
}
type RemoveNodeLabels ¶
type RemoveNodeLabels struct {
common.KubeAction
}
type RestartContainerdModule ¶
type RestartContainerdModule struct {
common.KubeModule
Skip bool // enableGPU && ubuntuVersionSupport
}
func (*RestartContainerdModule) Init ¶
func (m *RestartContainerdModule) Init()
func (*RestartContainerdModule) IsSkip ¶
func (m *RestartContainerdModule) IsSkip() bool
type RestartK3sServiceModule ¶
type RestartK3sServiceModule struct {
common.KubeModule
Skip bool // enableGPU && ubuntuVersionSupport
}
func (*RestartK3sServiceModule) Init ¶
func (m *RestartK3sServiceModule) Init()
func (*RestartK3sServiceModule) IsSkip ¶
func (m *RestartK3sServiceModule) IsSkip() bool
type RestartPlugin ¶
type RestartPlugin struct {
common.KubeAction
}
type UninstallCudaModule ¶
type UninstallCudaModule struct {
common.KubeModule
}
func (*UninstallCudaModule) Init ¶
func (l *UninstallCudaModule) Init()
type UninstallNvidiaDrivers ¶
type UninstallNvidiaDrivers struct {
common.KubeAction
}
type UpdateNodeGPUInfo ¶
type UpdateNodeGPUInfo struct {
common.KubeAction
}
type UpdateNvidiaContainerToolkitSource ¶
type UpdateNvidiaContainerToolkitSource struct {
common.KubeAction
manifest.ManifestAction
}
type WriteNouveauBlacklist ¶
type WriteNouveauBlacklist struct {
common.KubeAction
}