Skip to content

Commit f8c691a

Browse files
committed
nix: Added missing packages and options for ROCm build
1 parent c466abe commit f8c691a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.devops/nix/package.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
rocmGpuTargets ? builtins.concatStringsSep ";" rocmPackages.clr.gpuTargets,
3535
enableCurl ? true,
3636
useVulkan ? false,
37+
buildAllCudaFaQuants ? false,
3738
llamaVersion ? "0.0.0", # Arbitrary version, substituted by the flake
3839

3940
# It's necessary to consistently use backendStdenv when building with CUDA support,
@@ -95,6 +96,8 @@ let
9596
clr
9697
hipblas
9798
rocblas
99+
llvm.lld
100+
llvm.bintools
98101
];
99102

100103
vulkanBuildInputs = [
@@ -160,7 +163,8 @@ effectiveStdenv.mkDerivation (finalAttrs: {
160163
buildInputs =
161164
optionals effectiveStdenv.isDarwin darwinBuildInputs
162165
++ optionals useCuda cudaBuildInputs
163-
++ optionals useMpi [ mpi ]
166+
++ optionals (useMpi && !useRocm) [ mpi ]
167+
++ optionals (useMpi && useRocm) [ rocmPackages.mpi ]
164168
++ optionals useRocm rocmBuildInputs
165169
++ optionals useBlas [ blas ]
166170
++ optionals useVulkan vulkanBuildInputs
@@ -187,10 +191,12 @@ effectiveStdenv.mkDerivation (finalAttrs: {
187191
builtins.concatStringsSep ";" (map dropDot cudaCapabilities)
188192
)
189193
)
194+
(cmakeBool "GGML_CUDA_FA_ALL_QUANTS" buildAllCudaFaQuants)
190195
]
191196
++ optionals useRocm [
192197
(cmakeFeature "CMAKE_HIP_COMPILER" "${rocmPackages.llvm.clang}/bin/clang")
193198
(cmakeFeature "CMAKE_HIP_ARCHITECTURES" rocmGpuTargets)
199+
(cmakeBool "GGML_CUDA_FA_ALL_QUANTS" buildAllCudaFaQuants)
194200
]
195201
++ optionals useMetalKit [
196202
(lib.cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1")

0 commit comments

Comments
 (0)