Skip to content

Commit 1d5e023

Browse files
authored
Merge pull request #913 from iamleot/fallback-to-cpu-max-for-accel-oses
Fallbacks to `-cpu max` on native arch platforms that have an accelerator but do not support `-cpu host`
2 parents 3201ad4 + 017a56c commit 1d5e023

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/limayaml/defaults.go

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
108108
if IsNativeArch(arch) && IsAccelOS() {
109109
if HasHostCPU() {
110110
cpuType[arch] = "host"
111+
} else {
112+
cpuType[arch] = "max"
111113
}
112114
}
113115
}

pkg/limayaml/defaults_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ func TestFillDefault(t *testing.T) {
8686
if IsAccelOS() {
8787
if HasHostCPU() {
8888
builtin.CPUType[arch] = "host"
89+
} else {
90+
builtin.CPUType[arch] = "max"
8991
}
9092
}
9193

0 commit comments

Comments
 (0)