From a7825c5b9a9c69dddd1904789ebbe413c5b6bf15 Mon Sep 17 00:00:00 2001 From: yuannan Date: Sun, 10 Mar 2024 19:42:41 +0000 Subject: [PATCH] 15ach6h --- lenovo/legion/15ach6h/README.md | 30 +++++++++++++++++++ lenovo/legion/15ach6h/default.nix | 11 +++++++ lenovo/legion/15ach6h/edid/16ach6h.bin | Bin 0 -> 384 bytes lenovo/legion/15ach6h/edid/default.nix | 17 +++++++++++ lenovo/legion/15ach6h/hybrid/default.nix | 36 +++++++++++++++++++++++ lenovo/legion/15ach6h/nvidia/default.nix | 26 ++++++++++++++++ 6 files changed, 120 insertions(+) create mode 100644 lenovo/legion/15ach6h/README.md create mode 100644 lenovo/legion/15ach6h/default.nix create mode 100644 lenovo/legion/15ach6h/edid/16ach6h.bin create mode 100644 lenovo/legion/15ach6h/edid/default.nix create mode 100644 lenovo/legion/15ach6h/hybrid/default.nix create mode 100644 lenovo/legion/15ach6h/nvidia/default.nix diff --git a/lenovo/legion/15ach6h/README.md b/lenovo/legion/15ach6h/README.md new file mode 100644 index 0000000..19f6c24 --- /dev/null +++ b/lenovo/legion/15ach6h/README.md @@ -0,0 +1,30 @@ +## Introduction +Due to the introduction of DDG feature, you may toggle DDG frequently, so for the default settings of this laptop, we use "specialization" feature of Nix so that you can easily select the required graphics card driver in the startup menu. +**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 + - system: `"x86_64-linux"` + - host os: `Linux 6.0.9, NixOS, 22.11 (Raccoon), 22.11beta19.c9538a9b707` + - multi-user?: `yes` + - sandbox: `yes` + - version: `nix-env (Nix) 2.11.0` + - channels(root): `"nixos-22.11"` + - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos` + ``` + ``` + $ lspci +... +01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1) +... +06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c5) +... +``` \ No newline at end of file diff --git a/lenovo/legion/15ach6h/default.nix b/lenovo/legion/15ach6h/default.nix new file mode 100644 index 0000000..fcd5746 --- /dev/null +++ b/lenovo/legion/15ach6h/default.nix @@ -0,0 +1,11 @@ +{ ... }: + +{ + imports = [ ./hybrid ]; + + 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" ]; + imports = [ ./nvidia ]; + }; +} diff --git a/lenovo/legion/15ach6h/edid/16ach6h.bin b/lenovo/legion/15ach6h/edid/16ach6h.bin new file mode 100644 index 0000000000000000000000000000000000000000..87256135d9cf7597594d013d06d1814148d2f91e GIT binary patch literal 384 zcmZSh4+ac;`3zzVARx!cvQ)z@0Z`;0gLANdh(d@lL*sD@VD92*sB6fjz{JGFEX(ki zwSnOo8!Ka0mP)P^0|OJY%~A%IER`%3pavR){{_O83=GVSB5U*+TmN&;XV7PmXRv2$ QW?*7qrLol@