commit e77e0f1e2ca606461e0686aed2fb9744f0a183d9
parent 84d97d59080e858924919bea8673ee92c27f8f77
Author: vin <vin@vineetk.net>
Date: Sun, 26 Jan 2025 11:18:31 -0500
temporarily add nvidia
Diffstat:
1 file changed, 31 insertions(+), 4 deletions(-)
diff --git a/hosts/demiurge/default.nix b/hosts/demiurge/default.nix
@@ -18,7 +18,7 @@
efi.canTouchEfiVariables = true;
};
- zfs.extraPools = [ "hgst" "backup" "data_warm" ];
+ zfs.extraPools = [ "backup" "data_warm" ];
};
# disable wifi and open some ports
@@ -83,6 +83,7 @@
isNormalUser = true;
extraGroups = [
+ "input"
"kvm"
"libvirtd"
"transmission"
@@ -99,6 +100,12 @@
# selectively allow unfree packages
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
+ "cuda_cccl"
+ "cuda_cudart"
+ "cuda_nvcc"
+ "libcublas"
+ "nvidia-persistenced"
+ "nvidia-x11"
"steam"
"steam-unwrapped"
];
@@ -266,8 +273,14 @@
# llm
ollama = {
enable = true;
- acceleration = "rocm";
- rocmOverrideGfx = "10.3.0";
+ acceleration = "cuda";
+# acceleration = "rocm";
+# rocmOverrideGfx = "10.3.0";
+
+ environmentVariables = {
+ OLLAMA_LLM_LIBRARY = "cuda";
+ LD_LIBRARY_PATH = "run/opengl-driver/lib";
+ };
loadModels = [
"qwen2.5:14b"
@@ -729,10 +742,24 @@
enable = true;
autorun = false;
displayManager.startx.enable = true;
- videoDrivers = [ "amdgpu" ];
+ videoDrivers = [ "amdgpu" "nvidia" ];
};
};
+ # temporarily also use nvidia gpu
+ hardware.nvidia.modesetting.enable = true;
+ hardware.nvidia.nvidiaPersistenced = true;
+ hardware.nvidia.nvidiaSettings = false;
+ hardware.nvidia.open = false;
+
+ # nvidia does not like sleeping
+ systemd.targets = {
+ sleep.enable = false;
+ suspend.enable = false;
+ hibernate.enable = false;
+ hybrid-sleep.enable = false;
+ };
+
# create caches and use mandoc
documentation.man = {
enable = true;