You are not logged in.

#1 2017-09-18 19:59:36

setzer22
Member
Registered: 2014-07-26
Posts: 47

System throttles cpu to minimum frequency when playing some games

I have been experiencing the following issue for a while:

Sometimes, games seem to randomly perform poorly on my machine. The behaviour is not fixed by a reboot, and it seems to only happen on native games (wine games don't seem to have that problem). I've been testing on the following games, the behaviour is consistent in all of them:

- Middle Earth: Shadow of Mordor
- Borderlands 2
- Mad Max
- The Witcher 2

By monitoring the CPU and GPU while playing, I've been able to notice that:

- Sometimes, nvidia-smi reports a power state of P8 for the GPU when playing, however, it is not always the case.
- Always, consistently, when the issue is present (the framerate drops to about a half), the CPU is throttled at 800MHz (having a maximum of 3500MHz). I checked that by using the following command: 'watch grep \"MHz\" /proc/cpuinfo'

I have been doing lots of tests, trying to isolate what behaviour triggered that issue. After some thorough testing, it seems I can replicate this by unplugging the charger and letting the computer discharge to somewhere near 20%: At that point the CPU is throttled even the charger is plugged in, but *only* when one of the games (and possibly others I cannot test) is running, when the game is not running I can see the CPU frequency accomodate to the current load, ranging from 800 to 3500MHz.

Setting the cpu governor to either powersave or performance has no effect whatsoever. I also thought about removing the battery so the laptop runs on AC power directly, but that had no effect either. The only thing that seems to improve the issue is letting the laptop charge up until the point where the laptop's battery circuit decides to disable charging and run on AC power (the charge led turns off). Once the battery is full, throttling is fixed again (no need of a reboot).

Where should I start to debug this werid behaviour?

Thanks in advance!

NOTE: I put this on kernel issues and hardware since it seems to have something to do with cpu frequency scaling, which is part of the kernel. Should this belong to another subforum please let me know.

Last edited by setzer22 (2017-09-18 20:00:30)

Offline

#2 2017-09-18 20:48:28

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: System throttles cpu to minimum frequency when playing some games

What do you use for power management?
What if you disable that?

Offline

#3 2017-09-19 08:01:02

setzer22
Member
Registered: 2014-07-26
Posts: 47

Re: System throttles cpu to minimum frequency when playing some games

I wasn't aware of this, but I saw that the xfce power manager is running for some reason. Could that be the culprit?

I will try disabling this and test it again, but it may take a while for me to try. Did you mean something different by power management? I have not enabled anything knowingly (and don't know where exactly the xfce power manager came from since I'm using i3)

On a side note, I have also found out that unplugging and plugging the charger back in also removes the throttling.

Offline

#4 2017-09-19 08:05:05

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: System throttles cpu to minimum frequency when playing some games

This and similar daemons. (TLP or so)

You deliberately installed it (it's not a dep for anything) and your i3 startup scripts likely execute /etc/xdg/autostart/xfce4-power-manager.desktop

Offline

#5 2017-09-20 21:20:59

setzer22
Member
Registered: 2014-07-26
Posts: 47

Re: System throttles cpu to minimum frequency when playing some games

As I suspected xfce4-power-manager has nothing to do with it, it seems to be a utility to configure screen brightness and a screensaver. Turns out lxsession was launching it, after removing it from my init script, nothing changed. I don't see anything else power-related (such as TLP) either nor I ever installed anything of the sort.

Also, it seems that the issue is also related to plugging/unplugging the charger, not just the battery level. I haven't found a consistent pattern, but it seems the computer is likely to get in the state of degraded performance after unplugging the charger. As I mentioned, the issue only affects certain linux native games and other software runs unaffected.

What part of the system could be affecting performance based on the battery?

Last edited by setzer22 (2017-09-20 21:31:22)

Offline

#6 2017-09-20 22:23:07

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: System throttles cpu to minimum frequency when playing some games

It might be the BIOS that performs this throttling.

Offline

#7 2017-09-21 06:53:59

setzer22
Member
Registered: 2014-07-26
Posts: 47

Re: System throttles cpu to minimum frequency when playing some games

I have other ACPI-related issues in my system, so a bugged dsdt seems like a reasonable possibility. I discarded the BIOS as the culprit initially due to the laptop not having issues on windows, but it looks like it is usually the case.

I'll have a look at the article you link to and report back with results, thanks!

Last edited by setzer22 (2017-09-21 06:54:27)

Offline

Board footer

Powered by FluxBB