-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcuda.nix
38 lines (33 loc) · 947 Bytes
/
cuda.nix
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
30
31
32
33
34
35
36
37
38
{ pkgs
, config
, ...
}: {
nixpkgs.config = {
allowUnfree = true;
# cudaSupport = true;
# enableOptimizations = true;
# 3080 is 8.6
# 4090 is 8.9; sm_89 virt target compute_89
# # gpuTargets = [ "8.9" ]; # used for non-nvidia gpus
# cudaCapabilities = [ "8.9" ];
# use the latest version because i hate myself
# cudaVersion = "12.0";
};
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
hardware.nvidia = {
nvidiaPersistenced = true;
open = true;
# powerManagement.enable = true;
modesetting.enable = true;
nvidiaSettings = false;
};
hardware.nvidia-container-toolkit.enable = true;
# unclear why this is needed
# but without it it does not load the drivers :(
services.xserver.videoDrivers = [ "nvidia" ];
environment.etc."modprobe.d/nvgpuctrperm.conf".text = "options nvidia NVreg_RestrictProfilingToAdminUsers=0";
}