feat(hosts/orion): enable Nvidia GPU w/ PRIME

This commit is contained in:
Price Hiller 2024-08-11 14:51:55 -05:00
parent b2b5099d76
commit 3e7ea0bf7b
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
2 changed files with 29 additions and 36 deletions

View File

@ -28,13 +28,5 @@
];
};
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
libvdpau
];
};
services.spice-vdagentd.enable = true;
}

View File

@ -1,30 +1,31 @@
{ pkgs, config, ... }:
{
inputs,
lib,
pkgs,
...
}:
{
# NOTE: Disable Nvidia GPU
boot.extraModprobeConfig = ''
blacklist nouveau
options nouveau iwlwifi power_save=1 modeset=0
'';
services.udev.extraRules = ''
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA VGA/3D controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
'';
boot.blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidia_drm"
"nvidia_modeset"
services.xserver.videoDrivers = [ "nvidia" ];
environment.variables.VDPAU_DRIVER = "va_gl";
hardware = {
enableRedistributableFirmware = true;
graphics = {
enable = true;
extraPackages = with pkgs; [
vpl-gpu-rt
intel-media-driver
intel-vaapi-driver
libvdpau-va-gl
nvidia-vaapi-driver
];
extraPackages32 = with pkgs.driversi686Linux; [ intel-vaapi-driver ];
};
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta;
powerManagement.enable = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
};
};
}