Alexander Rødseth pushed to branch main at Arch Linux / Packaging / Packages / ollama-cuda
Commits: 8a5a611d by Alexander F. Rødseth at 2024-11-20T22:17:26+01:00 Make 0.4.2 build, but it does not appear to use CUDA at runtime, yet - - - - - 1 changed file: - PKGBUILD Changes: ===================================== PKGBUILD ===================================== @@ -4,49 +4,43 @@ # Contributor: Kainoa Kanter <[email protected]> pkgname=ollama-cuda -pkgver=0.3.12 -pkgrel=5 +pkgver=0.4.2 +pkgrel=1 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) -makedepends=(clblast cmake cuda git go) +depends=(cuda) +makedepends=(clblast cmake git go) 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=('7b230922a233f0be967abb40b300125fb59ed64850a109db185954c549e12e5de0c1be094c1cdb67484c9e8705804a3761bfefa517fac1adfb05bcae8d2c197d' - 'e568ac334cf07b69f98c4581f212f2e30bdebf1f285a37e4bb5c8ac31733df9a3c125e6d16b7f6bbe412cedb11d249a07ca9793a487e0ad34810cbb35cd32ee2' +b2sums=('02154afa3129c64d2dc3365a49860748271003c25441fd663a1abfc6e7ef3b324a0057625ceb47812466dc8616896d670bbc8462937a5fe7a6b5845e03a9e2f6' '031e0809a7f564de87017401c83956d43ac29bd0e988b250585af728b952a27d139b3cad0ab1e43750e2cd3b617287d3b81efc4a70ddd61709127f68bd15eabd' '3aabf135c4f18e1ad745ae8800db782b25b15305dfeaaa031b4501408ab7e7d01f66e8ebb5be59fc813cfbff6788d08d2e48dcf24ecc480a40ec9db8dbce9fec' 'e8f2b19e2474f30a4f984b45787950012668bf0acb5ad1ebb25cd9776925ab4a6aa927f8131ed53e35b1c71b32c504c700fe5b5145ecd25c7a8284373bb951ed') -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 - +#prepare() { # 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" - export CUDA_LIB_DIR=/opt/cuda/targets/x86_64-linux/lib + cd ollama go generate ./... - go build $goflags -ldflags="$ldflags" -tags cuda + go build $goflags -ldflags="$ldflags" -tags cuda12 } check() { @@ -62,6 +56,5 @@ 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/-/commit/8a5a611dc1cedd85e965ff94cec9b2a0914eeae0 -- View it on GitLab: https://gitlab.archlinux.org/archlinux/packaging/packages/ollama-cuda/-/commit/8a5a611dc1cedd85e965ff94cec9b2a0914eeae0 You're receiving this email because of your account on gitlab.archlinux.org.
