Skip to content

Revert to C style construciton for termux portability#114

Open
arsalan-anwari-tether wants to merge 1 commit intotetherto:masterfrom
arsalan-anwari-tether:fix/vulkan-device-create-on-trmux
Open

Revert to C style construciton for termux portability#114
arsalan-anwari-tether wants to merge 1 commit intotetherto:masterfrom
arsalan-anwari-tether:fix/vulkan-device-create-on-trmux

Conversation

@arsalan-anwari-tether
Copy link
Copy Markdown

Needed pkg in termux:

git git-lfs cmake vulkan-tools vulkan-headers shaderc vulkan-loader-android libandroid-spawn

In termux when compiling with -DGGML_VULKAN=ON there seems to be a hard crash. This has to due with how the contructor for a vulkan device is setup. Reverting back to an older C style seems to solve this for Termux on Android.

See error:

In file included from /data/data/com.termux/files/home/qvac-fabric-llm.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:30:
/data/data/com.termux/files/home/qvac-fabric-llm.cpp/ggml/src/ggml-vulkan/../../../vendor/vma/VmaUsage.h:106:36: warning: 
      unknown warning group '-Wsuggest-attribute=noreturn', ignored [-Wunknown-warning-option]
  106 |     #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn"
      |                                    ^
/data/data/com.termux/files/home/qvac-fabric-llm.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:5101:28: error: 
      no viable overloaded '='
 5101 |         device_create_info = {
      |         ~~~~~~~~~~~~~~~~~~ ^ ~
 5102 |             vk::DeviceCreateFlags(),
      |             ~~~~~~~~~~~~~~~~~~~~~~~~
 5103 |             device_queue_create_infos,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~
 5104 |             {},
      |             ~~~
 5105 |             device_extensions
      |             ~~~~~~~~~~~~~~~~~
 5106 |         };
      |         ~
/data/data/com.termux/files/usr/bin/../../usr/include/vulkan/vulkan_structs.hpp:50280:24: note: 
      candidate function not viable: cannot convert initializer list argument to 'const DeviceCreateInfo'
 50280 |     DeviceCreateInfo & operator=( DeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default;
       |                        ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/bin/../../usr/include/vulkan/vulkan_structs.hpp:50294:24: note: 
      candidate function not viable: cannot convert initializer list argument to 'const VkDeviceCreateInfo'
 50294 |     DeviceCreateInfo & operator=( VkDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT
       |                        ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
make[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/build.make:1016: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2317: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@arsalan-anwari-tether
Copy link
Copy Markdown
Author

Has not been tested yet, please wait before merge

@arsalan-anwari-tether
Copy link
Copy Markdown
Author

Tested on phone Blackview BL7000. Compiles and runs models. Can some review? I cannot assign anyone sadly. CI always fails for ubuntu-24-cmake-vulkan i am not sure the job is defined properly, who can i contact regarding this @JamieBohannaWebDev

@JamieBohannaWebDev
Copy link
Copy Markdown

Wow I've never heard of a Blackview phone before!

@gianni-cor May be able to shed some light @arsalan-anwari-tether

@arsalan-anwari-tether
Copy link
Copy Markdown
Author

@gianni-cor @zoq Please review this change.

@zoq
Copy link
Copy Markdown

zoq commented Apr 4, 2026

I tested it on top of the rebase branch, and everything still works. I can cherry pick the commits and apply them on top of the rebase branch, mainly because I think we don't want to merge into master right now?

@arsalan-anwari-tether
Copy link
Copy Markdown
Author

I tested it on top of the rebase branch, and everything still works. I can cherry pick the commits and apply them on top of the rebase branch, mainly because I think we don't want to merge into master right now?

I am not sure, this change is minor whilist yours is much comprehensive. Might be easier to undo your or my changes with two seperate prs. just revert the pr itself.

otherwise if you add my changes to your pr will you stil see the author of the commit/pr? So people can contact me if something is not correct or for further questions.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants