Skip to content

Commit

Permalink
Enable hardware acceleration
Browse files Browse the repository at this point in the history
This will speed up the build process. Multiple accelerators are added
and QEMU will automatically pick the one it can use.
  • Loading branch information
jacob-carlborg committed Apr 11, 2024
1 parent 871529e commit a183a39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion openbsd.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"],
Expand Down
3 changes: 2 additions & 1 deletion var_files/arm64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a183a39

Please sign in to comment.