Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM Startup (QEMU RAM Allocation) Errors with High (>32GB) RAM on M2 Max Macbook #5537

Closed
Aeonitis opened this issue Aug 7, 2023 · 5 comments
Labels
qemu QEMU related
Milestone

Comments

@Aeonitis
Copy link

Aeonitis commented Aug 7, 2023

When attempting to start a virtual machine using a large amount of RAM (e.g. 81,920MB or 65,536MB) on my physical 96GB RAM M2 Max MacBook through UTM, I intermittently receive one of two error messages. Purpose is to build Android OS code.

The first is:
QEMU error: QEMU exited from an error: qemu-aarch64-softmmu: Error: HV_BAD_ARGUMENT

and the second:
QEMU error: QEMU exited from an error: qemu-aarch64-softmmu: -drive if=none,media=cdrom,id=drive6EA5E6A4-0E92-4C50-9C56-405C793F1C8E,file=/Users/aeonitis/Downloads/ubuntu-22.04.2-live-server-arm64.iso,readonly=on: Could not open '/Users/aeonitis/Downloads/ubuntu-22.04.2-live-server-arm64.iso': Operation not permitted.

The issue does not persist when the RAM allocation is set to 32,768MB or less. Everything seems to run fine within that limit.

Additionally, upon inspecting the code, I noticed that the RAMSlider is limited to 32GB maximum. Considering modern Macs now support up to 192GB RAM, I suggest updating this slider for better alignment with the latest hardware capabilities. I stopped troubleshooting past going through the systemMemory variable which might also play a role in this limitation...

Configuration

  • UTM Version: 4.3.5
  • macOS Version: 13.5
  • Mac Chip: M2 Max
  • Storage: 300GB
  • Cores: 20 out of 24

Sorry I can't provide logs as the folders didn't seem to produce them pre-boot I guess, and for some reason the mac app reporting popup stopped appearing. I'm kinda glad this is the case as I don't wanna share more private device data.

@osy
Copy link
Contributor

osy commented Aug 7, 2023

@agraf Is there a HVF limitation on the amount of RAM that can be allocated?

@oscarbg
Copy link

oscarbg commented Nov 27, 2024

nice!
seeing UTM picks patches from upstream, searching new hvf related commits up to Qemu 9.2:
https://github.com/search?q=repo%3Aqemu%2Fqemu+hvf&type=commits&s=committer-date&o=desc&p=1
seems there is another interesting (recent) one:
"i386/hvf: Integrates x2APIC support with hvf accel"
qemu/qemu@0e27f3a
"Enabling it when using macOS’s hvf
accelerator is useful and significantly helps performance, as Qemu
currently uses the emulated APIC when running on hvf as well."
don't know if real performance would be affected but I would be interested to be able to test..

@osy
Copy link
Contributor

osy commented Nov 27, 2024

@oscarbg I thought you're on Apple Silicon? That change only applies to x86_64

@oscarbg
Copy link

oscarbg commented Nov 27, 2024

yep.. stupid mistake.. forgot to read more about that change..

@Aeonitis
Copy link
Author

Aeonitis commented Nov 29, 2024

Thank you!!! @oscarbg & @osy

So I guess it'll be available in v9.2.0 release right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qemu QEMU related
Projects
None yet
Development

No branches or pull requests

3 participants