12

So, I use AIO device and that means this device always plugged in, and I can use performance mode but every time I reboot it auto-set to balance mode. How can I use performance mode permanently?

This what I talk about

3 Answers3

10

Actually there is an easy way which does not require any compilation or script writing.
Simply put the command powerprofilesctl set performance into your Startup Applications or into a file that will be run during startup.

John
  • 183
3

This link https://gitlab.freedesktop.org/hadess/power-profiles-daemon is providing all the details required for command line.

Installation Steps

git clone https://gitlab.freedesktop.org/hadess/power-profiles-daemon.git
cd power-profiles-daemon
meson _build -Dprefix=/usr
ninja -v -C _build install

to know which profile is active run below command

gdbus introspect --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles

some of the result

  interface net.hadess.PowerProfiles {
    methods:
    signals:
    properties:
      readwrite s ActiveProfile = 'balanced';

to set the Performance mode run the below command

gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' "<'performance'>"

Available Profiles

  1. power-saver
  2. balanced
  3. performance

Try this command and reboot and see for the persistence. If the profile is changing back to what you dont want, then put the above command in startup command list.

0

Pratap answer above really works, at least on Ubuntu 24.04 on Asus Vivobook.

Here is my python function used in https://github.com/SensorsINI/dextra-roshambo-python. log is our logging instance, replace with print if you don't have a logger.

def set_processor_performance_mode(mode:str):
    modes=('power-saver','balanced','performance')
    if mode is None or not mode in modes:
        log.error(f'mode "{mode}" must be in {modes}')
        return
    cmd=f"gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' \"<'{mode}'>\""
    log.debug(f'****** setting power mode with "{cmd}"')
    result=subprocess.run(cmd,check=True, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,text=True)
    if result.returncode==0:
        log.debug(f'performance {mode} setting successful: result={result}')
    else:
        log.error(f'performance {mode} command "{cmd}":\n result={result}\n')