Extremely poor performance emulating all x64 OSes tested on macOS 12.5.1 M1 #4349
Replies: 6 comments 4 replies
-
x86 on an M1 Mac isn't virtualization, it is emulation, and emulating one processor architecture on another is slow. |
Beta Was this translation helpful? Give feedback.
-
@easp , thanks for the precise eye on this! Naturally, I meant emulation (adjusted) and understood this being slow would generally be expected. With this noted, something that could be done outside of swapping HW to make usable is appreciated (e.g. config adjustments of QEMU, code improvement, etc.). For this hardware with no changes it is essentially emulation in name only, and not actually usable. 🤷 |
Beta Was this translation helpful? Give feedback.
-
@penalvch I'm not an expert by any means, but I don't think there is much that can can be done to work around the inherent computational cost of emulating x86 on ARM. UTM defaults to using QEMUs JIT translation to convert/compile a sequence of x86 instructions into a sequence of ARM64 instructions which are then executed. In order to amortize the cost of this conversion, it keeps a cache so it doesn't have to invoke the conversion/compilation multiple times. With UTM, that cache is an additional 1/4 of the memory size of the emulated machine. It stands to reason that emulating a relatively large operating system like Windows Server + a large set of services including a web and database server, will involve a lot of code and could easily excede the size of that cache. Therefore enlarging the cache beyond the default might result in an appreciable speedup in actual operation, though startup times might still be slow. The other optimization is to minimize the amount of computation accomplished under emulation. The first thing to do would be shutting down any unnecessary services. The next would be avoiding running UI code on the emulated machine by, for example, using 3rd-party Mac native remote admin tools (I can't name any, but my impression is they exist). If it is necessary to have a desktop session it might help to access it over RDP on the theory that at least the low level rendering of UI would run, if not natively, then using Apple's superior user-mode x86 translator/emulator. The thing is, even if these things resulted in a significant 2x speedup, the result would still be quite slow. |
Beta Was this translation helpful? Give feedback.
-
Hi @easp , thanks for the insight. One thing that seemed to help dramatically for Red Hat 9 x64 was change the CPU Cores setting from: to: It took the overall performance from unusable to decent with no workloads, database'ing, etc. |
Beta Was this translation helpful? Give feedback.
-
In case anyone is interested, bumping the JIT cache on an emulated x86_64 VM running a stock installation of Windows 11 on my M2 MBP with 16GB of memory helped me greatly. I set the VM for 4GB of JIT cache with 6GB of memory and 8 cores. Given how slow it ran before, it almost feels snappy 😀 |
Beta Was this translation helpful? Give feedback.
-
I like the ability of the x86 emulator, but know that its performance is a challenge. So what if I threw more hardware at it? e.g. hypothetically if I were to get an M3 Max, how much faster would it be? |
Beta Was this translation helpful? Give feedback.
-
BEFORE SUBMITTING YOUR ISSUE, PLEASE LOOK AT THE PINNED ISSUES AND USE THE SEARCH FUNCTION TO MAKE SURE IT IS NOT ALREADY REPORTED. ALWAYS COMMENT ON AN EXISTING ISSUE INSTEAD OF MAKING A NEW ONE.
Describe the issue
Extremely poor performance when emulating x64 based OSes (various tested, so far Windows Server 20XY, Ubuntu WX.YZ, RHEL 9) on:
Configuration
Crash log
N/A
Debug log
For all issues related to running a VM, including crashes, you should attach a debug log. (This is unavailable for macOS-on-macOS VMs. Attach an excerpt of your system log instead.)
To get the Debug log: open UTM, and open the settings for the VM you wish to launch. Near the top of the
QEMU
page isDebug Log
. Turn it on and save the VM. After you experience the issue, open the VM settings again and selectExport Log...
and attach it here:Running: -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4000,server,nowait -nodefaults -vga none -spice "unix=on,addr=/Users/USERNAME/Library/Group Containers/WDNLXAD4W8.com.utmapp.UTM/00521785-E179-4046-901E-CF4BBD98D551.spice,disable-ticketing=on,image-compression=off,playback-compression=off,streaming-video=off,gl=off" -device virtio-vga -cpu Skylake-Client-v1 -smp cpus=1,sockets=1,cores=1,threads=1 -machine q35,vmport=off,i8042=off -accel tcg,thread=multi,tb-size=8192 -global PIIX4_PM.disable_s3=1 -global ICH9-LPC.disable_s3=1 -drive if=pflash,format=raw,unit=0,file=/Applications/UTM.app/Contents/Resources/qemu/edk2-x86_64-code.fd,readonly=on -drive if=pflash,unit=1,file=/Users/chris.penalver/Library/Containers/com.utmapp.UTM/Data/Documents/RHEL9x64.utm/Images/efi_vars.fd -boot menu=on -m 32768 -device intel-hda -device hda-duplex -name RHEL9x64 -usb -device usb-tablet,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -device ich9-usb-ehci1,id=usb-controller-0 -device ich9-usb-uhci1,masterbus=usb-controller-0.0,firstport=0,multifunction=on -device ich9-usb-uhci2,masterbus=usb-controller-0.0,firstport=2,multifunction=on -device ich9-usb-uhci3,masterbus=usb-controller-0.0,firstport=4,multifunction=on -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device ide-cd,bus=ide.0,drive=cdrom0,bootindex=0 -drive if=none,media=cdrom,id=cdrom0 -device ide-hd,bus=ide.1,drive=drive0,bootindex=1 -drive if=none,media=disk,id=drive0,file=/Users/chris.penalver/Library/Containers/com.utmapp.UTM/Data/Documents/RHEL9x64.utm/Images/data.qcow2,discard=unmap,detect-zeroes=unmap -device e1000,mac=A6:E0:41:6E:60:ED,netdev=net0 -netdev vmnet-shared,id=net0 -device virtio-serial -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,id=vdagent,debug=0,name=vdagent -device virtserialport,chardev=charchannel1,id=channel1,name=org.spice-space.webdav.0 -chardev spiceport,name=org.spice-space.webdav.0,id=charchannel1 -uuid 00521785-E179-4046-901E-CF4BBD98D551 -rtc base=localtime -device virtio-rng-pci
qemu-x86_64-softmmu: -accel tcg,thread=multi,tb-size=8192: warning: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.01H:ECX.f16c [bit 29]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.07H:EBX.invpcid [bit 10]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.07H:EBX.rdseed [bit 18]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.80000001H:ECX.3dnowprefetch [bit 8]
qemu-x86_64-softmmu: warning: TCG doesn't support requested feature: CPUID.0DH:EAX.xsavec [bit 1]
qemu-x86_64-softmmu: warning: global PIIX4_PM.disable_s3=1 not used
qemu-x86_64-softmmu: warning: Spice: playback:0 (0x120838920): setsockopt failed, Operation not supported on socket
qemu-x86_64-softmmu: warning: Spice: record:0 (0x1208389c0): setsockopt failed, Operation not supported on socket
Upload VM
Not VM instance specific (all OSes x64 based tried).
Beta Was this translation helpful? Give feedback.
All reactions