From 70a8ff0a2511c300a7ab4dc8a9ab03328d52da5a Mon Sep 17 00:00:00 2001 From: Steffen Weitz Date: Sun, 26 Mar 2023 23:53:18 +0200 Subject: [PATCH 1/4] Add settings for AMD Raphael iGPU --- common/cpu/amd/raphael/igpu.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 common/cpu/amd/raphael/igpu.nix diff --git a/common/cpu/amd/raphael/igpu.nix b/common/cpu/amd/raphael/igpu.nix new file mode 100644 index 0000000..1192d41 --- /dev/null +++ b/common/cpu/amd/raphael/igpu.nix @@ -0,0 +1,15 @@ +{ lib, pkgs, ... }: + +{ + # Disables scatter/gather which was introduced with kernel version 6.2 + # It produces completely white or flashing screens when enabled while using the iGPU of Ryzen 7000-series CPUs (Raphael) + + imports = [ ../. ]; + + boot = lib.mkMerge [ + (lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") { + kernelPackages = pkgs.linuxPackages_latest; + kernelParams = lib.mkMerge [["amdgpu.sg_display=0"]]; + }) + ]; +} From 5d4755338109a5c6600650a7246b267bf7e2ea11 Mon Sep 17 00:00:00 2001 From: Steffen Weitz Date: Mon, 27 Mar 2023 10:34:07 +0200 Subject: [PATCH 2/4] Remove unnecessary mkMerge --- common/cpu/amd/raphael/igpu.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cpu/amd/raphael/igpu.nix b/common/cpu/amd/raphael/igpu.nix index 1192d41..45d97d3 100644 --- a/common/cpu/amd/raphael/igpu.nix +++ b/common/cpu/amd/raphael/igpu.nix @@ -9,7 +9,7 @@ boot = lib.mkMerge [ (lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") { kernelPackages = pkgs.linuxPackages_latest; - kernelParams = lib.mkMerge [["amdgpu.sg_display=0"]]; + kernelParams = ["amdgpu.sg_display=0"]; }) ]; } From 5fc0f2352069cadea929afe201532b8673488ab3 Mon Sep 17 00:00:00 2001 From: Steffen Weitz Date: Mon, 27 Mar 2023 21:18:10 +0200 Subject: [PATCH 3/4] Add module import to flake --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index bd5ad10..8a2f54f 100644 --- a/flake.nix +++ b/flake.nix @@ -168,6 +168,7 @@ common-cpu-amd = import ./common/cpu/amd; common-cpu-amd-pstate = import ./common/cpu/amd/pstate.nix; + common-cpu-amd-raphael-igpu = import ./common/cpu/amd/raphael/igpu.nix; common-cpu-intel = import ./common/cpu/intel; common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix; common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake; From 9dbe8dea5fee7180991f4a65d1a5876422f33681 Mon Sep 17 00:00:00 2001 From: Steffen Weitz Date: Wed, 29 Mar 2023 11:32:52 +0200 Subject: [PATCH 4/4] Add condition for kernel version 6.2 and above --- common/cpu/amd/raphael/igpu.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/cpu/amd/raphael/igpu.nix b/common/cpu/amd/raphael/igpu.nix index 45d97d3..82514c2 100644 --- a/common/cpu/amd/raphael/igpu.nix +++ b/common/cpu/amd/raphael/igpu.nix @@ -1,6 +1,7 @@ { lib, pkgs, ... }: { + # Sets the kernel version to the latest kernel to make the usage of the iGPU possible if your kernel version is too old # Disables scatter/gather which was introduced with kernel version 6.2 # It produces completely white or flashing screens when enabled while using the iGPU of Ryzen 7000-series CPUs (Raphael) @@ -11,5 +12,9 @@ kernelPackages = pkgs.linuxPackages_latest; kernelParams = ["amdgpu.sg_display=0"]; }) + + (lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.2") { + kernelParams = ["amdgpu.sg_display=0"]; + }) ]; }