Nixos on MacBook Air mid 2011

Hi,

It worked fine :-), but the cpu usage was high, even when doing nothing, acpid and acpi-notify were visible at the top of cpu usage

Even when trying several Intel and Mac specific changes to configuration.nix, cpu usage stayed high without doing anything

So when looking around the net, searching “acpid acpi-notify cpu” I found the solution for my MacBook Air, for your MacBook or other laptop or pc, when having a similar problem, it might be another interrupt number or something completely different

https://forum.manjaro.org/t/kworker-kacpid-over-70-of-cpu-dual-boot-mac-manjaro/61981

With this command:

grep . -r /sys/firmware/acpi/interrupts/

I found a non masked acpi interrupt with a large number behind it, gpe0x15

Then I added:

boot.kernelParams = [ "acpi_mask_gpe=0x15" ];

to configuration.nix, and rebooted (because of kernel commandline)

And there was silence! (the fan was also blowing without real reason)

The moment I took the picture, cpu usage went up a little…

Now I have a fine working silent laptop with Nixos! :slight_smile:

Good luck!

P.S.

Other (Mac or Intel) specific configuration I used in configuration.nix:


services.acpid.enable = true;
powerManagement.enable = true;
powerManagement.cpuFreqGovernor = "schedutil";
services.mbpfan.enable = true;
hardware.cpu.intel.updateMicrocode = true;
hardware.opengl.extraPackages = with pkgs; [
  vaapiIntel
  vaapiVdpau
  libvdpau-va-gl
  intel-media-driver
];
boot = {
  kernelModules = [ "applesmc" "i915" ];
  # https://forum.manjaro.org/t/kworker-kacpid-over-70-of-cpu-dual-boot-mac-manjaro/61981
  kernelParams = [ "hid_apple.iso_layout=0" "acpi_backlight=vendor" "acpi_mask_gpe=0x15" ];
};

services.xserver.deviceSection = lib.mkDefault ''
  Option "TearFree" "true"
'';
1 Like

You should contribute your findings to https://github.com/NixOS/nixos-hardware :slight_smile:

Thank you!

Most settings I mentioned at the end came from there, except the acpi masking trick

I am not sure how to contribute there, also because maybe not all MacBook Air 4 models, have the same problem, I do not know about that, maybe a new category for only my model (MacBookAir4,1) would be an idea

The interrupt problem might be caused by a driver problem, with a good acpi driver the trick could be obsolete?

From log:


kernel: ACPI Warning: SystemIO range 0x0000000000000428-0x000000000000042F conflicts with OpRegion 0x0000000000000400-0x000000000000047F (\
PMIO) (20200925/utaddress-204)                                                                                                                                      
kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
kernel: ACPI Warning: SystemIO range 0x0000000000000540-0x000000000000054F conflicts with OpRegion 0x0000000000000500-0x0000000000000563 (\
GPIO) (20200925/utaddress-204)                                                                                                                                      
kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
kernel: ACPI Warning: SystemIO range 0x0000000000000530-0x000000000000053F conflicts with OpRegion 0x0000000000000500-0x0000000000000563 (\
GPIO) (20200925/utaddress-204)                                                                                                                                      
kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
kernel: ACPI Warning: SystemIO range 0x0000000000000500-0x000000000000052F conflicts with OpRegion 0x0000000000000500-0x0000000000000563 (\
GPIO) (20200925/utaddress-204)                                                                                                                                      
kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver

I also see that the option:

powerManagement.cpuFreqGovernor = "schedutil";

Does not work, according to the log:

systemd-modules-load[616]: Failed to find module 'cpufreq_schedutil'

powerManagement.cpuFreqGovernor = "ondemand";

Would be better in my case

Hosted by Flying Circus.