llama.cpp
llama.cpp copied to clipboard
Fix Vulkan glslc invocation command lines
They were shoehorned through a Windows-style string representation, where the entire command line is just a space-separated string of arguments. If any arguments contain spaces, you have to escape them. This was implemented in https://github.com/ggml-org/llama.cpp/pull/8573, however, the issue remains on Unix.
Usually, this would NOT be an issue on Unix, because it doesn't have the braindead Windows-style API that only takes a flat string as a command line. In Unix, you can pass the arguments as a legit array. However, Llama.cpp didn't make use of that; instead running sh -c <the flattened argument string>. Thereby inflicting the same problems onto itself as Windows has.
Instead of bandaid-fixing this by also slapping quotes around the path arguments (which would also break apart as soon as the path contains quote characters), I decided to fix it properly.
So, the code now doesn't wrap the command line in sh -c, but passes the arguments directly, circumventing the need to do any brittle escaping.
This also necessitated replacing the coopmat ? "" : "-O" parameter with a proper conditional parameter. Because the empty string parameter (rightfully) confused glslc.
Fixes #13288