Problem with CPU frequency on i7-1370P

Hi, I bought a new laptop recently, running this nixos configuration. The laptop has a i7-1370P which has 6 performance cores (2 thread each) and 8 E-core, for a total of 14 cores and 20 threads. It also has a frequency range from 400Mhz to 5.2Ghz.

I am facing issues with the CPU frequency when trying to do heavy work (for instance, compiling a lib with cmake). In such scenario the frequency throttle down to 800Mhz:

image

$ cat /proc/cpuinfo | grep "cpu MHz"
cpu MHz		: 800.008
cpu MHz		: 799.991
cpu MHz		: 800.016
cpu MHz		: 800.000
cpu MHz		: 800.016
cpu MHz		: 800.016
cpu MHz		: 799.991
cpu MHz		: 799.983
cpu MHz		: 800.008
cpu MHz		: 800.000
cpu MHz		: 799.991
cpu MHz		: 800.008
cpu MHz		: 799.984
cpu MHz		: 800.006
cpu MHz		: 799.983
cpu MHz		: 800.006
cpu MHz		: 799.963
cpu MHz		: 799.996
cpu MHz		: 799.991
cpu MHz		: 800.008
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
700000
699992
699978
700006
699998
700003
700003
700005
699997
700009
699993
699992
700014
700000
700000
699992
700013
700000
700007
700000

What i have tried so far

The first thing I did is looking into NixOS-hardware, but unfortunately, there is no module for my laptop (Thinkpad P16s gen2 Intel).

I have set the lastest available kernel from nixpkgs, using boot.kernelPackages = pkgs.linuxPackages_latest;, as I heard it had better support with newer CPU.

$ uname -a
Linux Sigmachine 6.12.3 #1-NixOS SMP PREEMPT_DYNAMIC Fri Dec  6 06:20:46 UTC 2024 x86_64 GNU/Linux

Then I started tweaking governor settings:

I made sure to use the following setting for powerManagement:

  powerManagement = {
    enable = true;
    cpuFreqGovernor = "performance";
  };

and also tried the following variant for this kernel parameters which i found on other similar discourse posts:

boot.kernelParams = [ "intel_pstate=active" ];
boot.kernelParams = [ "intel_pstate=disable" ];
boot.kernelParams = [ "intel_pstate=passive" ];

Disable this options, as a post suggested it could be part of the problem:

services.power-profiles-daemon.enable = false;

I also tried settings cpufreq.min setting to 5.0Ghz, and tried auto-cpufreq:

  services.auto-cpufreq.enable = true;
  services.auto-cpufreq.settings = {
    battery = {
      governor = "powersave";
      turbo = "never";
    };
    charger = {
      governor = "performance";
      turbo = "auto";
      scaling_min_freq = 520000000;
    };
  };

I feel like I am running out of options, and I am not quite familar with all the settings i had to manipulate so far. I am seeking for help to hoppefuly debug and fix this situation

I have similar symptoms with a 6 year old Dell 3541 with a 9th Gen Core i9-9880H. I’ve also tried all of the above without success.
One thing that I am able to do to get the CPU frequency back up is unplugging and then replugging in the power supply.
I’d be interested to know if it helps in your case.

Just tried this, and it seems that unplugging and replugging the powr supply lead a a brief period of the CPU begin at 1.0Ghz.

Here the raw number from cat /sys/devices/cpu/cpu*/cpufreq/scaling_cur_freq | tr '\n ' ' run within watch -n 0.1. I tried the manipulation at ~4s

