Skip to content

vulkan in termux #584

Description

@liuw1535

Image
I am unable to use Vulkan on Snapdragon 870 Android devices. Here is my construction process:
Due to the lack of glslc, I deployed shaderc first, and the build command is:

cmake -GNinja \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-24 \
-DSHADERC_SKIP_TESTS=ON \
..
ninja

Afterwards, copy the compiled glslc to/data/data/com. termux/files/usr/bin/
Now that glslc has been obtained, use the instructions in sd.cpp to build:

cmake .. -DSD_VULKAN=ON
cmake --build . --config Release

Finally, the SD binary file was obtained, but it cannot be used.
The above content is machine translation

Activity

  1. vmobilis commented on Feb 3, 2025

    @vmobilis
    Contributor

    @liuw1535, hello, try latest master of ggml, I used ggml/475e012 commit, it seems to work. (Sort of 🙃, Vulkan version is 4 times slower than CPU for me, don't know why).
    Though I built with Clang from Termux, not from NDK.
    (And since I don't have Adreno, I used "vulkan-loader-android" package).

    Full image.

  2. vmobilis commented on Feb 12, 2025

    @vmobilis
    Contributor

    @liuw1535, out of curiosity, have you managed to run it? Maybe it also depends on version of "glslc" Vulkan compiler, I used this version of shaderc: google/shaderc@f5d626f .

  3. xhy2008 commented on Feb 16, 2026

    @xhy2008

    @vmobilis
    I tried the latest commit of ggml,and changed from vulkan-loader-generic to vulkan-loader-android.But it still cannot find my gpu(Mali).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions