First impressions of Apple Silicon

My MacBook Pro 17″ (2.2GHz Intel i7, AMD Radeon HD 6750M, 16GB RAM) has been replaced by a new MacBook Pro 16″ (Apple M1 Pro, 10-core CPU, 16-core GPU, 32GB RAM). While the old Intel MacBook Pro has served me well for over 10 years, it has been fixed (free!) three times for the dreaded overheating graphics card.

After installing Homebrew and installing gcc/gfortran, I was able to compile (cleanly) a mixed C++/Fortran simulation code. To my surprise, running one instance of this heavy floating point calculation, the run time was 2.5x faster than my previous Intel based MacBook Pro. Further, if I loaded up eight copies of the calculation, I found only a 14% performance hit. Given the wide and fast bandwidth to memory coupled with the large L2 cache, this memory bound computation appears to exploit Apple’s silicon in a very pleasing way.

One of my concerns about moving to Apple Silicon is that I often run virtual machines (VM) of Windows and various flavors of Linux under VMware Fusion. I was able to get arm64 versions of Amazon Linux 2, ArchLinux, Ubuntu, Debian and Windows 11 Insider Preview VMs running under UTM (a front-end to QEMU). To my pleasant surprise, the same floating point simulation ran almost as fast under VM of Debian or Amazon Linux 2 as running native under macOS. I was also able to run Windows XP under UTM emulating a x86_64- not particularly fast or useful.

I didn’t see a complete write up of how to get Amazon Linux 2 (arm64) running under UTM. It’s pretty straight forward. You follow these steps from Amazon. At step two, you want the KVM (arm64) *.qcow2 found here. Then instead of step three, in UTM, create a new VM. Under System, set Architecture to ARM64 (aarch64) and System to QEMU 6.1 ARM Virtual Machine. Under Drives, Import Drive (either VirtIO or NVMe) and point it to the *.qcow2 from step two. Create a New Drive, Removable and USB. Hit Save. With the new VM selected on the left, scroll to the bottom on the right and select CD/DVD. Browse to seed.iso you made in step one. Start the VM. You should get a console log in.

During step one above, you created a user-data file. By adding three lines, you can enable ssh from the host to guest where ssh-authorized-keys is the host’s public key. This greatly enhances working in the VM.

#cloud-config
# vim:syntax=yaml
users:
# A user by the name ec2-user is created in the image by default.
  - default
  - name: ec2-user
    ssh-authorized-keys:
      - ssh-rsa AAAAB3NzaC1yc2...

chpasswd:
  list: |
    ec2-user:password
# In the above line, do not add any spaces after 'ec2-user:'.

# NOTE: Cloud-init applies network settings on every boot by default. To retain network settings from first
boot, uncomment the following ‘write_files’ section:
#write_files:
  - path: /etc/cloud/cloud.cfg.d/80_disable_network_after_firstboot.cfg
    content: |
      # Disable network configuration after first boot
      network:
        config: disabled

Since the old MacBook Pro could only run High Sierra, I was also forced to run a VM of macOS in order to run the latest version of Xcode. While this was doable, it is nothing compared to running Xcode natively on the new MacBook Pro.

Now, if I could only iron out the difficulties of Apple ID, I would be set… (alas, my original Apple ID was not an email address and the new MacBook Pro refused to accept it).

Add a Comment

Your email address will not be published. Required fields are marked *