800016 800024 800016 799973 800023 799986 799980 800008 800020 799978 799974 800016 800016 799983 799975 799983 800000 800024 799991 800000 
899981 899972 900000 799997 800010 800010 799997 799998 800013 799996 799996 900000 900009 899990 800016 799975 900018 900009 900000 899981 
900009 868311 868304 799997 799978 800008 799985 800010 800019 799960 800010 900027 899981 899981 868278 800000 844654 844526 900000 899972 
900018 900009 900018 799996 800048 800002 800009 800000 800012 800031 799993 846621 899990 900018 799975 799983 899972 899981 899990 899972 
900009 854683 854607 800022 800050 799995 800013 800017 800001 800029 799969 899990 900009 899990 800016 800024 851583 851567 900000 899972 
800000 800008 800016 799980 799987 800012 800010 799986 799989 800000 799991 799983 800000 799976 799983 799975 799991 799960 799983 799983 
800000 800000 799991 799985 799977 799994 799991 800018 800006 800004 799997 800008 800016 800016 800000 800008 800016 800007 800000 800008 
800000 799991 800000 800003 799991 799980 799985 800027 800003 800034 799992 799991 799983 799991 800023 800007 800007 800000 800008 800008 
800000 800000 800008 800016 800002 799968 799995 800034 800017 800014 800012 799967 800016 800000 800032 800000 800000 800008 800000 800000 
900000 900000 900000 800005 799997 799997 799991 799989 799973 800003 800004 899990 899990 900009 858310 900018 900018 900018 900000 900009 
833654 864898 864884 800019 799971 800000 800007 800023 800000 800012 799971 800000 899990 899972 845345 845331 800008 800000 900000 899981 
900000 849719 849692 799963 800001 799988 799991 800014 800001 800004 800000 900000 899981 899981 799991 799975 842647 842474 899990 900000 
851943 851803 851810 799987 799993 799993 800018 800010 800024 799971 799991 851804 900000 900000 800024 800032 846871 846870 899981 899981 
799991 839594 839630 800006 800018 800008 800019 800007 800018 799978 799997 800000 900009 899990 800024 800016 830508 830327 899972 899990 
800000 900009 899990 800012 800027 800005 799974 800010 800007 799999 799970 799991 899991 900008 856823 856850 799992 799984 900009 899991 
799991 799991 800000 800006 799986 799975 800006 800015 800006 800004 799991 800000 799975 799975 800000 800000 799991 799975 800000 799983 
799975 799975 800000 799987 800009 800004 799996 800030 799987 800041 799986 799991 800008 799992 800000 800000 800008 800016 800000 799992 
799983 800000 799991 799986 800005 799997 799995 800006 799979 799994 800015 800008 800000 799991 800008 800000 800024 800008 800000 800000 
863043 800000 799991 800004 800009 799965 800006 799985 799994 800011 799979 839728 900008 900018 899981 899990 800000 800024 900008 900017 
900000 851753 851858 799996 799960 800008 799990 800022 800030 800018 800005 851085 900000 900000 851122 799991 900018 900009 900000 899990 
899991 861436 861457 800003 800024 800017 800011 800000 799997 799990 799991 899990 899936 899945 841092 841088 899990 900009 900000 900009 
800008 800008 800024 800022 799987 799994 800025 799996 800005 799982 800008 800008 800008 800024 799991 800008 799991 799975 800016 800016 
800000 799983 800000 799998 799974 800013 799993 800001 799986 800021 799992 800016 800000 800000 800000 799983 799991 800016 800008 800016 
847345 851341 851328 800011 799997 800003 799995 800016 799974 799975 799998 900017 900000 900000 839761 839749 839749 839847 900000 900000 
857673 899990 900027 799954 800028 799979 799876 799982 800002 800014 799996 857725 900000 900024 839853 839865 800023 800016 900000 899990 
799967 847161 847110 800018 799983 800007 799995 799984 799989 799998 799984 800024 900000 900000 799991 800000 799975 839289 899972 899990 
899981 862706 862707 800003 800018 800042 800003 799970 800017 799992 799985 900027 900009 900009 799991 800000 799991 800008 900009 899981 
900009 899981 899972 800000 800016 800002 799994 799991 799956 799991 800013 859963 899990 899972 859735 859665 839034 839049 899981 900000 
799967 800000 800000 799996 800002 799990 800024 800005 800027 799992 799983 800024 799991 800000 800016 800024 800000 799991 800008 800008 
799991 800024 800023 799997 799992 799997 800014 799980 800015 800001 799970 799975 799983 799975 800016 800000 800000 800000 799991 800000 
800008 799991 799991 799968 800002 799985 799985 799998 800007 799969 799993 800000 800000 799983 799983 799975 800000 800016 799975 800008 
799991 800024 800000 800017 799994 800020 800028 799973 800017 799998 799991 900000 900018 900000 854892 854884 843804 843845 900027 900009 
900009 855771 855784 799998 800029 799986 799997 799998 800030 799979 799996 900000 900008 899990 848553 848555 848735 848715 900009 900000 
900018 900027 900000 800014 800032 800008 800007 799991 799997 800020 799987 899990 899990 900017 800024 800024 799975 799967 900000 899981 
899990 900009 900000 800017 800004 799985 800001 799980 800002 800001 800001 899990 900009 900036 799975 799983 848248 847971 900009 900009 
800008 799991 800008 799993 799989 800023 800007 799981 800006 799987 800022 800000 799991 800032 799991 800008 800008 799991 799991 800016 
800008 800008 800016 799989 799984 799997 799967 799996 799988 800000 799986 799983 800008 799991 800024 800000 800008 800000 799984 800000 
800048 800000 800000 799981 799985 800021 800019 800003 800036 800004 800000 800000 799991 799983 799983 799991 800008 799983 799975 799967 
800032 799991 799983 799987 800013 800016 800003 799976 799983 800016 799991 800016 800016 800008 799967 800008 799991 800000 800000 800008 
799991 799991 799983 800000 800016 800031 799994 800028 800009 799958 799995 800000 799991 799975 800000 800024 799975 799991 800008 800024 
800016 800000 800016 799974 799980 800016 799970 800004 799996 800017 799995 800023 800024 799991 800000 800008 800016 800008 800000 799991 
800000 899981 899982 800005 800005 799985 800023 799990 800015 799986 800017 800008 900009 900027 800000 799983 856824 856825 900009 900018 
799984 899981 899972 800000 799988 799990 800007 800020 800021 800010 800028 799983 899990 899990 799983 799975 845449 845415 899972 899972 
800008 900009 900009 799995 799997 799969 799975 800013 799987 799980 800010 844017 900000 900018 843862 843875 899990 899981 900000 900009 
799991 899990 900009 799987 800020 800005 800024 799996 800009 799982 800008 800031 900000 900000 800010 799989 899988 899988 900011 900018 
900009 850497 850491 800005 800027 799979 800002 800004 800006 799991 799958 854005 900009 900018 854202 854207 800000 800000 900009 899981 
799991 843629 843640 800000 799963 800017 800004 799990 800000 800005 800000 843591 900062 900015 853843 853859 800014 800000 900018 899990 
939311 999989 1000000 799991 800014 799988 800021 800006 800036 799976 799984 1000020 999969 999969 900000 900000 1000000 1000030 999989 1000010 
941657 950032 950004 800004 799986 799994 800008 800005 800017 800012 799963 1000000 999989 999989 1000000 999979 966047 966073 999979 1000010 
999989 1000020 1000000 799997 799973 799973 799993 800014 800005 800017 799991 1000000 1000010 1000010 899972 900000 1000010 1000000 1000000 1000029 
899990 899990 899990 800026 799992 800032 800005 800007 800012 799967 800000 900000 899990 900008 900009 899990 900000 900027 900036 900009 
899972 836129 836117 799961 800013 800012 800002 799997 800010 800011 800010 899990 899972 899981 866817 866801 866789 866852 900009 899972 
941917 1000010 999989 800015 800012 799979 799985 800010 800013 799971 800044 942101 999989 1000010 952950 952930 900018 899990 1000000 1000000 
1000040 1000020 1000010 799995 800008 799991 799984 799989 799989 799997 800000 1000019 1000010 1000009 861686 861683 900018 900027 1000000 1000000 
953828 900027 900000 799989 800035 800002 799995 800003 800005 799967 800000 953602 1000000 1000020 899972 899981 900009 899990 999989 999979 
1000020 999979 1000000 799984 800008 799975 800019 800007 799994 800020 799994 999989 999979 999979 899990 900000 954970 954974 1000000 1000000 
975750 999989 1000030 800017 800031 800020 800021 800026 800005 799990 799987 945405 1000000 1000000 900000 899972 953415 953376 999979 1000000 
1000000 962710 962677 799995 799980 800026 800005 799995 800002 799978 799993 1000000 1000010 999989 899990 899972 900000 900009 1000000 1000000 
1000000 1000000 999990 800005 800005 799997 799998 799976 799989 800026 800010 1000000 1000000 1000010 924120 924115 899972 899972 1000010 999989 
900000 854797 854798 799984 799976 799958 800003 800022 800010 800002 799996 849477 900009 900009 799983 800000 800000 800008 900000 899972 
842853 900000 900000 800006 800000 799990 799996 800013 800015 799975 799985 800000 900000 900018 799991 799991 800000 800024 899963 900009 
800016 899981 900000 799983 800022 800016 799986 800031 799995 799982 800014 800024 899990 899972 799991 800000 859016 859007 900009 899981 
1000020 949219 949170 800007 800002 799998 799991 800002 799982 800022 800006 1000030 1000000 999989 900018 900018 900000 900018 1000000 1000010 
1000030 999989 999989 799973 800001 800006 799982 799985 799979 800007 799957 1000010 1000020 999969 900018 900018 968802 968783 999979 999989 
900027 900009 900009 800026 800004 800005 799990 800008 799987 799979 799988 900009 900000 900000 851770 851797 900009 899990 900000 899972 
1000041 980323 980354 799955 799956 799982 800027 799993 799950 799977 800025 1000000 999957 999978 899980 931663 931629 931627 1000000 999989 
935176 1000000 1000030 799996 800018 800014 799994 800007 799973 799973 799983 934093 1000000 1000016 900007 900000 957042 957028 999991 999986 
1000000 1099977 1100000 800029 800001 799989 799992 799984 800002 800001 799992 1049863 1099988 1100022 1000000 1000010 1050278 1050223 1100000 1099988 
1025346 1099988 1100022 800009 799989 800024 800030 799996 800030 799986 799991 1038161 1099977 1099988 1000019 1000000 1060458 1060448 1100000 1100010 
1042592 1100000 1099988 799947 800018 800024 799996 800002 799980 800025 800008 1042386 1100011 1100000 1000000 1034640 1034567 1034596 1099988 1099977 
1099977 1099977 1099977 799984 800011 800044 800004 799994 800005 800008 800018 1100011 1100022 1100011 1000000 1000010 1052208 1052194 1018074 1018019 
1100011 1099977 1099977 799970 800007 799987 799985 800019 799998 800020 800000 1100000 1100000 1100011 1034331 1034393 1100022 1100011 1099988 1100011 
1100022 1099966 1100021 799993 800012 799985 799992 800005 799987 799983 800016 1100000 1100022 1099977 999989 1000000 1064213 1064201 1099988 1100000 
1070708 1099976 1100000 799981 800004 799962 799991 800001 800007 799983 799995 1070862 1099988 1100000 1000000 1000000 1000010 1000010 1100011 1099977 
1100000 1099920 1100000 799935 799914 800051 799957 800079 799989 799988 799985 1100000 1099989 1100021 1021215 1021210 1100011 1100022 1100033 1100011 
1000016 1100011 1100033 800015 800004 799991 800024 800005 799985 799992 800009 1100000 1100000 1100000 1039947 1039941 1039600 1039611 1100000 1099991 
1057346 1057591 1057570 800001 800018 799998 800008 800019 799985 799976 800020 1033422 1099988 1100000 999989 999989 1000010 999979 1100022 1100022 
1022975 1100011 1100022 800019 799986 799988 800011 799981 799975 800003 799975 1022768 1100000 1100022 999989 1000000 1000000 1000010 1100011 1100000 
1000010 962084 962014 800000 799998 799987 800006 800003 799984 800019 799989 969827 1000010 1000020 900027 900018 917404 917413 1000000 1000000 
899990 999979 999969 799995 800007 800012 800004 800020 799990 800008 800009 899981 1000000 1000000 956517 956517 900009 899990 999979 1000000 
900000 952167 952144 799993 799956 800010 799987 800007 799994 800017 800000 900000 1000000 999989 900018 900018 900009 900000 1000020 1000010 
900009 1000000 1000000 799974 799996 799975 799995 800003 800015 800000 799977 934154 1000010 1000010 900000 900009 930066 930043 1000000 1000000 
835348 835190 835192 799988 799996 799992 799977 799972 800027 800015 799991 840619 900008 900009 840849 841182 840597 840619 900000 900000 
800032 900036 900018 800018 800009 800012 800012 800019 800024 800018 799991 842294 899981 899990 799983 799983 800008 800024 899981 899990 
900018 899990 900027 799986 799994 799992 800028 800021 799968 800008 800001 900000 899981 900018 799983 800000 800000 800008 900000 899990 
833288 899981 874371 800011 800024 799976 800022 800013 800035 800026 800008 874353 900000 899981 800016 800000 800000 800000 900000 900000 
800007 900018 900009 799998 799977 799981 799995 800012 799978 800029 799984 799991 899990 900000 799991 800008 828596 828586 900000 899990 

