Scaling_Governor: shows invalid argument

Hey guys,
I recently switched from windows to Manjaro, and am enjoying the experience so far,except for one problem,The right side of my laptop is getting Hot.I am using Lenovo Legion Y530, and after following this video: https://www.youtube.com/watch?v=YoHfPc9fOlI
, i think its because of the battery( but i am not sure)
I didnt have any of these problems in wndows.Also my battery life has reduced to 2 to 2:30 hrs wvwn if I am just using firefox or reading pdfs.
So after searching for some time i saw something about powersave and performance options in scaling governors. But when use the following command i get invalid argument

cat /sys/devices/system/cpu/cpu?/cpufreq/scaling_governor

cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: Invalid argument
cat: /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor: Invalid argument
cat: /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor: Invalid argument
cat: /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor: Invalid argument
cat: /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor: Invalid argument
cat: /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor: Invalid argument
cat: /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor: Invalid argument
cat: /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor: Invalid argument

cat /sys/devices/system/cpu/cpu?/cpufreq/scaling_available_governors

performance powersave
performance powersave
performance powersave
performance powersave
performance powersave
performance powersave
performance powersave
performance powersave

The info about my laptop is as follows:

System:    Host: srinjoy-xavier Kernel: 5.4.23-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.2.1 Desktop: KDE Plasma 5.17.5 
           Distro: Manjaro Linux 
Machine:   Type: Laptop System: LENOVO product: 81FV v: Lenovo Legion Y530-15ICH serial: <filter> 
           Mobo: LENOVO model: LNVNB161216 v: SDK0Q55722 WIN serial: <filter> UEFI: LENOVO v: 8JCN50WW date: 01/18/2019 
Battery:   ID-1: BAT0 charge: 6.8 Wh condition: 45.0/52.5 Wh (86%) model: SMP L17M3PG1 status: Charging 
CPU:       Topology: Quad Core model: Intel Core i5-8300H bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 8192 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 36812 
           Speed: 900 MHz min/max: 800/4000 MHz Core speeds (MHz): 1: 900 2: 902 3: 900 4: 900 5: 900 6: 900 7: 900 8: 900 
Graphics:  Device-1: Intel UHD Graphics 630 vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] driver: N/A bus ID: 01:00.0 
           Display: x11 server: X.Org 1.20.7 driver: intel resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel UHD Graphics 630 (Coffeelake 3x8 GT2) v: 4.6 Mesa 19.3.4 direct render: Yes 
Audio:     Device-1: Intel Cannon Lake PCH cAVS vendor: Lenovo driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           Sound Server: ALSA v: k5.4.23-1-MANJARO 
Network:   Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel port: 5000 bus ID: 00:14.3 
           IF: wlp0s20f3 state: up mac: <filter> 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Lenovo driver: r8169 v: kernel port: 3000 
           bus ID: 07:00.0 
           IF: enp7s0 state: down mac: <filter> 
Drives:    Local Storage: total: 1.03 TiB used: 32.14 GiB (3.1%) 
           ID-1: /dev/nvme0n1 vendor: Lenovo O.E.M. model: RPFTJ128PDD2EWX size: 119.24 GiB 
           ID-2: /dev/sda vendor: Seagate model: ST1000LM049-2GH172 size: 931.51 GiB 
Partition: ID-1: / size: 100.63 GiB used: 12.81 GiB (12.7%) fs: ext4 dev: /dev/nvme0n1p3 
           ID-2: /home size: 915.89 GiB used: 19.33 GiB (2.1%) fs: ext4 dev: /dev/sda1 
           ID-3: swap-1 size: 16.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p2 
Sensors:   System Temperatures: cpu: 55.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 259 Uptime: 2m Memory: 7.65 GiB used: 1.33 GiB (17.4%) Init: systemd Compilers: gcc: 9.2.1 Shell: bash 
           v: 5.0.16 inxi: 3.0.37

Can someone help me with my setting governor problem or better my heating problem ?
Any help is appreciated.
Thanks in advance.

