Conversation
- Concepts used to implement `listenfd-32-bit-android.diff` based on similar patches found in other packages like `fish` and `below` - `S_IFMT` is not the same type as `st_mode` on 32-bit Android - `socklen_t` should be passed to `getsockname()` and `getsockopt()`, not `unsigned int` - Based on this comment, `wasmtime` now has a codepath that supports 32-bit ARM: bytecodealliance/wasmtime#1173 (comment) - This build of `wasmtime` has been tested on a 32-bit ARM Android device to run a precompiled `wasi-hello-world.wasm` that was copied from a different device, and is working successfully: - The `wasi-hello-world.wasm` was compiled using a GNU/Linux PC running the `cargo install cargo-component` tool via a Rust toolchain https://github.com/bytecodealliance/cargo-component ``` ~ $ wasmtime wasi-hello-world.wasm Hello, world! ~ $ uname -a Linux localhost 3.4.112-Lineage-g716f00ee2e8 #1 SMP PREEMPT Sun Oct 13 11:16:54 CDT 2019 armv7l Android ~ $ ``` - 32-bit x86 still has an error which is different and does not appear during the build for 32-bit ARM
…anitizer instead of the shared library - Makes the default behavior of on-device building with the address sanitizer match the default behavior of building with the address sanitizer on Clang for Desktop Linux distros, which is to use the static library - Fixes termux#26485 - On devices that do not have `libclang_rt.asan-$arch-android.so` or which have a corrupted one, fixes building on-device with `-fsanitize=address` - Samsung Galaxy S III SPH-L710 with LineageOS 14.1 Android 7.1.2 before: ``` ~ $ clang test.c -fsanitize=address ~ $ ./a.out WARNING: linker: /data/data/com.termux/files/home/a.out: unsupported flags DT_FLAGS_1=0x8000001 CANNOT LINK EXECUTABLE "./a.out": library "libclang_rt.asan-arm-android.so" not found Aborted ./a.out ~ $ clang test.c -fsanitize=address -Wl,-rpath=$PREFIX/lib/clang/20/lib/linux ~ $ ./a.out WARNING: linker: /data/data/com.termux/files/home/a.out: unsupported flags DT_FLAGS_1=0x8000001 ~ $ termux-elf-cleaner ./a.out termux-elf-cleaner: Replacing unsupported DF_1_* flags 134217729 with 1 in './a.out' ~ $ ./a.out ~ $ file /system/lib/libclang_rt.asan-arm-android.so /system/lib/libclang_rt.asan-arm-android.so: cannot open `/system/lib/libclang_rt.asan-arm-android.so' (No such file or directory) ~ $ ``` - After: ``` ~ $ clang test.c -fsanitize=address ~ $ ./a.out WARNING: linker: /data/data/com.termux/files/home/a.out: unsupported flags DT_FLAGS_1=0x8000001 ~ $ termux-elf-cleaner a.out termux-elf-cleaner: Replacing unsupported DF_1_* flags 134217729 with 1 in 'a.out' ~ $ ./a.out ~ $ ``` - Vivo iQOO Neo8 V2301A with Android 15 before: ``` thread #1, name = 'a.out', stop reason = signal SIGILL: illegal opcode ``` - After: believed to work
7feae7d to
5db7b1b
Compare
|
You can find the build artifacts here: https://github.com/lfdevs/termux-packages/actions/runs/21595714278?pr=1#artifacts Tip Since GitHub Actions artifacts expire after 90 days, I'm providing the extracted For general GPUs: vulkan-wrapper-android_25.0.0.zip For newer Mali GPUs (such as |
|
You can refer to the following commands to enable hardware acceleration using Android's Vulkan driver inside a Termux native container: # Copy or download `vulkan-wrapper-android_25.0.0_aarch64.deb` into the current directory
# Remove packages that may conflict with this guide
pkg remove mesa-zink* vulkan-loader-android
# Install required packages
pkg update && pkg upgrade
pkg install x11-repo
pkg install termux-x11-nightly mesa
pkg install ./vulkan-wrapper-android_25.0.0_aarch64.deb
# Set environment variables
export DISPLAY=:0 MESA_LOADER_DRIVER_OVERRIDE=zink
# Start Termux:X11
kill -9 $(pgrep -f "termux.x11") 2>/dev/null
termux-x11 :0 -dpi 96 &
# Optional steps below
# Install related utilities
pkg install mesa-demos vulkan-tools vkmark glmark2
# Check GLX info
glxinfo
# Check Vulkan info
vulkaninfo
# Run performance benchmarks
vkmark && glmark2 && glmark2-es2 |
BenchmarksOverview
Detailed test resultsAdreno 830vkmarkglmark2 (Zink)glmark2-es2 (Zink)Mali-G78 MP20vkmarkglmark2 (Zink)glmark2-es2 (Zink)Adreno 730vkmarkglmark2 (Zink)glmark2-es2 (Zink) |
|
@lfdevs Thank you very much for this build, my termux run straight away without problem. |
|
with termux having 25.3.3 mesa i am getting segfaults on everything. could you please bump the package versions? |
This driver should work fine even when paired with the latest kill -9 $(pgrep -f "termux.x11") 2>/dev/null
termux-x11 :0 -dpi 96 &
DISPLAY=':0' VK_DRIVER_FILES=/data/data/com.termux/files/usr/share/vulkan/icd.d/wrapper_icd.aarch64.json vkcube |
|
Do I need to start the virgl server first? I am on a pixel 10 pro |
This driver is intended only for Termux Native and cannot be used in PRoot or other containers. Therefore, components like VirGL or VirPipe are unnecessary. Simply set the following environment variables: MESA_LOADER_DRIVER_OVERRIDE=zink
VK_DRIVER_FILES=/data/data/com.termux/files/usr/share/vulkan/icd.d/wrapper_icd.aarch64.jsonThen launch your application or the |
|
It just segfaults :/ how can I even debug it |
Please upgrade all Termux packages first: pkg upgrade
pkg install termux-x11-nightlyThen install the latest Termux:X11 APK: https://github.com/termux/termux-x11/releases/download/nightly/app-arm64-v8a-debug.apk and run the previously mentioned tests to see if they work properly. If it still doesn't work, please execute the following command (output all installed packages) and upload the apt list --installed > ~/storage/downloads/termux-debug-info.txt |
|
termux-debug-info.txt |
The PKG list is fine; all the required packages have been installed. You can also try installing the Since the Pixel 10 Pro does not use an Adreno GPU, you only need to install If it still doesn't work, it might be because the Pixel 10 Pro uses a GPU with the PowerVR/Imagination DXT architecture, rather than the common Adreno or Mali. Its closed-source drivers currently cannot be used even through |
|
yeah it still just segfaults. i have several issues with things that need vulkan. ie gamehub and winlator could not run dxvk. however a fork of winlator named star worked oot with a newish dxvk thanks for the help though |
3c10072 to
0c26639
Compare
Thanks for your patch, I've just added it, you can now try it on your Pixel 10 Pro to see if it works properly. https://github.com/lfdevs/termux-packages/actions/runs/21595714278?pr=1#artifacts |
|
yeah it works 👍 |
|
@lfdevs When running Blender 4.5 with a Vulkan backend, it works flawlessly without any errors! One minor drawback is that a "wrapper" related message appears in both the zink and Vulkan environments. Could you please ensure that the message below is not displayed in the next build version? |
|
@lfdevs Surprisingly, the results were that it worked without any issues in almost all environments. The Vulkan backend even operated much more stably than
- No artifacts or glitches whatsoever in the Blender5 GUI - No issues in general 3D work environments - Rendering works well However, artifacts still occur in the 3D viewer when modeling with specific shaders. Compared to the early days of Even if artifacts occur in the 3D viewer, rendering works perfectly without any issues! However, In the case of the Galaxy S25 Ultra's The rendering results also come out strangely. From what I've seen, the most stable way to run
@robertkirkman I look forward to the next build of Blender5! |
|
The newest version of blender is currently 5.0.1, when new versions of blender appear here, i download and compile them in termux: |
|
oh never mind, there is new blender 5.1 actually, here https://download.blender.org/release/Blender5.1/ I will try to compile blender 5.1 |
|
I tried to compile blender 5.1 but I have this error, I don't know how to fix this but I can try |
|
I compiled Blender 5.1, but unfortunately, it has an error and I don't understand how to fix it 😿 |
|
I'm not sure if the test situation under PRoot is useful for Termux Native, but perhaps it can be used for reference: When I previously tried to build Blender v5.0.1 (including its dependencies) using a But when I tried to build Blender v5.1.0 yesterday, I only added one patch to exclude ROCm, and it built successfully directly. Moreover, Adreno 830 could run it successfully using both the OpenGL backend (with Freedreno) and the Vulkan backend (with Turnip). Although the OpenGL backend still flickers severely and the Vulkan backend even only displays the window frame, this is also good news for me. I don't know if this is because Blender upstream updated the dependencies for 5.1 (the other three patches for dependencies are no longer needed), or simply because I changed the source from a GitHub mirror to the official Blender repository. |
…erVR GPUs This patch is from @nicman23: https://gitlab.freedesktop.org/nicman23/mesa/-/commit/d3eec9f0c4a45a96dc6ea7cb4f469e49cf64d3ed The previous implementation used a fixed-size static array of 16 VkPhysicalDevice handles, which could cause a segfault on certain drivers (notably PowerVR DXT-48 on Pixel 10 devices) when the driver's behavior with the pre-allocated array differed from expectations. Replace the static array with dynamic allocation: i. Query the actual device count first by calling EnumeratePhysicalDevices with NULL ii. Allocate the array based on the returned count iii. Handle VK_INCOMPLETE by reallocating with a larger size iv. Add proper error handling and memory cleanup This follows the Vulkan specification more closely and should be more robust across different driver implementations. Fixes: segfault on PowerVR DXT-48 GPU
5f8dbf6 to
5bf6e4c
Compare
|
@lfdevs The
all result in a black screen and fail to run.
|
977504c to
6969fec
Compare
@hansm629 Please try this latest build: https://github.com/lfdevs/termux-packages/actions/runs/34682118138?pr=1#artifacts |
|
@lfdevs
|
|
@lfdevs It doesn't seem to carry any particular significance. |
|
@lfdevs
With the previous build,
After reviewing the latest commits and source code, I think there are a few areas that may still need attention.
The latest commit adds: REQUIRED_EXTENSION(KHR_synchronization2) However, this only appears to enable/forward the extension to the underlying Android VkDevice. Mesa 26.3 WSI internally uses vkQueueSubmit2(), which also requires the actual feature to be enabled through something such as: or: in the host-side An application such as vkcube or vkmark may not explicitly request synchronization2, while the Mesa WSI implementation still requires it internally. Therefore, I think application-visible/requested features and wrapper-internal host requirements should be handled separately, for example: Also, That fallback may remove the internal synchronization2 feature chain as well. It may be better to preserve wrapper-required host features even in the fallback path. For diagnosis, logging the actual return value of and... The latest code appears to modify the result of both to: Some applications and compatibility layers use the GPU name string for vendor-specific workarounds or profiles. For a generic wrapper, it would be safer to preserve the original vendor If device-name overriding is needed, it could be enabled only when Wrapper identification could instead be exposed through and Since these appear to be debugging leftovers from the PowerVR enumeration work, it would be preferable to either remove them or print them only when the wrapper debug/logging option is enabled. and Recent commits add many features at once, including BCn emulation, SPIR-V workarounds, Mali/DXVK-specific workarounds, feature overrides, resource tracking, etc. These may be very useful for gaming/DXVK and specific Mali proprietary drivers, but for a generic Android Vulkan wrapper, changing default capabilities globally can introduce regressions on other vendors. For example, I think the following should ideally be gated behind a vendor + driver version + application/engine condition, or an explicit compatibility profile:
If the black screen remains after properly enabling the host synchronization2 feature, I think the Android WSI port should be the next area to bisect. In particular, commit:
makes substantial changes to the previous AHB/Android WSI path. A useful A/B test may be: It may be easier to first establish a minimal Mesa 26.3 wrapper state where vkcube can successfully present, and then re-introduce the BCn/SPIR-V/GPU-specific compatibility features incrementally. Thank you! |














Original PR by @xMeM : termux#22500
Current version:
26.3.0-devel-20260824Source code: https://github.com/lfdevs/mesa-for-android-container/tree/termux/vulkan-wrapper-android