From 2da41055fea0837bfe051fa90e71e4ec96f5caf9 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sat, 13 Jul 2024 22:07:17 +0300 Subject: [PATCH] koboldcpp: remove march, mtune and mtune After going over a detailed conversation with @SomeoneSerge about `cc-warpper`, `march` `mtune` and `mcpu`, I've come to the conclusion that it is unnecessary to have those flags as ad hoc options. Instead, it's best for users to "merge" their own `env` on top of the current one Refs: https://github.com/NixOS/nixpkgs/pull/325540#discussion_r1674917673 Refs: https://github.com/NixOS/nixpkgs/pull/325540#discussion_r1676059901 Refs: https://github.com/NixOS/nixpkgs/pull/325540#discussion_r1676556732 Refs: https://github.com/NixOS/nixpkgs/pull/325540#discussion_r1676560445 Co-authored-by: SomeoneSerge --- pkgs/by-name/ko/koboldcpp/package.nix | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/pkgs/by-name/ko/koboldcpp/package.nix b/pkgs/by-name/ko/koboldcpp/package.nix index decf34d27694..23b0f21bdac8 100644 --- a/pkgs/by-name/ko/koboldcpp/package.nix +++ b/pkgs/by-name/ko/koboldcpp/package.nix @@ -19,6 +19,9 @@ openblas, cublasSupport ? config.cudaSupport, + # You can find a full list here: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ + # For example if you're on an GTX 1080 that means you're using "Pascal" and you need to pass "sm_60" + arches ? cudaPackages.cudaFlags.arches or [ ], clblastSupport ? stdenv.isLinux, clblast, @@ -28,19 +31,6 @@ vulkan-loader, metalSupport ? stdenv.isDarwin && stdenv.isAarch64, - - # You can find a full list here: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ - # For example if you're on an GTX 1080 that means you're using "Pascal" and you need to pass "sm_60" - arches ? cudaPackages.cudaFlags.arches or [ ], - - # You can find list of x86_64 options here: https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html - # For ARM here: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html - # If you set "march" to "native", specify "mtune" as well; otherwise, it will be set to "generic". (credit to: https://lemire.me/blog/2018/07/25/it-is-more-complicated-than-i-thought-mtune-march-in-gcc/) - march ? "", - # Apple Silicon Chips (M1, M2, M3 and so on DO NOT use mtune) - # For example, if you have an AMD Ryzen CPU, you will set "mtune" to "znver2" - mtune ? "", - mcpu ? "", }: let @@ -116,12 +106,6 @@ effectiveStdenv.mkDerivation (finalAttrs: { env.NIX_LDFLAGS = lib.concatStringsSep " " (finalAttrs.darwinLdFlags ++ finalAttrs.metalLdFlags); - env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [ - (lib.optionalString (march != "") "-march=${march}") - (lib.optionalString (mtune != "") "-mtune=${mtune}") - (lib.optionalString (mcpu != "") "-mcpu=${mcpu}") - ]; - makeFlags = [ (makeBool "LLAMA_OPENBLAS" openblasSupport) (makeBool "LLAMA_CUBLAS" cublasSupport)