Please edit your post and share the terminal output as text. For proper formatting use ``` above and bellow it.

Sorry i am new to this forum thing.Noted,is it better now?

Much better, yes :slight_smile:
What is the output of the command:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
and
cpupower frequency-info

A better way to deal with all this is to follow the wiki
https://wiki.archlinux.org/index.php/CPU_frequency_scaling#CPU_frequency_driver

the output of:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver

is:

intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate

and the output for:

cpupower frequency-info

is:

analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 800 MHz - 4.00 GHz
  available cpufreq governors: performance powersave
  Unable to determine current policy
  current CPU frequency: Unable to call hardware
  current CPU frequency: 899 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes

To me that looks fine.
Now, what option have you chose for the hybrid GPU that laptop has?

Can you tell me what do you mean by options,or how to access it.Currently i am using the intel gpu ,not hybrid or nvidia.

The link i provided explains that. On some models, a particular option is required so the dGPU is not powered on even if is not used, then you can use it in particular instances and properly turn it off when not in use.
Another thing to consider, is that some laptops require also some custom kernel boot parameters. Is quite an important stage on making a system run properly, but you need to get familiar with the explanations provided in the links i shared.


If you get stuck, just ask, but first make sure you at least read those topics.

Ok ,i will read the links and update you about it.Thanks for the help.

run these scripts
after making them executable

chmod +x performance.sh
chmode +x powesave.sh

run them with either
pkexec powersave.sh
or
sudo performance.sh

performance.sh

#!/bin/sh
    gov=performance
    if [ -n "$gov" ]; then
        for cpu in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
            printf '%s\n' "$gov" > $cpu; 2> /dev/null
        done
    fi


    energyperf=performance
    if [ -n "$energyperf" ]; then
        if [ -f /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference ]; then
            for cpu in /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference; do
                printf '%s\n' "$energyperf" > $cpu; 2> /dev/null
            done
        else
            pnum=$(echo $energyperf | sed -r 's/^performance$/0/;
                                s/^balance_performance$/4/;
                                s/^(default|normal)$/6/;
                                s/^balance_power?$/8/;
                                s/^power(save)?$/15/')

            x86_energy_perf_policy $pnum > /dev/null 2>&1
        fi
    fi



    nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=1" 2> /dev/null
    echo performance > /sys/class/drm/card0/device/power_dpm_state
    echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level
    echo performance > /sys/module/pcie_aspm/parameters/policy
    echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
    echo 1 > /sys/devices/system/cpu/cpufreq/boost

powersave.sh

#!/bin/sh

    gov=powersave
    if [ -n "$gov" ]; then
        for cpu in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
            printf '%s\n' "$gov" > $cpu; 2> /dev/null
        done
    fi


    energyperf=power
    if [ -n "$energyperf" ]; then
        if [ -f /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference ]; then
            for cpu in /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference; do
                printf '%s\n' "$energyperf" > $cpu; 2> /dev/null
            done
        else
            pnum=$(echo $energyperf | sed -r 's/^performance$/0/;
                                s/^balance_performance$/4/;
                                s/^(default|normal)$/6/;
                                s/^balance_power?$/8/;
                                s/^power(save)?$/15/')

            x86_energy_perf_policy $pnum > /dev/null 2>&1
        fi
    fi



    nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=2" 2> /dev/null
    echo battery > /sys/class/drm/card0/device/power_dpm_state
    echo low > /sys/class/drm/card0/device/power_dpm_force_performance_level
    echo powersave > /sys/module/pcie_aspm/parameters/policy
    echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
    echo 0 > /sys/devices/system/cpu/cpufreq/boost

Can you tell em what these scripts will do?

they set performance mode pr ppwersave mode by changing governor and power setting

Hey ,so I read a the articles and I have a few questions:
The ACPI kernel parameters that the author is talking about ,I dont face any of those problems, my tlp is showing enabled.,i can switch to hybrid and nvidia. But should i use the acpi_osi paramter?.

Also As told in this post https://archived.forum.manjaro.org/t/optimus-manager/67893?u=jvoid
where the author speaks about

I think my Nvidia GPU stays powered on even in Intel mode (my battery drains too fast)

this might be useful ,but i dont have nouveau drivers, i have the proprietary drivers and use bbswitch.

Also in this github link
https://github.com/Askannz/optimus-manager
where the author talks about
https://github.com/Askannz/optimus-manager#important--manjaro-kde-users

The two parameters he is talking about DisplayCommand and DisplayStopCommand ,i cant find it in my /etc/sddm.conf.

One thing i have noticed that i havent shared is that when i use web browsers like chrome or firefox,it tends to heat , other wise in case of simply reading slides or pdfs that heat is not that much .
Thanks.

So i just need to run powersave ones right,for the powersave option?

Also here is the conf file for optimus-manager:

cat /usr/share/optimus-manager.conf

[optimus]

# This parameter defines the method used to power switch the Nvidia card. See the documentation
# for a complete description of what each value does. Possible values :
#
# - nouveau : load the nouveau module on the Nvidia card.
# - bbswitch : power off the card using the bbswitch module (requires the bbswitch dependency).
# - acpi_call : try various ACPI method calls to power the card on and off (requires the acpi_call dependency)
# - none : do not use an external module for power management. For some laptop models it's preferable to
#           use this option in combination with pci_power_control (see below).
#           With that option set, you can also use the scripts nvidia-enable.sh and nvidia-disable.sh to
#           execute custom commands for power management.
switching=none

# Enable PCI power management in Intel mode.
# This option is incompatible with acpi_call and bbswitch, so it will be ignored in those cases.
pci_power_control=no

# Remove the Nvidia card from the PCI bus.
# May prevent crashes caused by power switching.
# Ignored if switching=nouveau or switching=bbswitch.
pci_remove=no

# Reset the Nvidia card at the PCI level before reloading the nvidia module.
# Ensures the card is in a fresh state before reloading the nvidia module.
# May fix some switching issues. Possible values :
#
# - no : does not perform any reset
# - function_level : perform a light "function-level" reset
# - hot_reset : perform a "hot reset" of the PCI bridge. ATTENTION : this method messes with the hardware
#         directly, please read the online documentation of optimus-manager before using it.
#         Also, it will perform a PCI remove even if pci_remove=no.
#
pci_reset=no

# Automatically log out the current desktop session when switching GPUs.
# This feature is currently supported for the following DE/WM :
# KDE Plasma, GNOME, XFCE, Deepin, i3, Openbox, AwesomeWM, bspwm
# If this option is disabled or you use a different desktop environment,
# GPU switching only becomes effective at the next graphical session login.
auto_logout=yes


[intel]

# Driver to use for the Intel GPU. Possible values : modesetting, intel
# To use the intel driver, you need to install the package "xf86-video-intel".
driver=modesetting

# Acceleration method (corresponds to AccelMethod in the Xorg configuration).
# Only applies to the intel driver.
# Possible values : sna, xna
# Leave blank for the default (no option specified)
accel=

# Enable TearFree option in the Xorg configuration.
# Only applies to the intel driver.
# Possible values : yes, no
# Leave blank for the default (no option specified)
tearfree=

# DRI version. Possible values : 2, 3
DRI=3

# Whether or not to enable modesetting for the nouveau driver.
# Does not affect modesetting for the Intel GPU driver !
# This option only matters if you use nouveau as the switching backend.
modeset=yes

[nvidia]

# Whether or not to enable modesetting. Required for PRIME Synchronization (which prevents tearing).
modeset=yes

# Whether or not to enable the NVreg_UsePageAttributeTable option in the Nvidia driver.
# Recommended, can cause poor CPU performance otherwise.
PAT=yes

# DPI value. This will be set using the Xsetup script passed to your login manager.
# It will run the command
# xrandr --dpi <DPI>
# Leave blank for the default (the above command will not be run).
DPI=96

# If you're running an updated version of xorg-server (let's say to get PRIME Render offload enabled),
# the nvidia driver may not load because of an ABI version mismatch. Setting this flag to "yes"
# will allow the loading of the nvidia driver.
ignore_abi=no

# Comma-separated list of Nvidia-specific options to apply.
# Available options :
# - overclocking : enable CoolBits in the Xorg configuration, which unlocks clocking options
#   in the Nvidia control panel.
# - triple_buffer : enable triple buffering.
options=overclocking


Thanks .

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by