Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurations for nvidia microarchitectures #1094

Merged
merged 5 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/gpu/nvidia/ada-lovelace/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{lib, config, ...}:
let
nividiaPackage = config.hardware.nvidia.package;
in
{
imports = [ ../. ];

# enable the opensorce drivers if the package supports it
BCNelson marked this conversation as resolved.
Show resolved Hide resolved
hardware.nvidia.open = lib.mkOverride 990 (nividiaPackage ? open && nividiaPackage ? firmware);
Mic92 marked this conversation as resolved.
Show resolved Hide resolved
}
10 changes: 10 additions & 0 deletions common/gpu/nvidia/ampere/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{lib, config, ...}:
let
nividiaPackage = config.hardware.nvidia.package;
in
{
imports = [ ../. ];

# enable the opensorce drivers if the package supports it
BCNelson marked this conversation as resolved.
Show resolved Hide resolved
hardware.nvidia.open = lib.mkOverride 990 (nividiaPackage ? open && nividiaPackage ? firmware);
Mic92 marked this conversation as resolved.
Show resolved Hide resolved
}
7 changes: 7 additions & 0 deletions common/gpu/nvidia/maxwell/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{lib, ...}:
{
imports = [ ../. ];

# The open source driver does not support Maxwell GPUs.
hardware.nvidia.open = false;
}
7 changes: 7 additions & 0 deletions common/gpu/nvidia/pascal/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{lib, ...}:
{
imports = [ ../. ];

# The open source driver does not support Pascal GPUs.
hardware.nvidia.open = false;
}
10 changes: 10 additions & 0 deletions common/gpu/nvidia/turing/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{lib, config, ...}:
let
nividiaPackage = config.hardware.nvidia.package;
in
{
imports = [ ../. ];

# enable the opensorce drivers if the package supports it
BCNelson marked this conversation as resolved.
Show resolved Hide resolved
hardware.nvidia.open = lib.mkOverride 990 (nividiaPackage ? open && nividiaPackage ? firmware);
}
3 changes: 2 additions & 1 deletion dell/xps/15-7590/nvidia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
imports = [
../.
../../../../common/gpu/nvidia/prime.nix
../../../../common/gpu/nvidia/turing
];

hardware.nvidia = {
powerManagement = {
# Enable NVIDIA power management.
enable = lib.mkDefault true;

# Enable dynamic power management.
finegrained = lib.mkDefault true;
};
Expand Down
1 change: 1 addition & 0 deletions dell/xps/15-9570/nvidia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
imports = [
../../../../common/cpu/intel
../../../../common/gpu/nvidia/prime.nix
../../../../common/gpu/nvidia/pascal
../../../../common/pc/laptop
../xps-common.nix
];
Expand Down
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@
common-gpu-nvidia-sync = import ./common/gpu/nvidia/prime-sync.nix;
common-gpu-nvidia-nonprime = import ./common/gpu/nvidia;
common-gpu-nvidia-disable = import ./common/gpu/nvidia/disable.nix;
common-gpu-nvidia-ada-lovelace = import ./common/gpu/nvidia/ada-lovelace;
Mic92 marked this conversation as resolved.
Show resolved Hide resolved
common-gpu-nvidia-ampere = import ./common/gpu/nvidia/ampere;
common-gpu-nvidia-turing = import ./common/gpu/nvidia/turing;
common-gpu-nvidia-pascal = import ./common/gpu/nvidia/pascal;
common-gpu-nvidia-maxwell = import ./common/gpu/nvidia/maxwell;
Copy link
Member

@Mic92 Mic92 Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this a public api, would work against #992 a bit. Progress on that has been slow, but we made good progress on https://github.com/numtide/nixos-facter so I would prefer to not expose stuff in the flake.nix, which we later on want to deprecate again. The alternative would be to make this part of NixOS as well...

With that we could than automatically detect what nvidia generation is installed in a machine.

Mic92 marked this conversation as resolved.
Show resolved Hide resolved
common-hidpi = import ./common/hidpi.nix;
common-pc = import ./common/pc;
common-pc-hdd = import ./common/pc/hdd;
Expand Down