-
Notifications
You must be signed in to change notification settings - Fork 1
addpkg(main/vulkan-wrapper-android): Android Vulkan wrapper #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
|
You can find the build artifacts here: https://github.com/lfdevs/termux-packages/actions/runs/19142566199#artifacts Since GitHub Actions artifacts expire after 90 days, I’m providing the extracted vulkan-wrapper-android_25.0.0.zip PS: Please ignore the CI errors in this PR—the resulting |
|
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 |
Original PR by @xMeM : termux#22500
Patches by @robertkirkman : termux#22500 (comment)