GitPedia

Mesa for android container

A Mesa build for containers on Android (PRoot, Chroot, LXC, Droidspaces, etc.), to support hardware acceleration with Adreno GPU.

From lfdevs·Updated June 28, 2026·View on GitHub·

Forked From [Mesa - The 3D Graphics Library](https://gitlab.freedesktop.org/mesa/mesa) The project is written primarily in C, first published in 2025. Key topics include: android, chroot, droidspaces, freedreno, gpu.

Mesa for Android Container

Forked From Mesa - The 3D Graphics Library

English | 简体中文 | 繁體中文


A Mesa build for containers on Android (PRoot, Chroot, LXC, Droidspaces, etc.), to support hardware acceleration with Adreno GPU.

Features

  • The Freedreno and Turnip driver in Mesa 26.0.0 and later versions supports Adreno 8xx GPU.
  • Mesa drivers compiled in ARM64 Docker containers across multiple popular Linux distributions offer better compatibility and can be used in PRoot, Chroot, Droidspaces, and LXC containers hosted on Android.
  • For some Adreno 6xx/7xx/8xx GPUs, the Freedreno driver can be used for OpenGL, OpenGL ES, and Vulkan, eliminating the need for Zink for graphics API call translation and significantly improving GPU utilization.
  • Only drivers relevant to the vast majority of Android devices are compiled to reduce the package size.

Compatibility

This section only displays GPU models confirmed to be supported through actual testing by me and others, it does not mean that other GPU models are unsupported. You can search for your device's GPU model in the freedreno_devices.py file (for example, search for 725 for Adreno 725). If the model has a complete device definition, it is likely supported. You are welcome to share how the driver runs on your device in Issues, which will help us improve the table below.

GPUOpenGLOpenGL ESVulkan
Adreno 660✔️ Supported✔️ Supported✔️ Supported
Adreno 710/720/722/730/735/740/750✔️ Supported✔️ Supported✔️ Supported
Adreno 810/829/830/840✔️ Supported✔️ Supported✔️ Supported

Experimental support (by whitebelyash): Adreno 825

Installation

This project's Releases provide two types of installation packages: one installable via the Linux distribution's package manager, and another that must be installed by direct extraction. The first type is recommended; however, if you need the latest Mesa features (such as Adreno 8xx support), use the second type.

If the Turnip driver from the standard release (whose release title doesn't have the turnip- prefix) fails to work properly, you can use the unpatched Turnip driver (whose release title does have the turnip- prefix) by directly installing it over the standard one.

PS: The term "unpatched" mentioned in this project refers to the original patches from xMeM not being applied; however, some necessary patches (such as those for additional GPU support) will still be applied.

Using the Package Manager

Depending on your Linux distribution, go to Releases and download all corresponding packages for a specific release, then follow the installation instructions provided in the release notes. Below are the latest releases for some popular Linux distributions:

Linux DistributionLatest ReleaseUnpatched Turnip driver
Debian 1325.0.7-2+deb13u1turnip-25.0.7-2+deb13u1
Ubuntu 24.04 LTS25.0.7-0ubuntu0.24.04.2turnip-25.0.7-0ubuntu0.24.04.2
Fedora 4325.2.7-4.fc43turnip-25.2.7-4.fc43
Arch Linux26.2.0-4turnip-26.2.0-4

Direct Extraction

[!NOTE]
The .tar.gz installation packages in Releases can only overwrite the existing Mesa drivers. To uninstall, you must manually delete the extracted files. These packages are intended for testing purposes only.

Currently, the "Direct Extraction" way supports the following Linux distributions:

Linux DistributionInstallation package filename suffix
Debian 13debian_trixie_arm64
Ubuntu 24.04 LTSubuntu_noble_arm64
Ubuntu 25.10ubuntu_questing_arm64
Ubuntu 26.04 LTSubuntu_resolute_arm64
Fedora 43fedora_43_arm64
Arch Linuxarchlinux_arm64
Void Linuxvoid_arm64
Alpine 3.24alpine_3.24_arm64
  1. Go to Releases and download the .tar.gz installation packages. Please note the Linux distribution suffix in the filename, such as debian_trixie_arm64. You can only install the package that matches your distribution.
Standard Installation PackageUnpatched Turnip Installation Package (usually not needed)
26.2.0-devel-20260621turnip-26.2.0-devel-20260621

[!NOTE]
For Adreno 7XX & 8XX, it should no longer be necessary to install unpatched Turnip drivers now. Patched Turnip from the standard release should work properly.

If you need the latest possible Mesa upstream features, you can use the Turnip weekly builds: turnip-weekly

turnip-weekly can be used together with standard installation packages (those whose Release titles do not have the turnip- prefix), or it can be used alone (usually with better compatibility). When used alone, you need to change the value of the environment variable MESA_LOADER_DRIVER_OVERRIDE from kgsl to zink.

[!NOTE]
turnip-weekly is built weekly by GitHub Actions by pulling upstream mainline code and is released directly without testing, so various issues may occur. These issues are usually because upstream has not yet finished developing a certain feature, and it is necessary to wait for upstream to complete the development of that feature to resolve them. Therefore, when encountering issues with turnip-weekly, you can switch to other versions of the driver or wait for the next week's build.

  1. Extract the installation package directly to the root directory.
bash
sudo tar -zxvf mesa-for-android-container_26.2.0-devel-xxxxxxxx_debian_trixie_arm64.tar.gz -C /
  1. Refresh the dynamic linker cache.
bash
sudo ldconfig

Uninstallation can be performed by referring to the following commands:

bash
# Copy the file list output by this command tar tf mesa-for-android-container_26.2.0-devel-xxxxxxxx_debian_trixie_arm64.tar.gz | grep -v '/$' | tr '\n' ' ' ; echo cd / # Replace <file-list> with the actual file list sudo rm <file-list> # Reinstall the distribution-maintained Mesa drivers # Debian or Ubuntu: sudo apt update sudo apt install --reinstall libegl-mesa0 libgbm1 libgl1-mesa-dri libglx-mesa0 mesa-libgallium mesa-vulkan-drivers # Fedora: sudo dnf reinstall mesa-filesystem mesa-libglapi mesa-libgbm mesa-libEGL mesa-libGL mesa-vulkan-drivers mesa-dri-drivers mesa-libOpenCL # Arch Linux: sudo pacman -S mesa mesa-docs opencl-mesa vulkan-freedreno vulkan-mesa-implicit-layers vulkan-mesa-layers

Usage

Specify the environment variable MESA_LOADER_DRIVER_OVERRIDE when running a specific program, as follows:

bash
MESA_LOADER_DRIVER_OVERRIDE=kgsl glmark2

Alternatively, add it to the /etc/environment file so it's loaded automatically when the container starts:

plaintext
MESA_LOADER_DRIVER_OVERRIDE=kgsl

[!TIP]
If screen tearing issues occur when running certain programs or games, you can add the following two environment variables to force-enable vertical sync:

bash
vblank_mode=3 MESA_VK_WSI_PRESENT_MODE=mailbox

Development

If you are a developer and want to build the drivers from this project or contribute code, please refer to the development documentation.

Benchmarks

Detailed test results: benchmark-result

DeviceSoCGPUContainer Typeglmark2glmark2-es2vkmark
Redmi K40 ProSnapdragon 888Adreno 660LXC8427711170
Xiaomi Pad 6 ProSnapdragon 8+ Gen 1Adreno 730Chroot136012222669
REDMI K80 ProSnapdragon 8 EliteAdreno 830PRoot221122061153
OnePlus 15Snapdragon 8 Elite Gen 5Adreno 840PRoot35743621Not tested

Acknowledgements

  • Lucas Fryzek: Author of the KGSL backend code for the Mesa Freedreno driver.
  • xMeM: For porting the Freedreno driver's KGSL backend to Termux:X11.
  • Robert Kirkman: For integrating and improving xMeM's patches.
  • Rob Clark: For adding Freedreno (including Turnip) support for Adreno Gen8 architecture (including Adreno 840).
  • whitebelyash: Add experimental support for Adreno 825.
  • Termux maintenance team and contributors: Developed a series of patches for the normal operation of Mesa drivers on Termux.

Star History

<a href="https://www.star-history.com/?repos=lfdevs%2Fmesa-for-android-container&type=date&legend=top-left"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=lfdevs/mesa-for-android-container&type=date&theme=dark&legend=top-left" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=lfdevs/mesa-for-android-container&type=date&legend=top-left" /> <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=lfdevs/mesa-for-android-container&type=date&legend=top-left" /> </picture> </a>

Contributors

Showing top 12 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from lfdevs/mesa-for-android-container via the GitHub API.Last fetched: 6/29/2026