Intel MSR turbo twiddle - Increased all-core performance on power-limited Intel CPUs (dubious utility?)

2023/11/02

I was recently screwing around with Intel XTU on Windows on my PC, since it is purportedly able to overclock my strange engineering sample laptop CPU that was converted to a desktop CPU with non-Z motherboards. That is half true. I was able to get a slight bump on my all-core turbo frequency, but within reasonable limits, and up to the Aliexpress vendor’s advertised 3.3ghz per core from the ~2.9 I was getting before. This inspired me to go back and start playing with turbo-related Intel CPU model specific registers again, as I had researched it in the past enough to find which registers to twiddle.

It was necessary for me to also bump some power limits via intel-rapl to maintain 3.3ghz at all times. This is not an issue because the default power limit of my CPU is 35/45W (unsure - vendor says 35w, default value says 45w) and my CPU never went above 60 degrees in the first place under sustained all-core load. It’s bumped to 75/85W but seems to be limited to 65W self-rated power draw by some other aspect of my hardware (possibly mobo, possibly another invisible CPU limit)

The actual value you plug into the MSR depends on the number of physical cores you have as well as the maximum single-core frequency of your CPU. In my case, 0x242424242424, hex 24 (dec 36) six times in a row, because I have a hexa core, 3.6GHz CPU. If you’re not sure what value to use just rdmsr 0x1AD and look at the last two bytes. I’m sure this corresponds to some multiplier but I’m not sure what it’s called.

I have no idea of the actual utility of this on more normal CPUs. My CPU is extremely unusual in that it is power limited to 35w by default but is also unlocked, since it’s a weird ass engineering sample. This was tested on a Coffee Lake CPU, this may differ significantly for CPUs much older or younger.

Here it is as a NixOS module. Requires root due to writing to CPU MSRs. The necessary commands are in the ‘script’ section.

Future update: This results in significantly increased CPU temperatures. Shocking, I know. My temps never got that high in the first place (topping out at like, 65C if I drive all the cores for a while) but now I will transiently get temperatures up to 60C from what I consider normal usage. I am using a low-profile cooler, though, so if you have some competent CPU cooling you’re probably fine.

{ config, pkgs, ... }:

{
  systemd.services.msrTurboTwiddle = {
    wantedBy = [ "graphical.target" ];
    enable = true;
    serviceConfig = {
      User = "root";
      Group = "root";
    };
  script = ''
    echo "75000000" > /sys/class/powercap/intel-rapl:0/constraint_0_power_limit_uw;\
    echo "85000000" > /sys/class/powercap/intel-rapl:0/constraint_1_power_limit_uw;\
    ${pkgs.msr-tools}/bin/wrmsr 0x1AD 0x242424242424
  '';
  };
}
>> Home