parent
5ea6f8ef99
commit
a13b221e49
7 changed files with 94 additions and 80 deletions
devices
|
@ -15,7 +15,6 @@ in {
|
|||
|
||||
./modules/gpu-replay.nix
|
||||
./modules/nix-gaming.nix
|
||||
./modules/nvidia.nix
|
||||
];
|
||||
|
||||
vars = {
|
||||
|
|
|
@ -75,4 +75,11 @@
|
|||
qemu
|
||||
virtiofsd
|
||||
];
|
||||
|
||||
nvidia = {
|
||||
enable = true;
|
||||
enableNvidiaSettings = true;
|
||||
enableWayland = true;
|
||||
enableCUDA = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -50,9 +50,6 @@
|
|||
'';
|
||||
};
|
||||
in {
|
||||
# Allow CUDA on boot
|
||||
boot.kernelModules = ["nvidia-uvm"];
|
||||
|
||||
security.wrappers = {
|
||||
gpu-screen-recorder = {
|
||||
owner = "root";
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# FIXME: move this to hardware-config?
|
||||
|
||||
# Enable OpenGL
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
vaapiVdpau
|
||||
];
|
||||
};
|
||||
|
||||
# Load nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
powerManagement.enable = false;
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
open = true;
|
||||
|
||||
# Enable the Nvidia settings menu,
|
||||
# accessible via `nvidia-settings`.
|
||||
nvidiaSettings = true;
|
||||
|
||||
# Vulkan is much more stable in Wayland
|
||||
package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta;
|
||||
};
|
||||
}
|
|
@ -1,14 +1,13 @@
|
|||
{
|
||||
config,
|
||||
modulesPath,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
|
||||
boot = {
|
||||
kernelModules = ["kvm-intel" "nvidia-uvm"];
|
||||
kernelModules = ["kvm-intel"];
|
||||
|
||||
initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
|
@ -47,40 +46,8 @@
|
|||
|
||||
hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware;
|
||||
|
||||
# NVIDIA settings
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.opengl = {
|
||||
nvidia = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
nvidia-vaapi-driver
|
||||
];
|
||||
extraPackages32 = with pkgs; [vaapiVdpau];
|
||||
enableCUDA = true;
|
||||
};
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = false;
|
||||
|
||||
# Vulkan is much more stable in Wayland
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
libva-utils
|
||||
nvidia-vaapi-driver
|
||||
nvtop-nvidia
|
||||
pciutils
|
||||
vdpauinfo
|
||||
cudaPackages.cudatoolkit
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue