diff --git c/PKGBUILD i/PKGBUILD index 9fc3617..2b46fc4 100644 --- c/PKGBUILD +++ i/PKGBUILD @@ -1,9 +1,9 @@ # Maintainer: Rafael Dominiquini pkgbase=ollama-bin -pkgname=(ollama-bin ollama-cuda12-bin ollama-cuda13-bin ollama-mlx-cuda13-bin ollama-vulkan-bin) +pkgname=(ollama-bin ollama-cuda12-bin ollama-cuda13-bin ollama-vulkan-bin) pkgver=0.23.1 -pkgrel=1 +pkgrel=2 pkgdesc="Create, run and share large language models (LLMs)" arch=('x86_64' 'aarch64') _barch=('amd64' 'arm64') @@ -21,15 +21,21 @@ optdepends=("ollama-cuda12: NVIDIA GPU Support" source=("LICENSE-${pkgver}::${_urlraw}/LICENSE" "README-${pkgver}.md::${_urlraw}/README.md" "ollama.conf" + "ollama-cuda.conf" "ollama.service" + "ollama-cuda.service" + "ollama-vulkan.service" "sysusers.conf" "tmpfiles.d") source_x86_64=("ollama-${arch[0]}-${pkgver}.tzst::${url}/releases/download/v${pkgver}/ollama-linux-${_barch[0]}.tar.zst") source_aarch64=("ollama-${arch[1]}-${pkgver}.tzst::${url}/releases/download/v${pkgver}/ollama-linux-${_barch[1]}.tar.zst") sha256sums=('5934ed2ce0d15154bcdb9c85203210abac0da4314af34081e36df4599f90b226' 'f900b4ece4a4de07e36a192ae642f29395114443f2f1928689fd8c776f1ba2f1' - '2503546a6d26559bce06ba6c61100026d85864b4c49bd6e4c80c596c5d22e197' + '964956597a56ab8a27f081510b41fb1d60e22c543bbd7267e23dca4ce3334461' + '5a502d9eab47078f9136b127d72289b3083934c222c7735c4585d0dbc3fef893' '24871ffd940212e04e9bd3c334cfd4e3c4e845b374c5d0ed369fd32496b05fdb' + '138f38a3ab5582d7a2f9f21c98a8a1112e3afb767e32cc348cb320938874104b' + 'a47d96ee424ff4a113e9d60f03805dfa9ddb25df5e54fc242306b9b20b0bae0d' '14e2e267be85b6943f66dfe60e73f5e0a611eaf40ee69a4cc0d497d071392cf4' '137e1d50a5f3058c30a73b7bb3c323888d225e6a7ae47564be869827db0659a3') sha256sums_x86_64=('1079dad63e0e0f2d3279280ce6d8a93f3af53e79afb14f74813e0b35d9b96d54') @@ -72,6 +78,8 @@ package_ollama-cuda12-bin() { cd "${srcdir}/" || exit + install -Dm644 "./ollama-cuda.service" "${pkgdir}/usr/lib/systemd/system/ollama.service.d/01-cuda.conf" + install -Dm644 "./ollama-cuda.conf" "${pkgdir}/etc/ollama-cuda.conf" install -dm755 "${pkgdir}/usr/lib/ollama/" for lib in "./lib/ollama/cuda_v12/lib"*; do cp -P "${lib}" "${pkgdir}/usr/lib/ollama/" @@ -83,34 +91,18 @@ package_ollama-cuda13-bin() { provides=("ollama-cuda13") depends=("ollama-bin" "nvidia-libgl") - optdepends=("ollama-mlx-cuda13-bin: Image Generation") conflicts=("ollama-cuda" "ollama-cuda12" "ollama-vulkan") cd "${srcdir}/" || exit + install -Dm644 "./ollama-cuda.service" "${pkgdir}/usr/lib/systemd/system/ollama.service.d/01-cuda.conf" + install -Dm644 "./ollama-cuda.conf" "${pkgdir}/etc/ollama-cuda.conf" install -dm755 "${pkgdir}/usr/lib/ollama/" for lib in "./lib/ollama/cuda_v13/lib"*; do cp -P "${lib}" "${pkgdir}/usr/lib/ollama/" done } -package_ollama-mlx-cuda13-bin() { - pkgdesc='Create, run and share large language models (LLMs) with MLX CUDA 13 (Image Generation)' - - provides=("ollama-mlx") - depends+=("ollama-cuda13") - conflicts=("ollama-cuda" "ollama-cuda12" "ollama-vulkan") - - cd "${srcdir}/" || exit - - install -dm755 "${pkgdir}/usr/lib/ollama/" - for lib in "./lib/ollama/mlx_cuda_v13/lib"*; do - cp -P "${lib}" "${pkgdir}/usr/lib/ollama/" - done - - find "${pkgdir}/usr/lib/ollama/" -xtype l -delete -} - package_ollama-vulkan-bin() { pkgdesc='Create, run and share large language models (LLMs) with Vulkan' @@ -120,6 +112,7 @@ package_ollama-vulkan-bin() { cd "${srcdir}/" || exit + install -Dm644 "./ollama-vulkan.service" "${pkgdir}/usr/lib/systemd/system/ollama.service.d/01-vulkan.conf" install -dm755 "${pkgdir}/usr/lib/ollama/" for lib in "./lib/ollama/vulkan/lib"*; do cp -P "${lib}" "${pkgdir}/usr/lib/ollama/" diff --git c/ollama-cuda.conf i/ollama-cuda.conf new file mode 100644 index 0000000..30ae011 --- /dev/null +++ i/ollama-cuda.conf @@ -0,0 +1,9 @@ +# CUDA Environment Variables for Ollama Optimization +CUDA_VISIBLE_DEVICES=0,1,2,3 +CUDA_DEVICE_ORDER=PCI_BUS_ID +CUDA_LAUNCH_BLOCKING=0 +CUDA_MODULE_LOADING=LAZY +CUDA_MODULE_DATA_LOADING=LAZY +CUDA_CACHE_MAXSIZE=2147483648 +CUDA_CACHE_PATH=/var/cache/cuda +CUDA_LOG_FILE=/var/log/cuda.log diff --git c/ollama-cuda.service i/ollama-cuda.service new file mode 100644 index 0000000..9e81ebe --- /dev/null +++ i/ollama-cuda.service @@ -0,0 +1,2 @@ +[Service] +EnvironmentFile=-/etc/ollama-cuda.conf diff --git c/ollama-vulkan.service i/ollama-vulkan.service new file mode 100644 index 0000000..3fc8359 --- /dev/null +++ i/ollama-vulkan.service @@ -0,0 +1,2 @@ +[Service] +Environment="OLLAMA_VULKAN=1" diff --git c/ollama.conf i/ollama.conf index 2038e1f..6a1d469 100644 --- c/ollama.conf +++ i/ollama.conf @@ -1,13 +1,3 @@ -# CUDA Environment Variables for Ollama Optimization -CUDA_VISIBLE_DEVICES=0,1,2,3 -CUDA_DEVICE_ORDER=PCI_BUS_ID -CUDA_LAUNCH_BLOCKING=0 -CUDA_MODULE_LOADING=LAZY -CUDA_MODULE_DATA_LOADING=LAZY -CUDA_CACHE_MAXSIZE=2147483648 -CUDA_CACHE_PATH=/var/cache/cuda -CUDA_LOG_FILE=/var/log/cuda.log - # Ollama Environment Variables OLLAMA_HOST="http://127.0.0.1:11434" OLLAMA_KEEP_ALIVE="5m"