erpalma / throttled

Workaround for Intel throttling issues in Linux.
MIT License
2.67k stars 167 forks source link

throttled assumes battery on Desktops (ThinkCentre M920s) #230

Open joakim-tjernlund opened 3 years ago

joakim-tjernlund commented 3 years ago
[I] Detected CPU architecture: Intel Kaby Lake (R)
[I] Loading config file.
[W] No valid Sysfs_Power_Path found! Trying upower method #1
[W] Trying upower method #2
[W] No valid power detection methods found. Assuming that the system is running on battery power.
[I] Starting main loop.

This can not be optimal I guess ?

joakim-tjernlund commented 3 years ago

For now I just hacked:

-- a/lenovo_fix.py  2020-12-15 09:43:38.629180943 +0100
+++ b/lenovo_fix.py 2020-12-15 15:15:03.759219800 +0100
@@ -208,8 +208,9 @@
     except:
         pass

-    warning('No valid power detection methods found. Assuming that the system is running on battery power.')
-    return True
+    warning('No valid power detection methods found. Assuming that the system is running on AC power.')
+#    return True
+    return False

 def get_cpu_platform_info():
@@ -606,7 +607,10 @@
         # set cTDP
         if 'MSR_CONFIG_TDP_CONTROL' in regs[power['source']]:
             write_value = regs[power['source']]['MSR_CONFIG_TDP_CONTROL']
-            writemsr(0x64B, write_value)
+            try:
+                writemsr(0x64B, write_value)
+            except  IOError:
+                pass
             if args.debug:
                 read_value = readmsr(0x64B, 0, 1, flatten=True)
                 match = OK if write_value == read_value else ERR

I cannot write the cTDP value either