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>
This commit is contained in:
ediblerope 2026-05-13 09:23:23 +01:00
parent 02cbd656e2
commit b86a92293c
2 changed files with 9 additions and 2 deletions

View file

@ -34,7 +34,7 @@
networking.useDHCP = lib.mkDefault true;
# Open firewall for SSH
networking.firewall.allowedTCPPorts = [ 22 ];
networking.firewall.allowedTCPPorts = [ 22 11434 ];
services.openssh = {
enable = true;
settings = {

View file

@ -3,7 +3,14 @@
config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") {
services.ollama.enable = true;
services.ollama.acceleration = "cuda";
# 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;