Here is somes of the core values plotted (put 4 to make it readable, red line is about when i unplugged and replugged the power supply)

OK, that seems much worse than what I experience. After unplugging (waiting a few seconds) and plugging it back in, it is anywhere from 15 minutes to a few hours before the CPU is pegged at 800MHz again.
Hopefully someone else can provide a more useful answer than me!

Maybe this will help, or just parts of it:

  powerManagement.powertop.enable = true;                           # enable powertop auto tuning on startup.

  services.system76-scheduler.settings.cfsProfiles.enable = true;   # Better scheduling for CPU cycles - thanks System76!!!
  services.thermald.enable = true;                                  # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs)
  services.power-profiles-daemon.enable = false;                    # Disable GNOMEs power management
  services.tlp = {                                                  # Enable TLP (better than gnomes internal power manager)
    enable = true;
    settings = {                                                    # sudo tlp-stat or tlp-stat -s or sudo tlp-stat -p
      CPU_BOOST_ON_AC = 1;
      CPU_BOOST_ON_BAT = 0;
      CPU_HWP_DYN_BOOST_ON_AC = 1;
      CPU_HWP_DYN_BOOST_ON_BAT = 0;
      CPU_SCALING_GOVERNOR_ON_AC = "performance";
      CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
      CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
      CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
      START_CHARGE_THRESH_BAT0 = 75;
      STOP_CHARGE_THRESH_BAT0 = 81;
    };
  };
1 Like

Thanks! I’ve tried tlp without success, I didn’t know about the system76-scheduler. I’ve just updated my laptop’s configuration and will try it out. I’m not using the laptop much at the moment, so it may take a while to be sure.
Thanks again.

Just tried your snippets, and it is the best so far!
It seems to keep running at 2.5Ghz when using all the core, which more than twice better!

image

Thanks you for this huge improvment!

Here is the graph considering of my CPU frequency snapshot when putting it to load (only kept one of each result group for readability)

Interestingly, It seems to keep up at 3.5Ghz for a few second when I just started to put it on work, the temperature reports 70°C

1 Like