disable bd prochot permanently or quickly lubuntu 18.04.2

7,691

Solution 1

I'va had exactly the same problem with my Dell 7558 laptop when I freshly installed Linux Mint after turning it on almost 2 years of hibernation. The CPU frequency remained at 500 MHz when plugged in but operated up to 2.7 GHz under battery power. (In fact, sometime plugging the power brick actually works fine without excessive throttling. But that's 1 out of 20 or blowing the connector with some compressed air cans. Maybe the problem lies in the faulty connector or battery...)

Anyway, I've found a neat script here:

https://github.com/yyearth/turnoff-BD-PROCHOT/blob/master/bdprochot_off.sh

#!/bin/bash
# 4005d --> 4005e

# Slightly modified for root

/sbin/modprobe msr
r=`/usr/sbin/rdmsr 0x1FC`
s='0x'$r'' 
f=$(($s&0xFFFFE))
sudo /usr/sbin/wrmsr 0x1FC "obase=16;$f"|/usr/bin/bc
echo "$r"" write to ""reg 0x1FC" 
echo "BD PROCHOT off."

Problem is, the script need to import(?) a third party kernel module: msr. I believe you have already installed it before running this kind of code by running

    sudo apt -y install msr-tools

So, you can run the script with 'sudo' after any start up. But then again, this is kind of clunky since we want this bd-prochot to be turned off as soon as we boot. Problem is, running this script on boot up time, such as using crontab with '@reboot bd-prochot-off-script.sh' doesn't work well since using 'modprobe' with third party tool is kind of blocked for some reason. (I'm not sure why, though) So, had to manipulate some module loading stuff in

    /etc/modules-load.d/ 

by creating a new conf file as root

    sudo touch /etc/modules-load.d/msr.conf

and putting 'msr' into the 'msr.conf' file.

Then added the script above into crontab

    sudo crontab -u root -e

as..

    @reboot /path/to/the/bd-prochot-off.sh

Now, the CPU throttling problem does not occur anymore. But then again, I believe this is just a workaround. Maybe changing the battery would work better in terms of 'getting rid of the stem of evil' type of solution. But then again, this laptop is not a very hotshot as of now (the end of 2020) and I do not want to spend a lot of dough on it before it perishes.

Solution 2

Resolve problem CPU lock in Ubuntu

I had the same problem with CPU stuck on 0.79 GHz and all you need to do is..

1) Disable bd prochot on Ubuntu 20.04

sudo apt-get install msrtool 

sudo modprobe msr 

sudo wrmsr 0x1FC 2

2) Check your actual CPU freq in realtime:

sudo apt install i7z 

sudo i7z

3) Use stress to simulate full CPU usage

sudo apt install stress

stress -c 8

Solution 3

I assume you used sudo, as described in the script, so the permission denied is not due to lack of userspace permission.

From https://github.com/tiziw/iuvolt/issues/11

In the notebookreview thread linked in credits someone noted that if Secure Boot is enabled wrmsr does not work as the writes are blocked from userspace.

In order for it to still work you'll have to either recompile the msr module or recompile the whole kernel if the module built into the kernel. You will have to either disable Secure Boot or recompile msr with the the patch mentioned here.

The line with "XX" did not work, as it is there as an example.

Share:
7,691

Related videos on Youtube

Mage in the Barrel
Author by

Mage in the Barrel

Updated on September 18, 2022

