@@ -42,6 +42,7 @@ import (
4242
4343 "k8s.io/klog/v2"
4444 pkgdrivers "k8s.io/minikube/pkg/drivers"
45+ "k8s.io/minikube/pkg/minikube/detect"
4546 "k8s.io/minikube/pkg/minikube/exit"
4647 "k8s.io/minikube/pkg/minikube/firewall"
4748 "k8s.io/minikube/pkg/minikube/out"
@@ -412,14 +413,11 @@ func (d *Driver) Start() error {
412413 }
413414
414415 // hardware acceleration is important, it increases performance by 10x
415- if runtime .GOOS == "darwin" {
416- // On macOS, enable the Hypervisor framework accelerator.
417- startCmd = append (startCmd ,
418- "-accel" , "hvf" )
419- } else if _ , err := os .Stat ("/dev/kvm" ); err == nil && runtime .GOOS == "linux" {
420- // On Linux, enable the Kernel Virtual Machine accelerator.
416+ accel := hardwareAcceleration ()
417+ if accel != "" {
418+ klog .Infof ("Using %s for hardware acceleration" , accel )
421419 startCmd = append (startCmd ,
422- "-accel" , "kvm" )
420+ "-accel" , accel )
423421 }
424422
425423 startCmd = append (startCmd ,
@@ -546,6 +544,21 @@ func (d *Driver) Start() error {
546544 return WaitForTCPWithDelay (fmt .Sprintf ("%s:%d" , d .IPAddress , d .SSHPort ), time .Second )
547545}
548546
547+ func hardwareAcceleration () string {
548+ if detect .IsAmd64M1Emulation () {
549+ return "tcg"
550+ }
551+ if runtime .GOOS == "darwin" {
552+ // On macOS, enable the Hypervisor framework accelerator.
553+ return "hvf"
554+ }
555+ if _ , err := os .Stat ("/dev/kvm" ); err == nil && runtime .GOOS == "linux" {
556+ // On Linux, enable the Kernel Virtual Machine accelerator.
557+ return "kvm"
558+ }
559+ return ""
560+ }
561+
549562func isBootpdError (err error ) bool {
550563 if runtime .GOOS != "darwin" {
551564 return false
0 commit comments