summaryrefslogtreecommitdiff
path: root/hosts/poweredge/nvidia.nix
blob: 5eecc7115302ae62d48b559f8bf1bde516f0a1eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ lib, config, pkgs, ... }: {
	# Configure nixpkgs for nvidia/cuda
	nixpkgs.config = {
		cudaSupport = true;
		allowUnfreePredicate = pkg:
			pkgs._cuda.lib.allowUnfreeCudaPredicate pkg
			|| builtins.elem (lib.getName pkg) [
				"nvidia-x11"
				"nvidia-kernel-modules"
			];
	};

	# 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
	];
}