From a318b2ebfae401ab3adecb88641d0da2111d0a4a Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Tue, 6 Sep 2022 18:49:29 +0000 Subject: [PATCH 1/8] apple/macbook-pro/11-5: explicitly turn on redistributable firmware --- apple/macbook-pro/11-5/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apple/macbook-pro/11-5/default.nix b/apple/macbook-pro/11-5/default.nix index a53b5d8..1fe60ae 100644 --- a/apple/macbook-pro/11-5/default.nix +++ b/apple/macbook-pro/11-5/default.nix @@ -10,9 +10,11 @@ in imports = [ ../. ../../../common/pc/laptop/ssd - ]; + # Enable broadcom-43xx firmware + hardware.enableRedistributableFirmware = true; + # Apparently this is currently only supported by ati_unfree drivers, not ati hardware.opengl.driSupport32Bit = false; From c38ec64187c534bcb6d1d99ec40269ea33fa080e Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Tue, 6 Sep 2022 19:32:22 +0000 Subject: [PATCH 2/8] apple/macbook-pro/11-5: Use the newer amdgpu driver --- apple/macbook-pro/11-5/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apple/macbook-pro/11-5/default.nix b/apple/macbook-pro/11-5/default.nix index 1fe60ae..d641abd 100644 --- a/apple/macbook-pro/11-5/default.nix +++ b/apple/macbook-pro/11-5/default.nix @@ -10,16 +10,15 @@ in imports = [ ../. ../../../common/pc/laptop/ssd + + # Radeon Venus XT is a GCN 1 microarchitecture + # (amdgpu driver support is experimental and must be explicitly enabled) + ../../../common/gpu/amd/southern-islands ]; # Enable broadcom-43xx firmware hardware.enableRedistributableFirmware = true; - # Apparently this is currently only supported by ati_unfree drivers, not ati - hardware.opengl.driSupport32Bit = false; - - services.xserver.videoDrivers = [ "ati" ]; - services.udev.extraRules = # Disable XHC1 wakeup signal to avoid resume getting triggered some time # after suspend. Reboot required for this to take effect. From a930f43803c1c7111cd53445b552437da5e8866d Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Wed, 7 Sep 2022 15:36:38 +0000 Subject: [PATCH 3/8] apple/macbook-pro/11-5: document amdgpu driver choice --- apple/macbook-pro/11-5/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apple/macbook-pro/11-5/README.md b/apple/macbook-pro/11-5/README.md index 17e5ef1..782c720 100644 --- a/apple/macbook-pro/11-5/README.md +++ b/apple/macbook-pro/11-5/README.md @@ -22,11 +22,19 @@ This configuration will **not** work with MacBook Pro 11,2 or 11,3 models. ## Graphics -The [MacBookPro11,4 and MacBookPro11,5](https://support.apple.com/kb/SP719) models ship with a discrete ATI graphics card (whereas MacBookPro11,2 and MacBookPro11,3 ship with NVidia cards). This is alongside the usual integrated Intel GPU. +The [MacBookPro11,4 and MacBookPro11,5](https://support.apple.com/kb/SP719) models ship with a discrete ATI/AMD graphics card (whereas MacBookPro11,2 and MacBookPro11,3 ship with NVidia cards). This is alongside the usual integrated Intel GPU. You may wish to look into dynamic switching between integrated and discrete graphics, but this config doesn't attempt it. +Currently this uses the experimental `si_support` to disable the older radeon driver and enable the more modern `amdgpu` driver. + ## Additional resources * Arch linux wiki: [MacBookPro11,x](https://wiki.archlinux.org/index.php/MacBookPro11,x) * Kernel patches: [MacBookPro11,x](https://bugzilla.kernel.org/buglist.cgi?quicksearch=macbookpro11) + +For more context about experimental `amdgpu` support, see: + +* [Enabling AMDGPU by default for SI & CIK (November 2021)](https://gitlab.freedesktop.org/drm/amd/-/issues/1776) +* [Enabling AMDGPU by default for SI & CIK (August 2020))](https://lists.freedesktop.org/archives/amd-gfx/2020-August/052243.html) +* [Feature support matrix](https://wiki.gentoo.org/wiki/AMDGPU#Feature_support) From 1d100017018efb0d79022dfe8c010f14250f9117 Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Wed, 7 Sep 2022 15:37:40 +0000 Subject: [PATCH 4/8] apple/macbook-pro/11-5: Links to hardware probes --- apple/macbook-pro/11-5/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apple/macbook-pro/11-5/README.md b/apple/macbook-pro/11-5/README.md index 782c720..8feb1c7 100644 --- a/apple/macbook-pro/11-5/README.md +++ b/apple/macbook-pro/11-5/README.md @@ -28,6 +28,16 @@ You may wish to look into dynamic switching between integrated and discrete grap Currently this uses the experimental `si_support` to disable the older radeon driver and enable the more modern `amdgpu` driver. +## Hardware probes + +Hardware probes generated with `nix run nixpkgs#hw-probe -- -all -upload`: + +* Probe [#305905e674](https://linux-hardware.org/?probe=305905e674) of Apple MacBookPro11,5 + +DRM (Direct Rendering Manager) snapshots generated with `drm_info -j | curl -d @- https://drmdb.emersion.fr/submit`: + +* Snapshot [#e8f8076f1f1b](https://drmdb.emersion.fr/snapshots/e8f8076f1f1b) + ## Additional resources * Arch linux wiki: [MacBookPro11,x](https://wiki.archlinux.org/index.php/MacBookPro11,x) From 821ddbaf1cb6ff5ecfdf12cf51759f6605a7dad7 Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Wed, 7 Sep 2022 15:41:28 +0000 Subject: [PATCH 5/8] apple/macbook-pro/11-5: make enableRedistributableFirmware an optional default (uniformity with other configs) --- apple/macbook-pro/11-5/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/macbook-pro/11-5/default.nix b/apple/macbook-pro/11-5/default.nix index d641abd..926753f 100644 --- a/apple/macbook-pro/11-5/default.nix +++ b/apple/macbook-pro/11-5/default.nix @@ -17,7 +17,7 @@ in ]; # Enable broadcom-43xx firmware - hardware.enableRedistributableFirmware = true; + hardware.enableRedistributableFirmware = lib.mkDefault true; services.udev.extraRules = # Disable XHC1 wakeup signal to avoid resume getting triggered some time From fd68d65507fc362f763bc8e6127e322b6e63e864 Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Wed, 7 Sep 2022 15:45:43 +0000 Subject: [PATCH 6/8] apple/macbook-pro/11-5: add to top-level README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3146eef..2561c80 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ See code for all available configurations. | [Apple MacBook Air 4,X](apple/macbook-air/4) | `` | | [Apple MacBook Air 6,X](apple/macbook-air/6) | `` | | [Apple MacBook Pro 10,1](apple/macbook-pro/10-1) | `` | +| [Apple MacBook Pro 11,5](apple/macbook-pro/11-5) | `` | | [Apple MacBook Pro 12,1](apple/macbook-pro/12-1) | `` | | [Asus ROG Strix G733QS](asus/rog-strix/g733qs) | `` | | [Asus ROG Zephyrus G14 GA401](asus/zephyrus/ga401) | `` | From a4345da27ed2ac532b60078cdb4d0093303b14d0 Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Wed, 7 Sep 2022 16:53:00 +0000 Subject: [PATCH 7/8] apple/macbook-pro/11-5: driver choice should be optional since si_support is experimental --- apple/macbook-pro/11-5/README.md | 23 +++++++++++++++++++---- apple/macbook-pro/11-5/default.nix | 4 ---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/apple/macbook-pro/11-5/README.md b/apple/macbook-pro/11-5/README.md index 8feb1c7..4c586e3 100644 --- a/apple/macbook-pro/11-5/README.md +++ b/apple/macbook-pro/11-5/README.md @@ -24,19 +24,34 @@ This configuration will **not** work with MacBook Pro 11,2 or 11,3 models. The [MacBookPro11,4 and MacBookPro11,5](https://support.apple.com/kb/SP719) models ship with a discrete ATI/AMD graphics card (whereas MacBookPro11,2 and MacBookPro11,3 ship with NVidia cards). This is alongside the usual integrated Intel GPU. -You may wish to look into dynamic switching between integrated and discrete graphics, but this config doesn't attempt it. +To switch from the older `radeon` driver to the newer `amdgpu` driver (via experimental `si_support`), include `nixos-hardware.nixosModules.common-gpu-amd-southern-islands` (or `${nixos-hardware}/common/gpu/amd/southern-islands`) in your configuration. This will get you vulkan support among other benefits. -Currently this uses the experimental `si_support` to disable the older radeon driver and enable the more modern `amdgpu` driver. +For example, in your `flake.nix`: + +```nix +nixosConfigurations = { + macbook-pro-11-5 = lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + nixos-hardware.nixosModules.apple-macbook-pro-11-5 + nixos-hardware.nixosModules.common-gpu-amd-southern-islands + { + # Your personal configuration + } + ]; + }; +}; +``` ## Hardware probes Hardware probes generated with `nix run nixpkgs#hw-probe -- -all -upload`: -* Probe [#305905e674](https://linux-hardware.org/?probe=305905e674) of Apple MacBookPro11,5 +* Probe [#305905e674](https://linux-hardware.org/?probe=305905e674) of Apple MacBookPro11,5 (with `amdgpu` driver) DRM (Direct Rendering Manager) snapshots generated with `drm_info -j | curl -d @- https://drmdb.emersion.fr/submit`: -* Snapshot [#e8f8076f1f1b](https://drmdb.emersion.fr/snapshots/e8f8076f1f1b) +* Snapshot [#e8f8076f1f1b](https://drmdb.emersion.fr/snapshots/e8f8076f1f1b) (with `amdgpu` driver) ## Additional resources diff --git a/apple/macbook-pro/11-5/default.nix b/apple/macbook-pro/11-5/default.nix index 926753f..434e8e7 100644 --- a/apple/macbook-pro/11-5/default.nix +++ b/apple/macbook-pro/11-5/default.nix @@ -10,10 +10,6 @@ in imports = [ ../. ../../../common/pc/laptop/ssd - - # Radeon Venus XT is a GCN 1 microarchitecture - # (amdgpu driver support is experimental and must be explicitly enabled) - ../../../common/gpu/amd/southern-islands ]; # Enable broadcom-43xx firmware From 33642d338f6b3a047a128b5ba574d18e34994da9 Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Wed, 7 Sep 2022 17:10:58 +0000 Subject: [PATCH 8/8] apple/macbook-pro/11-5: add a note about switching between integrated and discrete graphics --- apple/macbook-pro/11-5/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apple/macbook-pro/11-5/README.md b/apple/macbook-pro/11-5/README.md index 4c586e3..63fa119 100644 --- a/apple/macbook-pro/11-5/README.md +++ b/apple/macbook-pro/11-5/README.md @@ -43,6 +43,11 @@ nixosConfigurations = { }; ``` +## Power management + +You may also wish to look into dynamic switching between integrated and discrete graphics, but this config doesn't currently attempt it. +See the removed [hardware.amdHybridGraphics.disable](https://github.com/NixOS/nixpkgs/pull/33915) option for an entry point. + ## Hardware probes Hardware probes generated with `nix run nixpkgs#hw-probe -- -all -upload`: