diff --git a/.github/workflows/fork-validate.yml b/.github/workflows/fork-validate.yml new file mode 100644 index 00000000000..95c90aaaf09 --- /dev/null +++ b/.github/workflows/fork-validate.yml @@ -0,0 +1,19 @@ +name: Fork Validate + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Verify cmake project layout + run: | + cmake --version + test -f CMakeLists.txt + test -f ggml/CMakeLists.txt + echo "llama.cpp fork layout ok" \ No newline at end of file diff --git a/FORK.md b/FORK.md new file mode 100644 index 00000000000..373c8034ea4 --- /dev/null +++ b/FORK.md @@ -0,0 +1,25 @@ +# Nueramarcos/llama.cpp + +Personal fork of [ggml-org/llama.cpp](https://github.com/ggml-org/llama.cpp). + +Scope: local validation and smoke checks only — not a distribution fork. + +## Quick validate + +```bash +git clone https://github.com/Nueramarcos/llama.cpp.git +cd llama.cpp +cmake --version +test -f CMakeLists.txt && test -f ggml/CMakeLists.txt && echo ok +``` + +## Build hint + +```bash +cmake -B build +cmake --build build -j +``` + +Upstream: https://github.com/ggml-org/llama.cpp + +Maintained by [Nueramarcos](https://github.com/Nueramarcos). \ No newline at end of file diff --git a/README.md b/README.md index 0652d13f296..b210fabeb5d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # llama.cpp +## Fork Notice + +Maintained by [Nueramarcos](https://github.com/Nueramarcos). See [FORK.md](FORK.md). + ![llama](https://raw.githubusercontent.com/ggml-org/llama.brand/refs/heads/master/cover/llama-cpp/cover-llama-cpp-dark.svg) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) diff --git a/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp b/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp index ca6b4443141..05a27925146 100644 --- a/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp +++ b/ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ std::mutex lock; std::vector> shader_fnames; +static std::atomic compile_failed{false}; std::locale c_locale("C"); std::string GLSLC = "glslc"; @@ -78,7 +80,7 @@ enum MatMulIdType { namespace { -void execute_command(std::vector& command, std::string& stdout_str, std::string& stderr_str) { +int execute_command(std::vector& command, std::string& stdout_str, std::string& stderr_str) { #ifdef _WIN32 HANDLE stdout_read, stdout_write; HANDLE stderr_read, stderr_write; @@ -127,8 +129,11 @@ void execute_command(std::vector& command, std::string& stdout_str, CloseHandle(stdout_read); CloseHandle(stderr_read); WaitForSingleObject(pi.hProcess, INFINITE); + DWORD exit_code = 1; + GetExitCodeProcess(pi.hProcess, &exit_code); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); + return (int) exit_code; #else int stdout_pipe[2]; int stderr_pipe[2]; @@ -175,9 +180,12 @@ void execute_command(std::vector& command, std::string& stdout_str, close(stdout_pipe[0]); close(stderr_pipe[0]); - waitpid(pid, nullptr, 0); + int status = 0; + waitpid(pid, &status, 0); + return WIFEXITED(status) ? WEXITSTATUS(status) : -1; } #endif + return -1; } bool directory_exists(const std::string& path) { @@ -372,13 +380,14 @@ void string_to_spv_func(std::string name, std::string in_path, std::string out_p // } // std::cout << std::endl; - execute_command(cmd, stdout_str, stderr_str); - if (!stderr_str.empty()) { - std::cerr << "cannot compile " << name << "\n\n"; + int exit_code = execute_command(cmd, stdout_str, stderr_str); + if (exit_code != 0 || !stderr_str.empty()) { + std::cerr << "cannot compile " << name << " (exit code " << exit_code << ")\n\n"; for (const auto& part : cmd) { std::cerr << part << " "; } std::cerr << "\n\n" << stderr_str << std::endl; + compile_failed.store(true); return; } @@ -398,6 +407,7 @@ void string_to_spv_func(std::string name, std::string in_path, std::string out_p shader_fnames.push_back(std::make_pair(name, out_path)); } catch (const std::exception& e) { std::cerr << "Error executing command for " << name << ": " << e.what() << std::endl; + compile_failed.store(true); } } @@ -1251,6 +1261,11 @@ int main(int argc, char** argv) { process_shaders(); + if (compile_failed.load()) { + std::cerr << "vulkan-shaders-gen: one or more shaders failed to compile" << std::endl; + return EXIT_FAILURE; + } + write_output_files(); return EXIT_SUCCESS;