From 10d3aa358c41b9456c625ba8bdeeb1dad760bff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 18 Aug 2024 18:16:16 +0200 Subject: [PATCH] qemu: Enable hardware acceleration on Windows And document the default "tcg" fallback accel --- pkg/drivers/qemu/qemu.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/drivers/qemu/qemu.go b/pkg/drivers/qemu/qemu.go index 018974d07f6e..89e1b4b7464c 100644 --- a/pkg/drivers/qemu/qemu.go +++ b/pkg/drivers/qemu/qemu.go @@ -545,10 +545,7 @@ func (d *Driver) Start() error { } func hardwareAcceleration() string { - if detect.IsAmd64M1Emulation() { - return "tcg" - } - if runtime.GOOS == "darwin" { + if !detect.IsAmd64M1Emulation() && runtime.GOOS == "darwin" { // On macOS, enable the Hypervisor framework accelerator. return "hvf" } @@ -556,6 +553,11 @@ func hardwareAcceleration() string { // On Linux, enable the Kernel Virtual Machine accelerator. return "kvm" } + if runtime.GOOS == "windows" { + // On Windows, enable the Windows Hypervisor Platform accelerator. + return "whpx" + } + // Use the default, "tcg" (in software, not hardware accelerated) return "" }