I have been using this setup for gaming(aka game-mode) and power saving mode for around 2 years now, thought I would share. This is specifically for G5 15 SE Gaming Laptop.
The idea is to have 3 separate profiles for gaming, general use and battery life.
Restart your system after making all of these changes.
- Head over to DavidLapous/DellG5SE-Fan-Linux
- Download the
DellFan.cpp
and compile it usingg++ -std=c++17 -O2 -march=zen2 -Wall DellFan.cpp -o dellfan
- Next in
terminal
sudo grubby --args "processor.ignore_ppc=1 amdgpu.ppfeaturemask=0xffffffff ec_sys.write_support=1" --update-kernel=ALL
You don't need to follow other steps mentioned in DavidLapous/DellG5SE-Fan-Linux as I will go over them again here, but it is a good idea to read them.
The script is at dellfan-script
. Copy and paste it alongside the binary we just created
in /usr/bin
.
The script itself just changes fan speed and CPU/GPU power profiles.
In Gnome, you can use sudo nautilus
for an easy copy and paste.
- Copy and paste
dell_smm_hwmon.conf
into/etc/modprobe.d
- Similarly, copy and paste
dell-smm-hwmon.conf
into/etc/modules-load.d
If the module ec_sys
doesn't exists it means your kernel wasn't build with it,
try compiling your own kernel
with CONFIG_ACPI_EC_DEBUGFS=m
flag or setup DKMS.
We now need to give sudo access to this particular script and program so that we can use it with keyboards shortcuts.
- It should be located in
/etc
and namedsudoers
- Use
sudo gedit sudoers
to open it - Paste this at the end of the file:
ALL ALL=(root) NOPASSWD: /usr/bin/dellfan-script
ALL ALL=(root) NOPASSWD: /usr/bin/dellfan
You might have to find where you can make your own keyboard shortcuts specific to your distro, on
Gnome Settings -> Keyboard -> Keyboard Shortcuts -> View and Customize Shortcuts -> Custom Shortcuts -> +
The shortcuts themselves bind to:
sudo dellfan-script s
for batterysudo dellfan-script b
for boost/gamingsudo dellfan-script r
for normal use
Go through Optimizing-linux.
Feel free to raise any issue for queries.