From 9d7abb04464c17eb90b3763cee907464b5dc3a15 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sun, 5 Jan 2025 07:42:47 +0100 Subject: [PATCH] Setup nvidia-offload the GPU (Nvidia A500) --- system/_sigmachine.nix | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/system/_sigmachine.nix b/system/_sigmachine.nix index fa88bde..b0092d6 100644 --- a/system/_sigmachine.nix +++ b/system/_sigmachine.nix @@ -1,8 +1,39 @@ -{ lib, ... }: { +{ pkgs, lib, ... }: { boot.loader.grub.gfxmodeEfi = lib.mkForce "1920x1200x32"; system = { copySystemConfiguration = false; stateVersion = "24.05"; }; + hardware.graphics = { + enable = true; + + extraPackages = with pkgs; [ + amdvlk + intel-media-driver + libvdpau-va-gl + nvidia-vaapi-driver + vaapiIntel + vaapiVdpau + vulkan-validation-layers + mesa.drivers + ]; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + powerManagement.enable = false; + powerManagement.finegrained = false; + open = false; + nvidiaSettings = true; + + prime = { + offload.enable = true; + offload.enableOffloadCmd = true; # install `nvidia-offload` + + intelBusId = "PCI:0:02:0"; + nvidiaBusId = "PCI:3:0:0"; + }; + }; + }