-
Notifications
You must be signed in to change notification settings - Fork 0
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 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 MP20glmark2-es2 (Zink)glmark2 (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. |
Original PR by @xMeM : termux#22500
Patches by @robertkirkman : termux#22500 (comment)