From d01482ec08db66f5341002d8a019fb21bd31b9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BE=E5=9C=B0=20=E5=B8=8C=E7=95=99=E8=80=B6?= <65301509+KiruyaMomochi@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:11:29 +0800 Subject: [PATCH 1/2] koboldcpp: fix gpu-architecture flags from CUDA_DOCKER_ARCH --- pkgs/by-name/ko/koboldcpp/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ko/koboldcpp/package.nix b/pkgs/by-name/ko/koboldcpp/package.nix index 8f23b6167e3d..51400a89e76b 100644 --- a/pkgs/by-name/ko/koboldcpp/package.nix +++ b/pkgs/by-name/ko/koboldcpp/package.nix @@ -22,7 +22,7 @@ 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" - cudaArches ? cudaPackages.cudaFlags.arches or [ ], + cudaArches ? cudaPackages.cudaFlags.realArches or [ ], clblastSupport ? stdenv.isLinux, clblast, @@ -129,7 +129,7 @@ effectiveStdenv.mkDerivation (finalAttrs: { (makeBool "LLAMA_CLBLAST" clblastSupport) (makeBool "LLAMA_VULKAN" vulkanSupport) (makeBool "LLAMA_METAL" metalSupport) - (lib.optionals cublasSupport "CUDA_DOCKER_ARCH=sm_${builtins.head cudaArches}") + (lib.optionals cublasSupport "CUDA_DOCKER_ARCH=${builtins.head cudaArches}") ]; installPhase = '' From f0ff29350933140f2d69ef044c11414f74e89df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BE=E5=9C=B0=20=E5=B8=8C=E7=95=99=E8=80=B6?= <65301509+KiruyaMomochi@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:14:13 +0800 Subject: [PATCH 2/2] koboldcpp: add separator to the prefix option of makeWrapper --- pkgs/by-name/ko/koboldcpp/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ko/koboldcpp/package.nix b/pkgs/by-name/ko/koboldcpp/package.nix index 51400a89e76b..7d49b8dd4588 100644 --- a/pkgs/by-name/ko/koboldcpp/package.nix +++ b/pkgs/by-name/ko/koboldcpp/package.nix @@ -40,7 +40,7 @@ let makeBool = option: bool: (if bool then "${option}=1" else ""); libraryPathWrapperArgs = lib.optionalString config.cudaSupport '' - --prefix LD_LIBRARY_PATH: "${lib.makeLibraryPath [ addDriverRunpath.driverLink ]}" + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ addDriverRunpath.driverLink ]}" ''; darwinFrameworks = @@ -158,7 +158,7 @@ effectiveStdenv.mkDerivation (finalAttrs: { postFixup = '' wrapPythonProgramsIn "$out/bin" "$pythonPath" makeWrapper "$out/bin/koboldcpp.unwrapped" "$out/bin/koboldcpp" \ - --prefix PATH ${lib.makeBinPath [ tk ]} ${libraryPathWrapperArgs} + --prefix PATH : ${lib.makeBinPath [ tk ]} ${libraryPathWrapperArgs} ''; passthru.updateScript = gitUpdater { rev-prefix = "v"; };