gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

Local build fails with latest Vulkan headers (KOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=OFF)

Open glaubitz opened this issue 9 months ago • 7 comments
trafficstars

The embedded copy of kompute fails to build with GCC 15 for two reasons.

For one, there is an issue with the declaration of vk:

[   33s] cd /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/build/deps/llama.cpp-mainline/ggml/src/kompute/src && /usr/bin/c++ -DFMT_HEADER_ONLY=1 -DFMT_SHARED -DKOMPUTE_DISABLE_VK_DEBUG_LAYERS=1 -DKOMPUTE_OPT_ACTIVE_LOG_LEVEL=KOMPUTE_LOG_LEVEL_CRITICAL -DKOMPUTE_OPT_BUILT_IN_VULKAN_HEADER_TAG -DKOMPUTE_OPT_DISABLE_VK_DEBUG_LAYERS -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK -DKOMPUTE_OPT_LOG_LEVEL -DKOMPUTE_OPT_USE_BUILT_IN_SPDLOG -DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 -I/home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/build -I/home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include -I/home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/build/deps/llama.cpp-mainline/ggml/src/kompute/src/shaders/glsl -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wall -Wextra -Wpedantic -Werror -Wno-error=array-bounds -O2 -g -DNDEBUG -std=gnu++14 -fPIC -MD -MT deps/llama.cpp-mainline/ggml/src/kompute/src/CMakeFiles/kompute.dir/Manager.cpp.o -MF CMakeFiles/kompute.dir/Manager.cpp.o.d -o CMakeFiles/kompute.dir/Manager.cpp.o -c /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp
[   33s] In file included from /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:3:
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Manager.hpp:258:25: error: ‘DynamicLoader’ is not a member of ‘vk’; did you mean ‘DynamicState’?
[   33s]   258 |     std::shared_ptr<vk::DynamicLoader> mDynamicLoader = nullptr;
[   33s]       |                         ^~~~~~~~~~~~~
[   33s]       |                         DynamicState
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Manager.hpp:258:25: error: ‘DynamicLoader’ is not a member of ‘vk’; did you mean ‘DynamicState’?
[   33s]   258 |     std::shared_ptr<vk::DynamicLoader> mDynamicLoader = nullptr;
[   33s]       |                         ^~~~~~~~~~~~~
[   33s]       |                         DynamicState
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Manager.hpp:258:38: error: template argument 1 is invalid
[   33s]   258 |     std::shared_ptr<vk::DynamicLoader> mDynamicLoader = nullptr;
[   33s]       |                                      ^
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Manager.hpp:258:57: error: cannot convert ‘std::nullptr_t’ to ‘int’ in initialization
[   33s]   258 |     std::shared_ptr<vk::DynamicLoader> mDynamicLoader = nullptr;
[   33s]       |                                                         ^~~~~~~
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Manager.hpp: In member function ‘bool kp::Manager::hasVulkan() const’:
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Manager.hpp:42:37: error: request for member ‘get’ in ‘((const kp::Manager*)this)->kp::Manager::mDynamicLoader’, which is of non-class type ‘const int’
[   33s]    42 |         return this->mDynamicLoader.get();
[   33s]       |                                     ^~~
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp: In member function ‘void kp::Manager::createInstance()’:
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:184:47: error: ‘DynamicLoader’ is not a member of ‘vk’; did you mean ‘DynamicState’?
[   33s]   184 |         mDynamicLoader = std::make_shared<vk::DynamicLoader>();
[   33s]       |                                               ^~~~~~~~~~~~~
[   33s]       |                                               DynamicState
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:184:47: error: ‘DynamicLoader’ is not a member of ‘vk’; did you mean ‘DynamicState’?
[   33s]   184 |         mDynamicLoader = std::make_shared<vk::DynamicLoader>();
[   33s]       |                                               ^~~~~~~~~~~~~
[   33s]       |                                               DynamicState
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:184:61: error: no matching function for call to ‘make_shared<<expression error> >()’
[   33s]   184 |         mDynamicLoader = std::make_shared<vk::DynamicLoader>();
[   33s]       |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:184:61: note: there is 1 candidate
[   33s] In file included from /usr/include/c++/15/memory:82,
[   33s]                  from /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Tensor.hpp:6,
[   33s]                  from /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Algorithm.hpp:7,
[   33s]                  from /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/operations/OpAlgoDispatch.hpp:4,
[   33s]                  from /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Sequence.hpp:6,
[   33s]                  from /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/include/kompute/Manager.hpp:9:
[   33s] /usr/include/c++/15/bits/shared_ptr.h:1003:5: note: candidate 1: ‘template<class _Tp, class ... _Args> std::shared_ptr<typename std::enable_if<(! std::is_array<_Tp>::value), _Tp>::type> std::make_shared(_Args&& ...)’
[   33s]  1003 |     make_shared(_Args&&... __args)
[   33s]       |     ^~~~~~~~~~~
[   33s] /usr/include/c++/15/bits/shared_ptr.h:1003:5: note: template argument deduction/substitution failed:
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:184:61: error: template argument 1 is invalid
[   33s]   184 |         mDynamicLoader = std::make_shared<vk::DynamicLoader>();
[   33s]       |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:190:21: error: base operand of ‘->’ is not a pointer
[   33s]   190 |       mDynamicLoader->getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
[   33s]       |                     ^~
[   33s] /home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/deps/llama.cpp-mainline/ggml/src/kompute/src/Manager.cpp:190:63: error: expected primary-expression before ‘>’ token
[   33s]   190 |       mDynamicLoader->getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
[   33s]       |                                                               ^
[   33s] make[2]: *** [deps/llama.cpp-mainline/ggml/src/kompute/src/CMakeFiles/kompute.dir/build.make:96: deps/llama.cpp-mainline/ggml/src/kompute/src/CMakeFiles/kompute.dir/Manager.cpp.o] Error 1
[   33s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/python-gpt4all-3.4.2-build/gpt4all-3.4.2/gpt4all-backend/build'
[   33s] make[2]: *** Waiting for unfinished jobs....

And, secondly, there is an issue with the declarations of the functions ftell() and strtol() in the embedded copy of xxd.c (see: https://github.com/KomputeProject/kompute/issues/410).

glaubitz avatar Feb 06 '25 07:02 glaubitz