From a183a39b1a8dd44f4133dbd0dcc10383292ef946 Mon Sep 17 00:00:00 2001 From: Jacob Carlborg Date: Fri, 5 Apr 2024 20:19:59 +0200 Subject: [PATCH] Enable hardware acceleration This will speed up the build process. Multiple accelerators are added and QEMU will automatically pick the one it can use. --- openbsd.pkr.hcl | 5 ++++- var_files/arm64.pkrvars.hcl | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openbsd.pkr.hcl b/openbsd.pkr.hcl index 00f8181..c0b1909 100644 --- a/openbsd.pkr.hcl +++ b/openbsd.pkr.hcl @@ -137,7 +137,7 @@ source "qemu" "qemu" { headless = var.headless use_default_display = var.use_default_display display = var.display - accelerator = var.accelerator + accelerator = "none" qemu_binary = "qemu-system-${local.qemu_architecture}" firmware = var.firmware @@ -162,6 +162,9 @@ source "qemu" "qemu" { qemuargs = [ ["-cpu", var.cpu_type], ["-boot", "strict=off"], + ["-accel", "hvf"], + ["-accel", "kvm"], + ["-accel", "tcg"], ["-monitor", "none"], ["-vga", "cirrus"], ["-device", "virtio-blk-pci,drive=drive0,bootindex=0"], diff --git a/var_files/arm64.pkrvars.hcl b/var_files/arm64.pkrvars.hcl index e05ea46..e7c686c 100644 --- a/var_files/arm64.pkrvars.hcl +++ b/var_files/arm64.pkrvars.hcl @@ -1,4 +1,5 @@ architecture = "arm64" -machine_type = "virt" +machine_type = "virt,highmem=off" // highmem=off if reqiured for enabling hardware acceleration on Apple Silicon cpu_type = "cortex-a57" firmware = "resources/qemu_efi.fd" +memory = 3072 // max memory when hardware acceleration on Apple Silicon is enabled