Check out EnvyControl! a much better alternative to this guide
Nvidia GPUs on Linux have always been a headache due to their propietary drivers, but this problem gets worse on Optimus laptops due to inexistent dynamic power management technologies on pre-Turing cards paired with Intel processors older than Coffee Lake. Read the official Nvidia documentation on dynamic PM for Turing and newer cards.
Turning off your Nvidia GPU will result in lower battery consumption when you don’t need it (eg programming, watching videos, etc).
Disable your Nvidia GPU
-
First blacklist the
nouveau
andnvidia
kernel modules- Create a file called
/etc/modprobe.d/block-nvidia.conf
with the following content:
- Create a file called
-
Add the Udev rules for disabling Nvidia GPU on boot
- Create a file called
/lib/udev/rules.d/50-disable-nvidia.rules
with the following content:
- Create a file called
-
Now reboot!
Re-enable your Nvidia GPU
- Remove the
/etc/modprobe.d/block-nvidia.conf
file - Remove the
/lib/udev/rules.d/50-disable-nvidia.rules
file - Reboot
Happy hacking!