piconet/picolab on apple silicon (m1, m2, etc)

UVic computer science
pan
Posts: 56960
Joined: Mon Sep 11, 2006 10:23 am

piconet/picolab on apple silicon (m1, m2, etc)

Post by pan »

multipass https://multipass.run/docs/installing-on-macos

The default backend on macOS is hyperkit on Intel, and qemu on the M1, wrapping Apple’s Hypervisor.framework. You can use any M1 Mac, or a 2010 or newer Intel Mac with macOS 10.14 Mojave or later installed.

clarkzjw
Posts: 1907
Joined: Thu May 13, 2021 7:38 pm
Contact:

Re: m1 (apple silicon)

Post by clarkzjw »

https://asahilinux.org/about/

Asahi Linux is a project and community with the goal of porting Linux to Apple Silicon Macs, starting with the 2020 M1 Mac Mini, MacBook Air, and MacBook Pro.

Is this a Linux distribution?

Asahi Linux is an overall project to develop support for these Macs. We will eventually release a remix of Arch Linux ARM, packaged for installation by end-users, as a distribution of the same name. The majority of the work resides in hardware support, drivers, and tools, and it will be upstreamed to the relevant projects. The distribution will be a convenient package for easy installation by end-users and give them access to bleeding-edge versions of the software we develop.

We expect that support will eventually trickle up and back down to other distributions. Advanced users will always be free to use the distribution of their choice and add the necessary patches/software themselves before this happens.

Feature Support, https://github.com/AsahiLinux/docs/wiki/Feature-Support

pan
Posts: 56960
Joined: Mon Sep 11, 2006 10:23 am

Re: m1 (apple silicon)

Post by pan »

https://www.omglinux.com/linux-apple-silicon-milestone/
Linux Now Officially Supports Apple Silicon
POSTED BYby TUX PENGUIN FEBRUARY 25, 2023 1 COMMENT

Linux now officially supports Apple silicon.

The latest Linux 6.2 kernel release is the first version to ship with mainline support for devices powered by some of Apple M1 Pro, M1 Max, and M1 Ultra chips.

“Mainline” is the important qualifier here as it’s been possible to run custom Linux kernel builds on Apple silicon for a while, thanks in large part to the efforts from the Asahi Linux project.

Linux Apple silicon support is very much a work in progress. Not all devices using M-series chips are supported by Linux 6.2, and there are still a clutch of core computing features that lack anything rudimentary support or, in some cases like speakers, no support at all.

Still, this is significant milestone for Linux on Apple silicon.

That Linux runs at all on Apple’s new-fangled hardware is both testament to the kernel’s adaptability, and the ingenuity and talent of Linux developers and the Asahi Linux project.

After all, Apple doesn’t directly support, document, or provide drivers to let alternative operating system run on its hardware.

With Linux 6.2 carrying support directly you won’t need to use Asahi Linux to run Linux on M1 computers. In theory, any Linux distribution shipping the Linux 6.2 kernel can boot up and run. And despite gaps in functionality, Linux 6.2 support is robust enough for essential tasks.

Plus with growing support from app makers for Linux on ARM in general, the viability of Linux on Apple silicon is only set to get better over the coming year.
clarkzjw
Posts: 1907
Joined: Thu May 13, 2021 7:38 pm
Contact:

Re: m1 (apple silicon)

Post by clarkzjw »

With macOS 13 on M-series ARM CPUs, you can also directly run x86_64 Linux binaries inside ARM Linux virtual machines with the help of Rosetta 2.
https://developer.apple.com/documentati ... th_rosetta

It can be useful in rare cases where you only have access to Linux x86_64 binaries without source code to recompile it.
Overview

In macOS 13 and later on Mac computers with Apple silicon chips, the Virtualization framework supports Rosetta in ARM Linux virtual machines (VMs). Rosetta is a translation process that allows users to run apps that contain x86_64 instructions on Apple silicon. In macOS, this allows apps built for Intel-based Mac computers to run seamlessly on Apple silicon; Rosetta allows the same capability for Intel Linux apps in ARM Linux VMs.

Note

Rosetta doesn’t support the bootstrapping or installation of Intel Linux distributions on Mac computers with Apple silicon using the Virtualization framework. Intel Linux distributions can run using the Virtualization framework on Intel-based Mac computers without the need for this translation capability.
Currently the only known virtual machine management software that supports this feature is UTM, https://docs.getutm.app/advanced/rosetta/
pan
Posts: 56960
Joined: Mon Sep 11, 2006 10:23 am

Re: piconet/picolab on apple silicon (m1, m2, etc)

Post by pan »

if you run piconet script directly in a ubuntu vm with multipass or container with docker, nothing is changed---just make sure you are using the latest multipass/docker that supports apple silicon, and it shall automatically pull the suitable ubuntu vm or container that runs either natively on apple silicon or through rosetta

if you want to run picolab (piconet with the jupyterlab gui front-end), you can either run in a ubuntu virtual machine or docker container. for virtual machine, make sure to use picolab-vm-230124.tar.gz at download/file.php?id=39446 which has been tested by a csc361 student with an m1 macbook air and multipass. everything shall be automatic, i.e., the url is formed correctly with jupyterlab access token and chrome browser will be launched too

if you want to run picolab in a docker container, you can either build the image yourself picolab-docker.tar.gz download/file.php?id=39455 or you can pull the universal image built by clark https://hub.docker.com/r/clarkzjw/picolab . just make sure you use the jupyterlab access token when you launch your image into a running instance to access picolab through your web browser. we know it has been tested with docker desktop for windows/macos
Post Reply

Return to “UVic CS”