我有一台华硕笔记本电脑,型号为 K45VM。第三代酷睿i7处理器,8GB RAM,intel HD 4000集成显卡和Nvidia GT630M独立显卡。双启动 Linux Mint 18“Sarah”和 Win10。在笔记本电脑上运行 Linux 时,一直困扰我的一件事是温度升高,并且对电池寿命造成很大影响,在 Win10 下,笔记本电脑运行温度更低,电池续航时间延长约一小时(Win10 下为 4.5 小时,Linux 下为 3 小时) ,这让Linux感觉低效、浪费。我尝试了各种降低功耗的解决方案(例如 TLP),情况有所改善,但距离 Win10 下的低功耗和温度还有很长的路要走。有人可以帮我发现是否有任何错误或配置错误可能导致此问题吗?
以下是有关我的系统在空闲/轻负载期间的一些相关信息:
10.8W 对我来说似乎有点高,我怀疑高功耗的原因之一是我的无线卡(wlp3s0 - ath9k 模块)默认情况下禁用电源管理,并且有充分的理由,启用它会导致卡一段时间后失去连接,只有重新启动机器才能再次工作,因此如果卡要正常工作,电源管理需要保持关闭状态......
如果我没记错的话,C7 的功耗状态与该 CPU 的功耗一样低,因此在我看来,这里没有任何问题,CPU 看起来大部分时间都花在低功耗状态上。但我可能会完全错误..
我尝试发布我的 Powertop 可调选项卡的图片,但 Stack Exchange 不允许我,我应该生成 HTML 报告并发布指向该报告的链接,也许稍后。所有可调参数都设置为“良好”,除了我的无线鼠标,如果在其 USB 端口上启用,它会挂起,并且“VM 写回超时”选项默认设置为“坏”,使用 --auto-tune 和 TLP,但不知道它的作用,更改它到“好”似乎没有任何效果。
我的 TLP 配置:
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1
# Operation mode when no power supply can be detected: AC, BAT
# Concerns some desktop and embedded hardware only.
TLP_DEFAULT_MODE=BAT
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
#DISK_IDLE_SECS_ON_AC=0
#DISK_IDLE_SECS_ON_BAT=120
# Dirty page values (timeouts in secs).
#MAX_LOST_WORK_SECS_ON_AC=15
#MAX_LOST_WORK_SECS_ON_BAT=120
# Hint: CPU parameters below are disabled by default, remove the leading #
# to enable them, otherwise kernel default values are used.
# Select a CPU frequency scaling governor:
# ondemand, powersave, performance, conservative
# Intel Core i processor with intel_pstate driver:
# powersave, performance
# Important:
# You *must* disable your distribution's governor settings or conflicts will
# occur. ondemand is sufficient for *almost all* workloads, you should know
# what you're doing!
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave
# Set the min/max frequency available for the scaling governor.
# Possible values strongly depend on your CPU. For available frequencies see
# tlp-stat output, Section "+++ Processor".
#CPU_SCALING_MIN_FREQ_ON_AC=0
#CPU_SCALING_MAX_FREQ_ON_AC=0
#CPU_SCALING_MIN_FREQ_ON_BAT=0
#CPU_SCALING_MAX_FREQ_ON_BAT=0
# Set Intel P-state performance: 0..100 (%)
# Limit the max/min P-state to control the power dissipation of the CPU.
# Values are stated as a percentage of the available performance.
# Requires an Intel Core i processor with intel_pstate driver.
CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=20
# Set the CPU "turbo boost" feature: 0=disable, 1=allow
# Requires an Intel Core i processor.
# Important:
# - This may conflict with your distribution's governor settings
# - A value of 1 does *not* activate boosting, it just allows it
CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=0
# Minimize number of used CPU cores/hyper-threads under light load conditions
SCHED_POWERSAVE_ON_AC=1
SCHED_POWERSAVE_ON_BAT=1
# Kernel NMI Watchdog:
# 0=disable (default, saves power), 1=enable (for kernel debugging only)
NMI_WATCHDOG=0
# Change CPU voltages aka "undervolting" - Kernel with PHC patch required
# Frequency voltage pairs are written to:
# /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
# CAUTION: only use this, if you thoroughly understand what you are doing!
#PHC_CONTROLS="F:V F:V F:V F:V"
# Set CPU performance versus energy savings policy:
# performance, normal, powersave
# Requires kernel module msr and x86_energy_perf_policy from linux-tools
ENERGY_PERF_POLICY_ON_AC=performance
ENERGY_PERF_POLICY_ON_BAT=powersave
# Hard disk devices; separate multiple devices with spaces (default: sda).
# Devices can be specified by disk ID also (lookup with: tlp diskid).
DISK_DEVICES="sda sdb"
# Hard disk advanced power management level: 1..254, 255 (max saving, min, off)
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
# Separate values for multiple devices with spaces.
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="254 254"
# Hard disk spin down timeout:
# 0: spin down disabled
# 1..240: timeouts from 5s to 20min (in units of 5s)
# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
# See 'man hdparm' for details.
DISK_SPINDOWN_TIMEOUT_ON_AC="242 242"
DISK_SPINDOWN_TIMEOUT_ON_BAT="242 242"
# Select IO scheduler for the disk devices: noop, deadline, cfq (Default: cfq);
# Separate values for multiple devices with spaces.
DISK_IOSCHED="cfq cfq"
# SATA aggressive link power management (ALPM):
# min_power, medium_power, max_performance
SATA_LINKPWR_ON_AC=max_performance
SATA_LINKPWR_ON_BAT=min_power
# PCI Express Active State Power Management (PCIe ASPM):
# default, performance, powersave
PCIE_ASPM_ON_AC=performance
PCIE_ASPM_ON_BAT=powersave
# Radeon graphics clock speed (profile method): low, mid, high, auto, default;
# auto = mid on BAT, high on AC; default = use hardware defaults.
# (Kernel >= 2.6.35 only, open-source radeon driver explicitly)
#RADEON_POWER_PROFILE_ON_AC=high
#RADEON_POWER_PROFILE_ON_BAT=low
# Radeon dynamic power management method (DPM): battery, performance
# (Kernel >= 3.11 only, requires boot option radeon.dpm=1)
#RADEON_DPM_STATE_ON_AC=performance
#RADEON_DPM_STATE_ON_BAT=battery
# Radeon DPM performance level: auto, low, high; auto is recommended.
#RADEON_DPM_PERF_LEVEL_ON_AC=auto
#RADEON_DPM_PERF_LEVEL_ON_BAT=auto
# WiFi power saving mode: 1=disable, 5=enable; not supported by all adapters.
WIFI_PWR_ON_AC=1
WIFI_PWR_ON_BAT=5
# Disable wake on LAN: Y/N
WOL_DISABLE=Y
# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
# A value of 0 disables, >=1 enables power save.
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=1
# Disable controller too (HDA only): Y/N
SOUND_POWER_SAVE_CONTROLLER=Y
# Set to 1 to power off optical drive in UltraBay/MediaBay when running on
# battery. A value of 0 disables this feature (Default).
# Drive can be powered on again by releasing (and reinserting) the eject lever
# or by pressing the disc eject button on newer models.
# Note: an UltraBay/MediaBay hard disk is never powered off.
BAY_POWEROFF_ON_BAT=1
# Optical drive device to power off (default sr0).
BAY_DEVICE="sr0"
# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto
# Runtime PM for *all* PCI(e) bus devices, except blacklisted ones:
# 0=disable, 1=enable
RUNTIME_PM_ALL=1
# Exclude PCI(e) device adresses the following list from Runtime PM
# (separate with spaces). Use lspci to get the adresses (1st column).
#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM
# (should prevent accidential power on of hybrid graphics' discrete part).
# Default is "radeon nouveau"; use "" to disable the feature completely.
# Separate multiple drivers with spaces.
RUNTIME_PM_DRIVER_BLACKLIST="radeon nouveau"
# Set to 0 to disable, 1 to enable USB autosuspend feature.
USB_AUTOSUSPEND=1
# Exclude listed devices from USB autosuspend (separate with spaces).
# Use lsusb to get the ids.
# Note: input devices (usbhid) are excluded automatically (see below)
#USB_BLACKLIST="1111:2222 3333:4444"
# WWAN devices are excluded from USB autosuspend:
# 0=do not exclude / 1=exclude
USB_BLACKLIST_WWAN=1
# Include listed devices into USB autosuspend even if already excluded
# by the driver or WWAN blacklists above (separate with spaces).
# Use lsusb to get the ids.
#USB_WHITELIST="1111:2222 3333:4444"
# Set to 1 to disable autosuspend before shutdown, 0 to do nothing
# (workaround for USB devices that cause shutdown problems).
#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
# on system startup: 0=disable, 1=enable.
# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
# are ignored when this is enabled!
RESTORE_DEVICE_STATE_ON_STARTUP=0
# Radio devices to disable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
# Radio devices to enable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_ENABLE_ON_STARTUP="wifi"
# Radio devices to disable on shutdown: bluetooth, wifi, wwan
# (workaround for devices that are blocking shutdown).
#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
# Radio devices to enable on shutdown: bluetooth, wifi, wwan
# (to prevent other operating systems from missing radios).
#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
# Radio devices to enable on AC: bluetooth, wifi, wwan
#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
# Radio devices to disable on battery: bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
# Radio devices to disable on battery when not in use (not connected):
# bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
# required). Charging starts when the remaining capacity falls below the
# START_CHARGE_TRESH value and stops when exceeding the STOP_CHARGE_TRESH value.
# Main / Internal battery (values in %)
#START_CHARGE_THRESH_BAT0=75
#STOP_CHARGE_THRESH_BAT0=80
# Ultrabay / Slice / Replaceable battery (values in %)
#START_CHARGE_THRESH_BAT1=75
#STOP_CHARGE_THRESH_BAT1=80
# ------------------------------------------------------------------------------
# tlp-rdw - Parameters for the radio device wizard
# Possible devices: bluetooth, wifi, wwan
# Hints:
# - Parameters are disabled by default, remove the leading # to enable them.
# - Separate multiple radio devices with spaces.
# Radio devices to disable on connect.
#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
# Radio devices to enable on disconnect.
#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
# Radio devices to enable/disable when docked.
#DEVICES_TO_ENABLE_ON_DOCK=""
#DEVICES_TO_DISABLE_ON_DOCK=""
# Radio devices to enable/disable when undocked.
#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
#DEVICES_TO_DISABLE_ON_UNDOCK=""
我的一些改变:
# Hard disk advanced power management level: 1..254, 255 (max saving, min, off)
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
# Separate values for multiple devices with spaces.
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="254 254"
# Hard disk spin down timeout:
# 0: spin down disabled
# 1..240: timeouts from 5s to 20min (in units of 5s)
# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
# See 'man hdparm' for details.
DISK_SPINDOWN_TIMEOUT_ON_AC="242 242"
DISK_SPINDOWN_TIMEOUT_ON_BAT="242 242"
将“DISK_APM_LEVEL_ON_BAT”设置为 128 可以节省大约 1W,但会导致我的 HDD 每隔 3 到 5 秒不断卸载磁头(发出咔嗒声),并减慢驱动器速度一两秒,然后立即再次旋转回来,从而使我的硬盘无法正常工作。 HDD 的预期寿命超出预期。smartcl -a /dev/sda
Load_Cycle_Count 疯狂上升...我已经尝试过了,任何低于 254 的值都会产生同样的效果...
# Set Intel P-state performance: 0..100 (%)
# Limit the max/min P-state to control the power dissipation of the CPU.
# Values are stated as a percentage of the available performance.
# Requires an Intel Core i processor with intel_pstate driver.
CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=20
“CPU_MAX_PERF_ON_BAT=20”有一点帮助,风扇似乎需要更长的时间才能在轻负载下旋转,或者根本不旋转,但一旦我做了一些更“重”的事情,比如在 Chromium 上打开一个新选项卡或者打开一个装满文件的文件夹,风扇就会立即启动。在 Win10 下,它在执行这些任务时几乎保持沉默。对于Win10来说,这款笔记本上的风扇似乎能够旋转得更慢,并在较低的温度下启动,Linux似乎会等到机器变得更热之前,然后以稍高的速度启动风扇,将热量全部散发出去。立刻。这意味着在 Linux 下风扇会更快关闭,但这也意味着它会发出更多噪音,让机器升温更多。也许这与驱动程序有关?这仅适用于空闲和轻负载,在重负载下,风扇旋转并在两个操作系统下执行相同的操作,功耗也大致相同。
# Select a CPU frequency scaling governor:
# ondemand, powersave, performance, conservative
# Intel Core i processor with intel_pstate driver:
# powersave, performance
# Important:
# You *must* disable your distribution's governor settings or conflicts will
# occur. ondemand is sufficient for *almost all* workloads, you should know
# what you're doing!
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave
# Set the min/max frequency available for the scaling governor.
# Possible values strongly depend on your CPU. For available frequencies see
# tlp-stat output, Section "+++ Processor".
#CPU_SCALING_MIN_FREQ_ON_AC=0
#CPU_SCALING_MAX_FREQ_ON_AC=0
#CPU_SCALING_MIN_FREQ_ON_BAT=0
#CPU_SCALING_MAX_FREQ_ON_BAT=0
我的 CPU 使用 intel_pstate 技术,因此我只能使用性能和省电功能,所有“CPU_SCALING”都被注释掉,因为据我了解,它们是为无法自行自动管理频率的旧处理器而设计的,就像我的一样做。
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
#DISK_IDLE_SECS_ON_AC=0
#DISK_IDLE_SECS_ON_BAT=120
# Dirty page values (timeouts in secs).
#MAX_LOST_WORK_SECS_ON_AC=15
#MAX_LOST_WORK_SECS_ON_BAT=120
我对此进行了一段时间的尝试,试图解决“HDD 磁头不断卸载”的问题,并尝试将“DISK_APM”设置保持在 128,但可惜的是,我失败了。由于磁盘现在永久处于最低电源管理设置,总是旋转并且很少进入空闲状态,我认为这没有多大区别,而且,由于我不记得默认值,我只是评论了它出来...我可能大错特错了...
这些是我的 grub 选项:
GRUB_CMDLINE_LINUX_DEFAULT="pcie_aspm=force quiet splash i915.enable_fbc=1 i915.enable_rc6=7 i915.enable_psr=1"
当无线 (ps_enable=1) 和磁盘 (DISK_APM_LEVEL_ON_BAT="128 128") 上的电源管理均打开时,在完全闲置时执行任何任务(例如浏览网页或打开和编辑),功耗将降至约 8.9W一个文本文件)将其回升至 10 左右,在 YouTube 上观看 720p 视频则将其降至 20 左右。屏幕亮度通常保持在最大 40%。不管 powertop 怎么说,在非常轻的负载下,电池续航时间最长约为 3,5 小时。观看 YouTube 时,它的最高续航时间约为 2 / 2,5 小时...
这是正常的吗?这是这台机器的最佳表现还是我错过了什么?任何帮助或见解表示赞赏。
PS:在这台机器上也尝试了 i3 窗口管理器一段时间,没有真正改变功耗。
答案1
我在一台相当耗能的笔记本电脑(Acer VN7-591G-77FS)上使用 TLP,与 Windows 相比,我的电池得到了改进。我将你的 TLP 配置与我的进行了比较,以下是差异
--- stackexchange 2016-12-09 19:56:17.894674340 -0800
+++ mine 2016-07-17 16:51:00.000000000 -0700
@@ -10,16 +10,16 @@
# Operation mode when no power supply can be detected: AC, BAT
# Concerns some desktop and embedded hardware only.
-TLP_DEFAULT_MODE=BAT
+TLP_DEFAULT_MODE=AC
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
-#DISK_IDLE_SECS_ON_AC=0
-#DISK_IDLE_SECS_ON_BAT=120
+DISK_IDLE_SECS_ON_AC=0
+DISK_IDLE_SECS_ON_BAT=2
# Dirty page values (timeouts in secs).
-#MAX_LOST_WORK_SECS_ON_AC=15
-#MAX_LOST_WORK_SECS_ON_BAT=120
+MAX_LOST_WORK_SECS_ON_AC=15
+MAX_LOST_WORK_SECS_ON_BAT=60
# Hint: CPU parameters below are disabled by default, remove the leading #
# to enable them, otherwise kernel default values are used.
@@ -50,7 +50,7 @@
CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=0
-CPU_MAX_PERF_ON_BAT=20
+CPU_MAX_PERF_ON_BAT=100
# Set the CPU "turbo boost" feature: 0=disable, 1=allow
# Requires an Intel Core i processor.
@@ -61,7 +61,7 @@
CPU_BOOST_ON_BAT=0
# Minimize number of used CPU cores/hyper-threads under light load conditions
-SCHED_POWERSAVE_ON_AC=1
+SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
# Kernel NMI Watchdog:
@@ -88,19 +88,19 @@
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
# Separate values for multiple devices with spaces.
DISK_APM_LEVEL_ON_AC="254 254"
-DISK_APM_LEVEL_ON_BAT="254 254"
+DISK_APM_LEVEL_ON_BAT="128 128"
# Hard disk spin down timeout:
# 0: spin down disabled
# 1..240: timeouts from 5s to 20min (in units of 5s)
# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
# See 'man hdparm' for details.
-DISK_SPINDOWN_TIMEOUT_ON_AC="242 242"
-DISK_SPINDOWN_TIMEOUT_ON_BAT="242 242"
+#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
+#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
# Select IO scheduler for the disk devices: noop, deadline, cfq (Default: cfq);
# Separate values for multiple devices with spaces.
-DISK_IOSCHED="cfq cfq"
+#DISK_IOSCHED="cfq cfq"
# SATA aggressive link power management (ALPM):
# min_power, medium_power, max_performance
@@ -241,14 +241,14 @@
# - Separate multiple radio devices with spaces.
# Radio devices to disable on connect.
-#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
-#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
-#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
+DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
+DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
+DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
# Radio devices to enable on disconnect.
-#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
-#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
-#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
+DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
+DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="wwan"
+DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="wifi"
# Radio devices to enable/disable when docked.
#DEVICES_TO_ENABLE_ON_DOCK=""
您能测试一下上述更改是否可以改善您的电池吗?
另外我应该指出,我总是使用集成的英特尔 GPU,而不是 NVIDIA。