diff --git a/asus/zephyrus/ga401/default.nix b/asus/zephyrus/ga401/default.nix index edb3a5b..726f58e 100644 --- a/asus/zephyrus/ga401/default.nix +++ b/asus/zephyrus/ga401/default.nix @@ -11,11 +11,11 @@ ]; hardware.nvidia = { - # PCI-Express Runtime D3 Power Management is enabled by default on this laptop - # But it can fix screen tearing & suspend/resume screen corruption in sync mode - modesetting.enable = lib.mkDefault true; # Enable DRM kernel mode setting - powerManagement.enable = lib.mkDefault true; + # This will also cause "PCI-Express Runtime D3 Power Management" to be enabled by default + modesetting.enable = lib.mkDefault true; + + dynamicBoost.enable = true; prime = { amdgpuBusId = "PCI:4:0:0"; diff --git a/dell/inspiron/5515/default.nix b/dell/inspiron/5515/default.nix index 5e1fa64..c2e8e31 100644 --- a/dell/inspiron/5515/default.nix +++ b/dell/inspiron/5515/default.nix @@ -29,5 +29,9 @@ # https://bbs.archlinux.org/viewtopic.php?id=266108 says linux >= 5.12 required boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") pkgs.linuxPackages_latest; + # sometimes boots to a black screen, and pressing alt+sysrq+k makes the + # display manager start + # fixed by early kernel modesetting + boot.initrd.kernelModules = [ "amdgpu" ]; } diff --git a/lenovo/legion/16ach6h/README.md b/lenovo/legion/16ach6h/README.md index f8c1190..19f6c24 100644 --- a/lenovo/legion/16ach6h/README.md +++ b/lenovo/legion/16ach6h/README.md @@ -3,6 +3,12 @@ Due to the introduction of DDG feature, you may toggle DDG frequently, so for th **But It will slow down NixOS evaluation by factor 2 and increase memory usage.** So if you don't need specialization feature, you can just use hybrid only configuration or nvidia only (DDG only) configuration +## Using multiple drives with this configuration + +When using more than one drive, the value of `hardware.nvidia.prime.amdgpuBusId` will change from the default of `PCI:5:0:0`. + +Make sure you override this default in your personal configuration. For two drives, it should be `PCI:6:0:0`. + ## Setup at the time of testing ``` $ nix-info -m diff --git a/lenovo/legion/16ach6h/default.nix b/lenovo/legion/16ach6h/default.nix index 523d9d0..fcd5746 100644 --- a/lenovo/legion/16ach6h/default.nix +++ b/lenovo/legion/16ach6h/default.nix @@ -6,13 +6,6 @@ specialisation.ddg.configuration = { # This specialisation is for the case where "DDG" (Dual-Direct GFX, A hardware feature that can enable in bios) is enabled, since the amd igpu is blocked at hardware level and the built-in display is directly connected to the dgpu, we no longer need the amdgpu and prime configuration. system.nixos.tags = [ "Dual-Direct-GFX-Mode" ]; - services.xserver.videoDrivers = [ "nvidia" ]; # This will override services.xserver.videoDrivers = lib.mkDefault [ "amdgpu" "nvidia" ]; - hardware = { - nvidia.prime.offload.enable = false; - amdgpu = { - amdvlk = false; - opencl = false; - }; - }; + imports = [ ./nvidia ]; }; -} \ No newline at end of file +} diff --git a/lenovo/legion/16ach6h/edid/default.nix b/lenovo/legion/16ach6h/edid/default.nix index ec77c24..81c44d5 100644 --- a/lenovo/legion/16ach6h/edid/default.nix +++ b/lenovo/legion/16ach6h/edid/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ...}: +{ pkgs, ... }: let # This file was obtained from the display while "DDG" mode was enabled. @@ -11,5 +11,7 @@ in hardware.firmware = [ chip_edid ]; boot.kernelParams = [ "drm.edid_firmware=edid/16ach6h.bin" ]; - boot.initrd.extraFiles."lib/firmware/edid/16ach6h.bin".source = pkgs.runCommandLocal "chip_edid" { } "cp ${./16ach6h.bin} $out"; -} \ No newline at end of file + # This fails at the moment, https://github.com/NixOS/nixos-hardware/issues/795 + # Extra refresh rates seem to work regardless + # boot.initrd.extraFiles."lib/firmware/edid/16ach6h.bin".source = pkgs.runCommandLocal "chip_edid" { } "cp ${./16ach6h.bin} $out"; +} diff --git a/lenovo/legion/16ach6h/hybrid/default.nix b/lenovo/legion/16ach6h/hybrid/default.nix index ab94e1c..51e10dc 100644 --- a/lenovo/legion/16ach6h/hybrid/default.nix +++ b/lenovo/legion/16ach6h/hybrid/default.nix @@ -11,6 +11,15 @@ ../edid ]; + # Still needs to load at some point if we want X11 to work + boot.kernelModules = [ "amdgpu" ]; + + # modesetting just doesn't work (on X11?), so get rid of it by only explicitly declaring nvidia + # Needed due to https://github.com/NixOS/nixos-hardware/commit/630a8e3e4eea61d35524699f2f59dbc64886357d + # See also https://github.com/NixOS/nixos-hardware/issues/628 + # options.services.xserver.drivers will have a amdgpu entry from using the prime stuff in nixpkgs + services.xserver.videoDrivers = [ "nvidia" ]; + hardware = { amdgpu.loadInInitrd = lib.mkDefault false; @@ -19,9 +28,9 @@ powerManagement.enable = lib.mkDefault true; prime = { - amdgpuBusId = "PCI:6:0:0"; + amdgpuBusId = lib.mkDefault "PCI:5:0:0"; nvidiaBusId = "PCI:1:0:0"; }; }; }; -} \ No newline at end of file +} diff --git a/starfive/visionfive/v2/linux-6.6.nix b/starfive/visionfive/v2/linux-6.6.nix index 8e7b445..5999dd6 100644 --- a/starfive/visionfive/v2/linux-6.6.nix +++ b/starfive/visionfive/v2/linux-6.6.nix @@ -9,8 +9,8 @@ let src = fetchFromGitHub { owner = "starfive-tech"; repo = "linux"; - rev = "7ccbe4604c1498e880cc63c7e8b45e3c55914d6d"; - hash = "sha256-iO7tnnWYfveVbyvVZKL0dDLwONijt1n0RUD1kTkOQew="; + rev = "13eb70da2a73187c8c7aece13d23d68928aa8210"; + hash = "sha256-bwB7Pc+Z+MWXPfWYdgtRGuhqjiNHLDGNCY62e4lBGvE="; }; inherit modDirVersion kernelPatches;