Nix fixes

This commit is contained in:
Tristan D. 2024-05-03 22:03:11 +02:00
parent ee52225067
commit 16a5441fa1
Signed by: tristan
SSH key fingerprint: SHA256:3RU4RLOoM8oAjFU19f1W6t8uouZbA7GWkaSW6rjp1k8
2 changed files with 17 additions and 2 deletions

View file

@ -11,6 +11,9 @@
"llama-server"
"quantize"
"train-text-from-scratch"
"llama-bench"
"imatrix"
"perplexity"
];
mkApp = name: {
type = "app";

View file

@ -30,8 +30,15 @@
useMpi ? false, # Increases the runtime closure size by ~700M
useOpenCL ? false,
useRocm ? config.rocmSupport,
rocmTargets ? "gfx1030",
useVulkan ? false,
llamaVersion ? "0.0.0", # Arbitrary version, substituted by the flake
llamaNative ? true,
llamaLTO ? true,
llamaAVX ? true,
llamaAVX2 ? true,
llamaFMA ? true,
llamaF16C ? true,
# It's necessary to consistently use backendStdenv when building with CUDA support,
# otherwise we get libstdc++ errors downstream.
@ -205,7 +212,12 @@ effectiveStdenv.mkDerivation (
cmakeFlags =
[
(cmakeBool "LLAMA_NATIVE" false)
(cmakeBool "LLAMA_NATIVE" llamaNative)
(cmakeBool "LLAMA_LTO" llamaLTO)
(cmakeBool "LLAMA_AVX" llamaAVX)
(cmakeBool "LLAMA_AVX2" llamaAVX2)
(cmakeBool "LLAMA_FMA" llamaFMA)
(cmakeBool "LLAMA_F16C" llamaF16C)
(cmakeBool "LLAMA_BUILD_SERVER" true)
(cmakeBool "BUILD_SHARED_LIBS" (!enableStatic))
(cmakeBool "CMAKE_SKIP_BUILD_RPATH" true)
@ -234,7 +246,7 @@ effectiveStdenv.mkDerivation (
# in https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/develop/CMakeLists.txt
# and select the line that matches the current nixpkgs version of rocBLAS.
# Should likely use `rocmPackages.clr.gpuTargets`.
"-DAMDGPU_TARGETS=gfx803;gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1010;gfx1012;gfx1030;gfx1100;gfx1101;gfx1102"
"-DAMDGPU_TARGETS=${rocmTargets}"
]
++ optionals useMetalKit [
(lib.cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1")