On macOS, it’s easiest to build ExecuTorch in an Ubuntu container. This keeps your toolchain consistent with the rest of the Learning Path and avoids gaps in macOS-native cross-compilers (for example, the Arm GNU Toolchain doesn’t provide an “AArch64 GNU/Linux target” for macOS).
This container isn’t part of the runtime deployment. It’s a build environment that produces the artifacts you later move onto the FRDM i.MX 93:
.pte model files compiled for Ethos-U65Keeping this step reproducible helps you focus on the actual bring-up milestone: booting custom firmware on Cortex-M33 and using Ethos-U65 for inference.
Start by installing and launching Docker Desktop .
Next, create a working directory for your container build:
mkdir ubuntu-24-container
Now create a Dockerfile and switch into the directory:
cd ubuntu-24-container
touch Dockerfile
Add the following content to your Dockerfile to install a few basic tools in the image:
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y && \
apt install -y \
software-properties-common \
curl vim git
The ubuntu:24.04 container image includes Python 3.12, which you use later in this Learning Path.
Build the container image:
docker build -t ubuntu-24-container .
Run the container and open an interactive shell:
docker run -it ubuntu-24-container /bin/bash
__output__# Output will be the Docker container prompt
__output__root@<CONTAINER ID>:/#
If you already created a container before, reuse it instead of creating a new one.
First, list your containers to find the container ID:
docker ps -a
__output__# Output
__output__CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
__output__0123456789ab ubuntu-24-container "/bin/bash" 27 hours ago Exited (255) 59 minutes ago. container_name
Then start the container and attach a shell:
docker start 0123456789ab
docker exec -it 0123456789ab /bin/bash
Once you’re inside the container, move to your home directory:
cd /root
Install the packages ExecuTorch needs to build. If you’re not running as root, prefix the commands with sudo.
apt update
apt install -y \
python-is-python3 python3.12-dev python3.12-venv python3-pip \
gcc g++ \
make cmake \
build-essential \
ninja-build \
libboost-all-dev
Create and activate a virtual environment so your Python packages stay scoped to this project:
python3 -m venv .venv
source .venv/bin/activate
Clone ExecuTorch and initialize its submodules:
git clone https://github.com/pytorch/executorch.git
cd executorch
git fetch --tags
git checkout c70a742344e30158dc370d7d35d60ed07660fee0
git submodule sync
git submodule update --init --recursive
The EthosUCompileSpec parameters used in this guide:
| Parameter | Value | Description |
|---|---|---|
target | ethos-u65-256 | Targets the Ethos-U65 with 256 MAC units |
system_config | Ethos_U65_High_End | High-end system configuration for optimal performance |
memory_mode | Shared_Sram | Uses shared SRAM memory mode |
In this section you’ve:
With your build environment configured and the ExecuTorch source checked out, the next step is building and installing the ExecuTorch package.