You are not logged in.

#1 2021-12-12 19:56:20

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 157
Website

[SOLVED] Running a script as root at startup/login

Basically, the only way i can enable turbo boost, as found on the  appears to be, weirdly, via

sudo x86_energy_perf_policy --turbo-enable 1

which is pretty annoying since it means that I have to run it every time...
Since that might be useful, I'm running with KDE on an i5-8265, and I had the same problem on manjaro too.
Output of some commands, might be useful, I hope

sudo x86_energy_perf_policy --turbo-enable 1 && cpupower frequency-info
analisi della CPU 0:
  nessun modulo o modulo cpufreq sconosciuto per questa CPU
  CPU che operano alla stessa frequenza hardware: Not Available
  CPU che è necessario siano coordinate dal software: Not Available
  latenza massima durante la transizione:  Cannot determine or is not supported.
Not Available
  gestori disponibili: Not Available
  Unable to determine current policy
  current CPU frequency: Unable to call hardware
  current CPU frequency:  Unable to call to kernel
  boost state support:
    Supported: yes
    Active: yes
sudo x86_energy_perf_policy --turbo-enable 0 && cpupower frequency-info
analisi della CPU 0:
  nessun modulo o modulo cpufreq sconosciuto per questa CPU
  CPU che operano alla stessa frequenza hardware: Not Available
  CPU che è necessario siano coordinate dal software: Not Available
  latenza massima durante la transizione:  Cannot determine or is not supported.
Not Available
  gestori disponibili: Not Available
  Unable to determine current policy
  current CPU frequency: Unable to call hardware
  current CPU frequency:  Unable to call to kernel
  boost state support:
    Supported: no
    Active: no

Weird how the "Supported" part also switches from yes to no, together with the "Active"

sudo x86_energy_perf_policy --turbo-enable 0 && i7z
Cpu speed from cpuinfo 1800.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 1799 MHz
  CPU Multiplier 18x || Bus clock frequency (BCLK) 99.94 MHz

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
  TURBO DISABLED on 4 Cores, Hyper Threading ON
  Max Frequency without considering Turbo 1799.00 MHz (99.94 x [18])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  39x/38x/37x/37x
  Real Current Frequency 1593.07 MHz [99.94 x 15.94] (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp      VCore
        Core 1 [0]:       1574.59 (15.75x)      4.61    21.3       1    13.3    60.4    37      0.7345
        Core 2 [1]:       1593.07 (15.94x)      4.95    15.8       1    9.66    69.1    37      0.7394
        Core 3 [2]:       1592.44 (15.93x)      9.79    23.4       1     9.6    57.3    38      0.7391
        Core 4 [3]:       1578.28 (15.79x)      8.59      23       1    14.9    53.5    39      0.7441



C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver modes with cores idling)
C3 = Cores running with PLL turned off and core cache turned off
C6, C7 = Everything in C3 + core state saved to last level cache, C7 is deeper than C6
  Above values in table are in percentage over the last 1 sec
[core-id] refers to core-id number in /proc/cpuinfo
'Garbage Values' message printed when garbage values are read
  Ctrl+C to exit
sudo x86_energy_perf_policy --turbo-enable 1 && i7z
Cpu speed from cpuinfo 1799.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 1800 MHz
  CPU Multiplier 18x || Bus clock frequency (BCLK) 100.00 MHz

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
  TURBO ENABLED on 4 Cores, Hyper Threading ON
  Max Frequency without considering Turbo 1900.00 MHz (100.00 x [19])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  39x/38x/37x/37x
  Real Current Frequency 1973.29 MHz [100.00 x 19.73] (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp      VCore
        Core 1 [0]:       1902.45 (19.02x)      9.52    15.2       1      12    61.7    40      0.7295
        Core 2 [1]:       1931.17 (19.31x)      4.33    22.4       1    12.9      59    40      0.7345
        Core 3 [2]:       1740.76 (17.41x)      6.39    19.3       1    9.73    63.8    41      0.7345
        Core 4 [3]:       1973.29 (19.73x)       4.2    12.3       1    16.8    65.3    42      0.7395



C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver modes with cores idling)
C3 = Cores running with PLL turned off and core cache turned off
C6, C7 = Everything in C3 + core state saved to last level cache, C7 is deeper than C6
  Above values in table are in percentage over the last 1 sec
[core-id] refers to core-id number in /proc/cpuinfo
'Garbage Values' message printed when garbage values are read
  Ctrl+C to exit

Many thanks in advance!

Last edited by alba4k (2021-12-14 06:27:41)

Offline

#2 2021-12-12 20:13:31

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,296

Re: [SOLVED] Running a script as root at startup/login

Create a oneshot systemd service that runs the command e.g.  /etc/systemd/system/energyPerfPolicy.service

[Unit]
Description=Apply perf energy policy
ConditionVirtualization=!container

[Service]
Type=oneshot
ExecStart=/usr/bin/x86_energy_perf_policy --turbo-enable 1
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

systemctl enable energyPerfPolicy.service

see https://wiki.archlinux.org/title/System … unit_files as well.

Last edited by V1del (2021-12-12 20:18:47)

Offline

#3 2021-12-12 20:30:49

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Running a script as root at startup/login

How about this in /etc/tmpfiles.d/00-turbo.conf:

w /sys/devices/system/cpu/intel_pstate/no_turbo - - - - 0

Apologies if you've already tried writing to that file.


Jin, Jîyan, Azadî

Offline

#4 2021-12-12 23:44:11

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 157
Website

Re: [SOLVED] Running a script as root at startup/login

Thanks for both answers! You two spend a lot of time here, don't you? Not the first time I'm seeing you here
Appreciate it, though.
I will try both suggestons tomorrow and let you know
Also, I'd already tried using systemd, but that didn't work
Maybe I did something wrong, we'll see

Offline

#5 2021-12-13 19:01:37

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 157
Website

Re: [SOLVED] Running a script as root at startup/login

oki, V1del's solution with systemd seems to work pretty fine, thank you guys lmao

Offline

#6 2021-12-13 23:47:40

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Running a script as root at startup/login

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

Board footer

Powered by FluxBB