Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/fork-validate.yml
Original file line number Diff line number Diff line change
@@ -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"
25 changes: 25 additions & 0 deletions FORK.md
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
25 changes: 20 additions & 5 deletions ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <future>
#include <queue>
#include <condition_variable>
#include <atomic>
#include <cstdio>
#include <cstring>
#include <cstdlib>
Expand All @@ -34,6 +35,7 @@

std::mutex lock;
std::vector<std::pair<std::string, std::string>> shader_fnames;
static std::atomic<bool> compile_failed{false};
std::locale c_locale("C");

std::string GLSLC = "glslc";
Expand Down Expand Up @@ -78,7 +80,7 @@ enum MatMulIdType {

namespace {

void execute_command(std::vector<std::string>& command, std::string& stdout_str, std::string& stderr_str) {
int execute_command(std::vector<std::string>& command, std::string& stdout_str, std::string& stderr_str) {
#ifdef _WIN32
HANDLE stdout_read, stdout_write;
HANDLE stderr_read, stderr_write;
Expand Down Expand Up @@ -127,8 +129,11 @@ void execute_command(std::vector<std::string>& 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];
Expand Down Expand Up @@ -175,9 +180,12 @@ void execute_command(std::vector<std::string>& 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) {
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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;
Expand Down