Skip to content

Commit 9980451

Browse files
new patch
1 parent 2a2765a commit 9980451

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Anaconda <[email protected]>
3+
Date: Mon, 11 Nov 2025 00:00:00 +0000
4+
Subject: [PATCH] Fix ARM SVE detection for old kernel headers
5+
6+
PR_SVE_VL_LEN_MASK and PR_SVE_GET_VL are not available in older kernel
7+
headers (< Linux 4.15). Add guards to disable SVE vector length detection
8+
when these constants are not defined.
9+
10+
This fixes compilation on aarch64 with older glibc/kernel headers.
11+
---
12+
vendor/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c | 4 ++++
13+
1 file changed, 4 insertions(+)
14+
15+
diff --git a/vendor/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c b/vendor/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c
16+
index 1111111..2222222 100644
17+
--- a/vendor/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c
18+
+++ b/vendor/llama.cpp/ggml/src/ggml-cpu/ggml-cpu.c
19+
@@ -687,7 +687,11 @@ static int ggml_get_n_threads(struct ggml_compute_params * params, int n_tasks)
20+
21+
static void ggml_init_arm_arch_features(void) {
22+
#if defined(__linux__) && defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
23+
+#if defined(PR_SVE_VL_LEN_MASK) && defined(PR_SVE_GET_VL)
24+
ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL);
25+
+#else
26+
+ ggml_arm_arch_features.sve_cnt = 0;
27+
+#endif
28+
#endif
29+
}
30+
31+
--
32+
2.39.5

recipe/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ source:
1414
patches:
1515
# Adapt shared library relocation for conda environments
1616
- 0001-Adapt-shared-library-relocation.patch
17+
# Fix ARM SVE detection for old kernel headers on aarch64
18+
- 0002-Fix-ARM-SVE-detection-for-old-kernel-headers.patch # [linux and aarch64]
1719

1820
build:
1921
number: 0

0 commit comments

Comments
 (0)