Contents

GPU accelerated docker on Asahi Linux

Contents

With the work of the Asahi Linux team to port Linux on the M series of laptop from Apple. More and more developper are now thinking about making asahi linux their daily driver. One feature was keeping me back from it… GPU acceleration in docker containers.

While most of the features are being mainstreamed, one of the biggest distro still is Ubuntu, with many docker images based on it. By default only the official libgl1-mesa package is installed. But thanks to the work of tobhe on bringing Ubuntu to M series apple laptops, we can now enjoy GPU acceleration in any ubuntu based docker container ! Here is a sample code to get the driver installed.

1
2
3
4
5
6
7
FROM ubuntu:22.04
RUN apt update && apt upgrade -y
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:tobhe/asahi -y
RUN apt install libgl1-mesa-dri -y
RUN apt install mesa-utils -y
CMD ["glxgears"]

And… tada ! /images/posts/gpu_acceleration_docker_asahi_linux/result.png

all the code for used for this post is available here