Comments

  • Mage in the Barrel
    Mage in the Barrel over 1 year

    So for some reason on my laptop I suffer from severe throttling issues when bdprochot is enabled, putting my cpu at a measly 400 MHz from it's 2.8 cap according to cpufreq-info and 380 mhz from 2.6 according to windows task manager.

    It persists across 3 different drives, 7 reinstalls of windows 10 and 7 reinstalls of 3 different linux distros. I've tried it on steam OS, Ubuntu gamepack and Lubunt. In windows I used throttle stop but that's not a thing on linux. I use an external fan lowering my temps with bdprochot off through throttlestop to the lower 40s and even without it I generally cap out at 67 and avg at 50 as such I'm not to concerned about the rumored heating issues from bdprochot.

    I tried the msr tools fix but that doesn't work I get the message saying

    wrmsr: pwrite: Operation not permitted.

    This is a laptop so there are no bios power settings.

    I followed a guide here (quote below)

    I came across the same problem and I found a solution which works for me. You'll have to download cpufrequtils.

    Run every command in Terminal: Note: The '-c' argument is for core number. If your CPU has four cores, run the given command for 0 through 3 and if your CPU has eight cores, then run the command for 0 through 7.

    sudo cpufreq-set -c 0 -g performance
    sudo cpufreq-set -c 1 -g performance
    sudo cpufreq-set -c 2 -g performance
    sudo cpufreq-set -c 3 -g performance
    sudo cpufreq-set -c XX -g performance
    sudo modprobe msr
    sudo rdmsr 0x1FC
    

    The XX here is the number of your core. After this step you'll get an output which you need to note down and then use in the next command.

    sudo wrmsr 0x1FC XXXXX 
    

    Here, XXXXX is the output from the previous command execution. Finally, to check if it has worked, run:

    cpufreq-info
    

    I excluded the line due to the fact that it cause an error output

     sudo cpufreq-set -c XX -g performance
    

    This worked on steam OS which is based on debrian 8: jessie but doesn't seem to work on lubuntu it only seems to edit the settings to performance

    The output from rdmsr changes every time I reboot.

    it's also sort of a pain to deal with all these commands every time I launch just to make my pc usuable.

    I changed the secure boot to on when I swapped to lubuntu in order to add the boot file to the load order so that might be whats preventing wrmsr from working.

    Even then it doesn't change the inherent problem that this issue persists as well as the fact that I have to spend time in the command line every time I boot up which let's face it is a huge headache.

    Specs

    • Model # Acer Spin SP-513-51-51PB-N16W1

    • CPU Intel i5-6200U @2.3Ghz dual core 4 logical cores

    • Ram: 16 gig DDR4

    • Hard drive: NVMe m.2 ssd 1tb

    • GPU: Intel hd 520

    • OS: Dual boot of Windows 10 home Ver 1809 KB4497934 and Lubuntu 18.04.2

      • The Ram and SSD are upgrades
    • Doug Smythies
      Doug Smythies almost 5 years
      please edit your question adding the actual msr registers and the values you tried to write to. I have heard of attempting to disable PROCHOT via changing bit 0 of 0X1FC from 1 to 0 working for some and not others. What is your processor make and model?
    • Mage in the Barrel
      Mage in the Barrel almost 5 years
      @DougSmythies sorry for the late relpy I was asleep I'll fix it asap.
    • Mage in the Barrel
      Mage in the Barrel almost 5 years
      Okay all done adding info lemme know if there's something else you need
    • Rinzwind
      Rinzwind almost 5 years
      This is a hardware problem. bdprochot kicks in when the processor gets to hot. "It persists across 3 different drives, windows 10 and 3 different linux distros." That should already indicate it is not a problem related to the OS and thus not Ubuntu, and makes it off topic.Easiest and probably most desirable fix: Underclock your cpu (and/or Gpu). It would fix it for any OS. Another option: check the thermal paste; that needs to be there and correctly applied. If not the processor will get a lot hotter than desired. Do you still have guarantee on it? If so I would return the machine if possible.
    • Rinzwind
      Rinzwind almost 5 years
      continued "disable bd prochot permanently " nope. If you do you will fry your processor. Fix the problem not a result of the problem ;-)
    • Mage in the Barrel
      Mage in the Barrel almost 5 years
      @Rinzwind as I said in the op the laptop only heats up to 42 degrees celcious under low load and 67 under high even with bdprochot disabled so I don't think it's overheating thats the problem it also starts instant as soon as I boot up and doesn't increase or decrease under high load. The fans also stay fairly quiet. I've checked the temp with both speed fan and throttle stop. and it's constant with those numbers. I also can't "fix the problem" as I only know the result of the problem not what's causing it.
    • Mage in the Barrel
      Mage in the Barrel almost 5 years
      continued from the previous comment: The reason I asked on a linux forum is I the only way I can make my pc remoetly usable (to my knowlege) is disabling bd prochot as I can't even run youtube at 180p without lag the way it is. I did that on windows with throttle stop but I need a way to disable it on linux. JIf bdprochot is activating at 42 degrees celcius literally less than 2x room tempuarture it's obviously defective.
    • Mage in the Barrel
      Mage in the Barrel almost 5 years
      In fact it is so slow that I can’t even type without waiting 2-3 seconds for a character to appear I looked it up 400mhz is at the level of a cpu from 1998. I’d honestly rather risk frying my cpu than deal with having my pc that slow.
    • Doug Smythies
      Doug Smythies almost 5 years
      When you write back to MSR 0X1FC, you have to set bit 0 to 0, other bits remain the same as you read. Then check by reading the MSR again. Do you know for certain what temperature, CPU package and, maybe, GPU, your hardware asserts the PROCHOT bit, and for sure that it is too low? It does seem dangerous to disable it. Are you familiar with using turbostat (linux-tools-common package) to monitor stuff? try: sudo turbostat --Summary --quiet --show PkgTmp,PkgWatt --interval 15. Also, the same without the --quiet might be informative.
    • HD189733b
      HD189733b over 4 years
      My DELL laptop runs into the same problem if I connect it with a power adapter that is less powerful than the original one. The laptop will be back to normal if I unplug the adapter and run with the battery.