nixos/services/ollama.nix
ediblerope b86a92293c ollama: build against CUDA 12.2 for Quadro M2000 compatibility
The M2000's legacy_535 driver caps CUDA support at 12.2; nixpkgs'
default ollama-cuda targets 12.8 (requires driver ≥570), causing
the runner to crash immediately. Override to CUDA 12.2 with sm_52
arch target to match Maxwell GM206 compute capability.

Also open port 11434 on the mediaserver firewall for remote ollama
access from other LAN hosts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 09:23:23 +01:00

37 lines
No EOL
1.5 KiB
Nix

{ config, pkgs, lib, ... }:
{
config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") {
services.ollama.enable = true;
# nixpkgs ollama-cuda builds against CUDA 12.8, which requires driver ≥570.
# The Quadro M2000's legacy_535 driver only supports up to CUDA 12.2,
# so we override cudaPackages to build against 12.2 instead.
services.ollama.package = pkgs.ollama.override {
acceleration = "cuda";
cudaPackages = pkgs.cudaPackages_12_2;
cudaArches = [ "sm_52" ]; # Maxwell GM206 compute capability
};
services.open-webui.enable = true;
services.open-webui.port = 8888;
services.open-webui.environment.WEBUI_AUTH = "False"; # auth handled by Authelia upstream
nixpkgs.overlays = [
(final: prev: {
# We need to reach into the python package set
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(python-final: python-prev: {
langchain = python-prev.langchain.overridePythonAttrs (oldAttrs: {
doCheck = false;
});
})
];
# valkey 8.1.x has a flaky replication integration test that
# fails non-deterministically; skip checks to unblock open-webui.
valkey = prev.valkey.overrideAttrs (oldAttrs: {
doCheck = false;
});
})
];
};
}