Skip to content

Commit

Permalink
fix: gpu support os version
Browse files Browse the repository at this point in the history
  • Loading branch information
aby913 committed Aug 22, 2024
1 parent b5d6daa commit 779eb12
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/phase/system/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"bytetrade.io/web3os/installer/pkg/bootstrap/patch"
"bytetrade.io/web3os/installer/pkg/bootstrap/precheck"
"bytetrade.io/web3os/installer/pkg/common"
"bytetrade.io/web3os/installer/pkg/constants"
"bytetrade.io/web3os/installer/pkg/container"
"bytetrade.io/web3os/installer/pkg/core/module"
"bytetrade.io/web3os/installer/pkg/core/pipeline"
Expand Down Expand Up @@ -47,9 +48,9 @@ func PrepareSystemPhase(runtime *common.KubeRuntime) *pipeline.Pipeline {
}

m = append(m,
&gpu.InstallDepsModule{Skip: !runtime.Arg.GPU.Enable},
&gpu.RestartK3sServiceModule{Skip: !runtime.Arg.GPU.Enable},
&gpu.RestartContainerdModule{Skip: !runtime.Arg.GPU.Enable},
&gpu.InstallDepsModule{Skip: !runtime.Arg.GPU.Enable || !isSupportOs()},
&gpu.RestartK3sServiceModule{Skip: !runtime.Arg.GPU.Enable || !isSupportOs()},
&gpu.RestartContainerdModule{Skip: !runtime.Arg.GPU.Enable || !isSupportOs()},
&gpu.InstallPluginModule{Skip: true},
&terminus.PreparedModule{},
)
Expand All @@ -60,3 +61,11 @@ func PrepareSystemPhase(runtime *common.KubeRuntime) *pipeline.Pipeline {
Runtime: runtime,
}
}

func isSupportOs() bool {
if constants.OsPlatform == common.Ubuntu && (strings.Contains(constants.OsVersion, "20.") || strings.Contains(constants.OsVersion, "22.")) {
return true
}

return false
}

0 comments on commit 779eb12

Please sign in to comment.