diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-11-02 13:24:12 -0600 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-11-02 13:24:12 -0600 |
| commit | 93c136d7aeef7326b577079baadd7b2542be49f1 (patch) | |
| tree | 6683cb49a8c8664b5a1410fa821d2924c3847dcc /hosts/poweredge-pro/nvidia.nix | |
| parent | e641d21f2e5c83f7b2814d57add961bb67bb262b (diff) | |
| download | nixos-93c136d7aeef7326b577079baadd7b2542be49f1.tar.xz nixos-93c136d7aeef7326b577079baadd7b2542be49f1.zip | |
add ollama/nvidia config for poweredge-pro
Diffstat (limited to 'hosts/poweredge-pro/nvidia.nix')
| -rw-r--r-- | hosts/poweredge-pro/nvidia.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/hosts/poweredge-pro/nvidia.nix b/hosts/poweredge-pro/nvidia.nix new file mode 100644 index 0000000..4f641b2 --- /dev/null +++ b/hosts/poweredge-pro/nvidia.nix @@ -0,0 +1,34 @@ +{ lib, config, pkgs, ... }: { + # Configure nixpkgs for nvidia/cuda + nixpkgs.config = { + #cudaSupport = true; + # Compile CUDA kernels only for the P100 (compute capability 6.0). + # The container reuses the host's pkgs, so this has to be set here. + cudaCapabilities = [ "6.0" ]; + allowUnfreePredicate = pkg: + pkgs._cuda.lib.allowUnfreeCudaPredicate pkg + || builtins.elem (lib.getName pkg) [ + "nvidia-x11" + "nvidia-kernel-modules" + "open-webui" + ]; + }; + + # NVIDIA + services.xserver.videoDrivers = [ "nvidia" ]; # xserver.videoDrivers does not imply X + hardware.graphics.enable = true; + hardware.nvidia = { + modesetting.enable = true; # Required + nvidiaSettings = false; # Don't need gui + open = false; + package = config.boot.kernelPackages.nvidiaPackages.legacy_580; # Support for P600 + powerManagement.enable = false; # Can cause bugs + powerManagement.finegrained = false; # Only works on turing and newer + }; + + # Packages + environment.systemPackages = with pkgs; [ + config.hardware.nvidia.package # nvidia-smi + nvtopPackages.nvidia + ]; +} |
