diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..225d4a9 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1781577229, + "narHash": "sha256-lrp67w8AulE9Ks53n27I45ADSzbOCn4H+CNW1Ck8B+8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "567a49d1913ce81ac6e9582e3553dd90a955875f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..66d4e46 --- /dev/null +++ b/flake.nix @@ -0,0 +1,56 @@ +{ + description = "qwen3-tts.cpp — dev environment (C++/GGML, CPU + Vulkan)"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + + # Vulkan toolchain needed to build ggml with -DGGML_VULKAN=ON: + # glslc/glslangValidator compile the .comp shaders, the loader + + # headers provide the API, spirv-tools links the shader pipeline. + vulkanInputs = [ + pkgs.vulkan-headers + pkgs.vulkan-loader + pkgs.shaderc # glslc + pkgs.glslang + pkgs.spirv-tools + pkgs.spirv-headers + ]; + in + { + devShells.default = pkgs.mkShell { + packages = [ + pkgs.cmake + pkgs.ninja + pkgs.pkg-config + pkgs.git + # Runtime/diagnostic helpers + pkgs.vulkan-tools # vulkaninfo + ] ++ vulkanInputs; + + # ggml's CMake finds Vulkan via the standard module; make sure the + # loader is also on the runtime path so the built CLI/libs resolve + # libvulkan when GGML_VULKAN is enabled. + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.vulkan-loader ]; + + shellHook = '' + echo "qwen3-tts.cpp dev shell" + echo " cmake: $(cmake --version | head -1)" + echo " glslc: $(glslc --version 2>/dev/null | head -1)" + echo + echo "Build ggml (CPU+Vulkan):" + echo " cmake -S ggml -B ggml/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DGGML_VULKAN=ON" + echo " cmake --build ggml/build -j" + echo "Build qwen3-tts:" + echo " cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release" + echo " cmake --build build -j" + ''; + }; + }); +} diff --git a/ggml b/ggml index 5cecdad..3af5f57 160000 --- a/ggml +++ b/ggml @@ -1 +1 @@ -Subproject commit 5cecdad692d868e28dbd2f7c468504770108f30c +Subproject commit 3af5f5760e19a96427f5f7a93b79cbdf3d4b265b