ggerganov / llama.cpp

LLM inference in C/C++
MIT License
60.95k stars 8.7k forks source link

Vulkan CMake integration #8119

Open bandoti opened 3 days ago

bandoti commented 3 days ago

This change introduces a make and CMake build target for Vulkan shaders per #5356. This ensures ggml-vulkan-shaders.hpp is generated at build time (instead of storing in SCM). In addition, ggml-vulkan-shaders.cpp is added to move compiled shaders into its own translation unit.

In addition, this change updates the relocatable CMake package to link against the new ggml library.

bandoti commented 3 days ago

The ubuntu-22-cmake-vulkan build is failing due to missing glslc executable. Looks like there's a couple ways to get the dependency on Ubuntu.

netrunnereve commented 3 days ago

It's worth noting here that this will add glslc as a dependency on top of the Vulkan libs for anyone wishing to build this from scratch. This pretty much makes the Vulkan SDK a requirement unless they can get glslc from somewhere else.

bandoti commented 2 days ago

I agree the Vulkan SDK is somewhat heavy dependency and pulls in lots of graphics-related dependencies. For Arch and MSYS2 there are the vulkan-devel and shaderc packages. There appears to be similar packages for Ubuntu (newer than v 22) though I haven't been able to test those.

bandoti commented 1 day ago

I have completed all the required code changes including fixes from source refactor in master branch. So please feel free to begin review now! :)