Repository navigation
Update #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update #783
Changes from all commits
c780b24
e84bb92
a186a84
d729261
ddfba30
419bc51
e40d359
c044492
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,12 @@ This page is a step by step guide to get fan control working on T2 Macs. | |
|
|
||
| In some Macs, the fan has been found to work out of the box. In such cases, the driver is not required unless you want to force a certain speed or do some other configuration which can be done by the help of this driver. | ||
|
|
||
| If you are running a kernel version newer than 7.2 (check using `uname -r`), `t2fanrd` will not work on your system. You will need to use another fan-control daemon that supports standard hwmon paths (e.g., `fancontrol` or `thinkfan`). | ||
|
|
||
|
Comment on lines
+7
to
+8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My fork of t2fanrd supports hwmon. Not all distros have updated, but the upstream repo is archived now.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that your fork supports it, but for new users, its better that they use a standard fan daemon |
||
| Additionally, you must add `macsmc_hwmon.fan_control=1` to your kernel command line when using these daemons. | ||
|
|
||
| See: https://wiki.archlinux.org/title/Fan_speed_control | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Install `t2fanrd`. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,105 +2,25 @@ | |
|
|
||
| This page describes how to use the iGPU on MacBook Pros with Hybrid Graphics (2 GPUs). 13-inch MacBooks only have an iGPU and do not need this. Using the iGPU means you can save power by putting the more powerful AMD dGPU in a low power state when you don't need it. | ||
|
|
||
| This has been tested on the MacBookPro16,1 and the MacBookPro15,1. The 15,3 and 16,4 models are very similar and should work too. | ||
| This has been tested on All T2 MacBook Pros with Hybrid Graphics. | ||
|
|
||
| Make sure you have a T2 kernel of version greater than 6.9.8-1 (you can check this with `uname -r`). | ||
|
|
||
| ## Issues | ||
|
|
||
| If you experience system freezes followed by high fan speeds and sudden shutdowns (CPU CATERR), or if the AMD GPU is causing excessive heat, try the following solutions: | ||
|
|
||
| 1. Set the iGPU as the main GPU (instructions below) | ||
|
|
||
| 2. Set the AMD GPU Dynamic Power Management level from auto to low or high. Low can be safer option to avoid thermal issues or save battery. *Note this will not work on MacBookPro15,1 as the `amdgpu` driver does not support runtime PM on Polaris cards.* | ||
|
iurjscsi1101500 marked this conversation as resolved.
Resolved
|
||
|
|
||
| You can test it quickly with: `echo low | sudo tee /sys/bus/pci/drivers/amdgpu/0000:0?:00.0/power_dpm_force_performance_level` | ||
|
|
||
| To apply the low level automatically, create `/etc/udev/rules.d/30-amdgpu-pm.rules` file with the following contents (on NixOS, use `services.udev.extraRules` in your configuration): | ||
|
|
||
| ```plain | ||
| SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="low" | ||
| ``` | ||
|
|
||
| You can also control the AMD GPU DPM with GUI tools such as [radeon-profile](https://github.com/emerge-e-world/radeon-profile). For GPU intensive tasks like playing games, machine learning or rendering you can try setting the DPM to high instead. | ||
| Make sure you have a T2 kernel of version greater than 7.3.3 (you can check this with `uname -r`). | ||
|
|
||
| ## Making the iGPU the primary display adapter | ||
|
|
||
| By default T2 Macs with hybrid graphics use the dGPU as primary display adapter, which in return requires the dGPU to be always powered on. | ||
| To save energy and reduce battery consumption, we can force the iGPU to be the primary display adapter and default graphics accelerator in a first step. | ||
|
|
||
| 1. Configure apple-gmux to switch to the iGPU at boot | ||
|
|
||
| 1. Create `/etc/modprobe.d/apple-gmux.conf` with the following contents: | ||
|
|
||
| ```plain | ||
| # Enable the iGPU by default if present | ||
| options apple-gmux force_igd=y | ||
| ``` | ||
| 1. Configure the MacBook to switch to the iGPU at boot. | ||
| 1. You can use the **T2-Hybrid-gpu-control** app provided by KaiT2en: https://github.com/kaiT2en/KaiT2en-Fedora/tree/main/apps/t2-hybrid-gpu-control | ||
|
|
||
| 2. Or alternatively, add kernel parameter `apple_gmux.force_igd=1` | ||
| 2. Alternatively, you can use 0xbb's [gpu-switch](https://github.com/0xbb/gpu-switch#windows-810-usage) script. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link points to Windows bit. Have you copied pasted? |
||
|
|
||
| After reboot `glxinfo | grep "OpenGL renderer"` should show an Intel GPU. Running programs with `DRI_PRIME=1` will make them render on your AMD GPU. On Gnome, by right clicking an application you can choose to run it using dedicated graphics. | ||
|
|
||
| ## Disabling the dGPU | ||
|
|
||
| We can take this a step further and save substantial amounts of energy by deactivating the discrete graphics card. | ||
|
|
||
| 1. We will create a systemd unit that will use `vgaswitcheroo` to disable the discrete graphics card on boot. Enter the full codeblock below and execute it. | ||
|
|
||
| ```plain | ||
| sudo tee /etc/systemd/system/amdgpu-off.service >/dev/null <<'EOF' | ||
| [Unit] | ||
| Description=Disable AMD dGPU via vgaswitcheroo | ||
| After=systemd-modules-load.service | ||
| Before=display-manager.service | ||
|
|
||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/bin/sh -c 'for i in $(seq 1 30); do [ -e /sys/kernel/debug/vgaswitcheroo/switch ] && exec sh -c "echo OFF > /sys/kernel/debug/vgaswitcheroo/switch"; sleep 1; done; exit 1' | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
|
|
||
| sudo systemctl daemon-reload | ||
| sudo systemctl enable amdgpu-off.service | ||
| ``` | ||
|
|
||
| We can now run `sudo systemctl enable amdgpu-off.service` and reboot to disable our dGPU. This will decrease power draw on a MacBook significantly from around 20 to 9 Watts on idle using 50% display brightness, resulting in much longer battery life. | ||
| Enabling the dGPU again is done using `sudo systemctl disable amdgpu-off.service` and reboot. A more convenient solution using aliases is explained in the next step. | ||
|
|
||
| 2. We can quickly disable, enable and check the current status of the dGPU by creating persistent aliases. Add the following lines to `~/.bashrc`: | ||
|
|
||
| ```plain | ||
| alias dgpu-off='sudo systemctl enable amdgpu-off.service; sleep 2; sudo reboot' | ||
| alias dgpu-on='sudo systemctl disable amdgpu-off.service; sleep 2; sudo reboot' | ||
| alias dgpu-status='sudo cat /sys/kernel/debug/vgaswitcheroo/switch' | ||
| ``` | ||
|
|
||
| Start a new shell or run `source ~/.bashrc` to make the aliases available in the current shell. | ||
|
|
||
| From now on you can check the status of the dGPU by simply entering `dgpu-status` : | ||
|
|
||
| ```plain | ||
| $ dgpu-status | ||
| 0:DIS-Audio: :DynOff:0000:01:00.1 | ||
| 1:IGD:+:Pwr:0000:00:02.0 | ||
| 2:DIS: :Off:0000:01:00.0 | ||
| ``` | ||
|
|
||
| `IGD` is the iGPU and `DIS` is the dGPU. The position of the `+` shows the GPU currently in use as the display adapter, while `Pwr` and `Off` refer to their respective power status. | ||
| Executing the aliases `dgpu-off` and `dgpu-on` will enable and disable our `amdgpu-off` systemd service and reboot the computer. | ||
|
|
||
| **Example:** Given the status above, executing `dgpu-on` will reboot your Mac. After reboot `dgpu-status` should be: | ||
| There is a significant performance decrease when gaming or rendering with `DRI_PRIME=1` and the iGPU set as the primary GPU, compared to using the dGPU as the primary GPU. | ||
|
|
||
| ```plain | ||
| $ dgpu-status | ||
| 0:DIS-Audio: :DynAuto:0000:01:00.1 | ||
| 1:IGD:+:Pwr:0000:00:02.0 | ||
| 2:DIS: :Pwr:0000:01:00.0 | ||
| ``` | ||
| Also, there is no need to permanently disable the dGPU. With the new kernel, the dGPU automatically goes to sleep when not in use and wakes up when needed, such as when using `DRI_PRIME=1` or other applications that require it. | ||
|
iurjscsi1101500 marked this conversation as resolved.
Resolved
|
||
|
|
||
| ### Suspend workaround | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We literally have a fixed t2fanrd for Macsmc. wtf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using t2fanrd together with zonepower will lead to prochot btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for letting us know. Zonepower needs to be ported to t2linux then. Has the fan controller used by KaiT2en been depreciated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it has a switch for native and manual control. Native smc control is recommended. Our manual control is not known to cause prochot but needs to be confirmed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As said, new users should use standard fan daemons instead of t2fanrd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard t2fanrd does not work (the one mentioned in the wiki), is your fork in ubuntu and arch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu has working t2fanrd, with AdityaGarg8's fork which does the same thing. Arch is going to get updated soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't ship fan daemon bloat! Just dont! Users can decide themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sharpenedblade i personally agree with @deqrocks, for most systems fan daemons are bloat, and not required, for systems that have broken amdgpu firmware (iMacs), they can use lm-sensors or something else, we should divert users from t2fanrd as much as possible, because we should not maintain it forever yk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to remove it very soon
Im not saying that we should to tell users to use it, but we shouldn't say its broken.