kvmem-cuda-git

LOW
maintainer chrishamm 0 votes scanned 2026-11-01 16:01:05.312492
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: Christian Hammacher <chr.hammacher@gmail.com>
2# Based on the extra/llama-cpp PKGBUILD by Sven-Hendrik Haase and Maxime Gauduin
3
4pkgname=kvmem-cuda-git
5pkgver=0.19.1.r20.g4b755f2
6pkgrel=1
7pkgdesc='llama.cpp server with KVMem long-context KV memory management (CUDA)'
8arch=(x86_64)
9url=https://github.com/kvmem/kvmem
10license=(
11 MIT
12 LicenseRef-unknown
13)
14depends=(
15 cuda
16 glibc
17 libgcc
18 libstdc++
19 nvidia-utils
20 openssl
21)
22makedepends=(
23 chrpath
24 cmake
25 git
26 ninja
27 python
28)
29provides=(kvmem)
30conflicts=(kvmem)
31options=(
32 !buildflags
33 !debug
34)
35source=(git+https://github.com/kvmem/kvmem.git
36 git+https://github.com/ggml-org/llama.cpp.git
37 0001-Keep-nvml.h-from-clobbering-llama.h-DEPRECATED.patch)
38b2sums=('SKIP'
39 'SKIP'
40 'c1adf0f5dd86209807ac7f2fb45045dc911bc98e6f9cdeeb113ed7724eed857ad6bc30bdca3c4ee69c752affdd0079af5dc1d4816fb1bcc74a52ad22c1677553')
41
42# The adapter patches llama.cpp's bundled ggml, so neither system ggml nor
43# llama-cpp can be used; the private libraries live in /usr/lib/kvmem instead
44
45# RTX 20/30/40/50, the cards KVMem qualifies; set CUDA_ARCHITECTURES to build for one card only
46_cuda_arch=${CUDA_ARCHITECTURES:-75-real;86-real;89-real;120a-real}
47
48pkgver() {
49 cd kvmem
50 git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
51}
52
53prepare() {
54 cd kvmem
55 git submodule init backends/llamacpp
56 git config submodule.llamacpp.url "${srcdir}"/llama.cpp
57 git -c protocol.file.allow=always submodule update --no-recommend-shallow backends/llamacpp
58 python scripts/prepare-backends.py --backend llamacpp
59 patch -Np1 -i ../0001-Keep-nvml.h-from-clobbering-llama.h-DEPRECATED.patch
60}
61
62build() {
63 cmake -S kvmem -B build -G Ninja \
64 -DCMAKE_BUILD_TYPE=Release \
65 -DCMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc \
66 -DCMAKE_CUDA_ARCHITECTURES="${_cuda_arch}" \
67 -DGGML_NATIVE=OFF \
68 -DGGML_CUDA=ON \
69 -DGGML_CUDA_FA_QUANTS=all \
70 -DKVMEM_BUILD_LLAMA=ON \
71 -DKVMEM_BUILD_SERVER_TESTS=OFF \
72 -DLLAMA_KVMEM=ON \
73 -DLLAMA_KVMEM_ROOT="${srcdir}"/kvmem
74 cmake --build build --target llama-kvmem-server
75}
76
77package() {
78 install -Dm 755 build/bin/llama-kvmem-server -t "${pkgdir}"/usr/bin/
79 install -dm 755 "${pkgdir}"/usr/lib/kvmem
80 cp -a build/bin/lib{ggml,ggml-base,ggml-cpu,ggml-cuda,llama,llama-common,mtmd}.so* "${pkgdir}"/usr/lib/kvmem/
81 local _f
82 for _f in "${pkgdir}"/usr/bin/llama-kvmem-server $(find "${pkgdir}"/usr/lib/kvmem -type f); do
83 if chrpath -l "${_f}" >/dev/null; then
84 chrpath -r /usr/lib/kvmem "${_f}"
85 fi
86 done
87 install -Dm 644 kvmem/backends/llamacpp/LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
88}
89

Scan history

Scanned at (UTC)SeverityRules
2026-11-01 16:01:05 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion