Alexander Rødseth pushed to branch main at Arch Linux / Packaging / Packages /
ollama-cuda
Commits:
afc4de52 by Alexander F. Rødseth at 2024-11-25T09:59:04+01:00
Revert "Make 0.4.2 build, but it does not appear to use CUDA at runtime, yet"
This reverts commit 8a5a611dc1cedd85e965ff94cec9b2a0914eeae0.
- - - - -
bb9f8531 by Alexander F. Rødseth at 2024-11-25T11:06:55+01:00
Add cuda as a runtime dependency
- - - - -
2 changed files:
- .SRCINFO
- PKGBUILD
Changes:
=====================================
.SRCINFO
=====================================
@@ -1,15 +1,16 @@
pkgbase = ollama-cuda
pkgdesc = Create, run and share large language models (LLMs) with CUDA
pkgver = 0.3.12
- pkgrel = 5
+ pkgrel = 6
url = https://github.com/ollama/ollama
arch = x86_64
license = MIT
makedepends = clblast
makedepends = cmake
- makedepends = cuda
makedepends = git
makedepends = go
+ makedepends = pigz
+ depends = cuda
optdepends = nvidia-utils: monitor GPU usage with nvidia-smi
provides = ollama
conflicts = ollama
=====================================
PKGBUILD
=====================================
@@ -4,43 +4,50 @@
# Contributor: Kainoa Kanter <[email protected]>
pkgname=ollama-cuda
-pkgver=0.4.2
-pkgrel=1
+pkgver=0.3.12
+pkgrel=6
pkgdesc='Create, run and share large language models (LLMs) with CUDA'
arch=(x86_64)
url='https://github.com/ollama/ollama'
+_llama_cpp_commit=$(curl -sL
"https://github.com/ollama/ollama/tree/v$pkgver/llm" | tr ' ' '\n' | tr '"'
'\n' | grep ggerganov | cut -d/ -f5 | head -1)
license=(MIT)
provides=(ollama)
conflicts=(ollama)
depends=(cuda)
-makedepends=(clblast cmake git go)
+makedepends=(clblast cmake git go pigz)
optdepends=('nvidia-utils: monitor GPU usage with nvidia-smi')
source=(git+$url#tag=v$pkgver
+
llama.cpp::git+https://github.com/ggerganov/llama.cpp#commit=$_llama_cpp_commit
ollama.service
sysusers.conf
tmpfiles.d)
-b2sums=('02154afa3129c64d2dc3365a49860748271003c25441fd663a1abfc6e7ef3b324a0057625ceb47812466dc8616896d670bbc8462937a5fe7a6b5845e03a9e2f6'
+b2sums=('7b230922a233f0be967abb40b300125fb59ed64850a109db185954c549e12e5de0c1be094c1cdb67484c9e8705804a3761bfefa517fac1adfb05bcae8d2c197d'
+
'e568ac334cf07b69f98c4581f212f2e30bdebf1f285a37e4bb5c8ac31733df9a3c125e6d16b7f6bbe412cedb11d249a07ca9793a487e0ad34810cbb35cd32ee2'
'031e0809a7f564de87017401c83956d43ac29bd0e988b250585af728b952a27d139b3cad0ab1e43750e2cd3b617287d3b81efc4a70ddd61709127f68bd15eabd'
'3aabf135c4f18e1ad745ae8800db782b25b15305dfeaaa031b4501408ab7e7d01f66e8ebb5be59fc813cfbff6788d08d2e48dcf24ecc480a40ec9db8dbce9fec'
'e8f2b19e2474f30a4f984b45787950012668bf0acb5ad1ebb25cd9776925ab4a6aa927f8131ed53e35b1c71b32c504c700fe5b5145ecd25c7a8284373bb951ed')
-#prepare() {
+prepare() {
+ echo "Using llama.cpp git submodule commit $_llama_cpp_commit"
+
+ # Prepare the git submodule by copying in files (the build process is
sensitive to symlinks)
+ rm -frv ollama/llm/llama.cpp
+ cp -r llama.cpp ollama/llm/llama.cpp
+
# Set the CMake build type to "Release"
- # sed -i 's,T_CODE=on,T_CODE=on -D CMAKE_BUILD_TYPE=Release,g'
ollama/llm/generate/gen_linux.sh
-#}
+ sed -i 's,T_CODE=on,T_CODE=on -D CMAKE_BUILD_TYPE=Release,g'
ollama/llm/generate/gen_linux.sh
+}
build() {
export CFLAGS+=" $(pkg-config --cflags cuda) -w" CXXFLAGS+=" $(pkg-config
--cflags cuda) -w"
export LDFLAGS+=" -L/opt/cuda/targets/x86_64-linux/lib/stubs/ $(pkg-config
--libs cuda)"
export CGO_CFLAGS="$CFLAGS" CGO_CPPFLAGS="$CPPFLAGS"
CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS"
export CUDA_LIB_DIR=/opt/cuda/targets/x86_64-linux/lib
-
local goflags='-buildmode=pie -trimpath -mod=readonly -modcacherw'
local ldflags="-linkmode=external -buildid= -X
github.com/ollama/ollama/version.Version=$pkgver -X
github.com/ollama/ollama/server.mode=release"
-
cd ollama
go generate ./...
- go build $goflags -ldflags="$ldflags" -tags cuda12
+ go build $goflags -ldflags="$ldflags" -tags cuda
}
check() {
@@ -56,5 +63,6 @@ package() {
install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/ollama.conf"
install -Dm644 tmpfiles.d "$pkgdir/usr/lib/tmpfiles.d/ollama.conf"
install -Dm644 ollama/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm644 ollama/llm/llama.cpp/LICENSE
"$pkgdir/usr/share/licenses/$pkgname/llama.cpp-LICENSE"
ln -s /var/lib/ollama "$pkgdir/usr/share/ollama"
}
View it on GitLab:
https://gitlab.archlinux.org/archlinux/packaging/packages/ollama-cuda/-/compare/8a5a611dc1cedd85e965ff94cec9b2a0914eeae0...bb9f85318a13140be1f7be80067683339b64914b
--
View it on GitLab:
https://gitlab.archlinux.org/archlinux/packaging/packages/ollama-cuda/-/compare/8a5a611dc1cedd85e965ff94cec9b2a0914eeae0...bb9f85318a13140be1f7be80067683339b64914b
You're receiving this email because of your account on gitlab.archlinux.org.