Skip to content

Commit 017a56c

Browse files
committed
Fallback to `-cpu max'
On platforms that have an accelerator but `-cpu host' is not available fallback to `-cpu max' that enables all features supported by the accelerator in the current host. Signed-off-by: Leonardo Taccari <[email protected]>
1 parent 6410674 commit 017a56c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/limayaml/defaults.go

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)