Olares/cli/pkg/gpu/mtgpu/module.go
eball 51214c3d80
cli: add functions to detect MThreads AI Book (#2883)
* feat(connector): add functions to detect Mthreads AI Book and RockChip models

* feat(gpu): add MThreads GPU support and related modules

* fix(cli): remove redundant import of amdgpu package

* chore(cli): remove unnecessary tasks when adding node

---------

Co-authored-by: dkeven <dkvvven@gmail.com>
2026-04-14 19:53:08 +08:00

33 lines
774 B
Go

package mtgpu
import (
"github.com/beclab/Olares/cli/pkg/common"
"github.com/beclab/Olares/cli/pkg/core/task"
)
// InstallMThreadsPluginModule installs MThreads GPU device plugin on Kubernetes.
type InstallMThreadsPluginModule struct {
common.KubeModule
Skip bool // conditional execution based on GPU enablement
}
func (m *InstallMThreadsPluginModule) IsSkip() bool {
return m.Skip
}
func (m *InstallMThreadsPluginModule) Init() {
m.Name = "InstallMThreadsPlugin"
// update node with MThreads GPU labels
updateNode := &task.RemoteTask{
Name: "UpdateNodeMThreadsGPUInfo",
Hosts: m.Runtime.GetHostsByRole(common.Master),
Action: new(UpdateNodeMThreadsGPUInfo),
Parallel: false,
Retry: 1,
}
m.Tasks = []task.Interface{
updateNode,
}
}