debian中笔记本的省电选择auto-cpufreq

news2025/5/13 4:12:42

在reddit中,看评论区出现这个软件,于是打算尝试一下,应该能对不使用电源时笔记本的省电起到一定的作用。

https://github.com/AdnanHodzic/auto-cpufreq?tab=readme-ov-file#why-do-i-need-auto-cpufreq

作用

One of the problems with Linux today on laptops is that the CPU will run in an unoptimized manner which will negatively impact battery life. For example, the CPU may run using the “performance” governor with turbo boost enabled regardless of whether it’s plugged into a power outlet or not.
These issues can be mitigated by using tools like indicator-cpufreq or cpufreq, but those still require manual action from your side which can be daunting and cumbersome.
Tools like TLP (which I used for numerous years) can help extend battery life, but may also create their own set of problems, such as losing turbo boost.
Given all of the above, I needed a simple tool that would automatically make CPU frequency-related changes and save battery life, but let the Linux kernel do most of the heavy lifting. That’s how auto-cpufreq was born.
Please note: auto-cpufreq aims to replace TLP in terms of functionality, so after you install auto-cpufreq it’s recommended to remove TLP. Using both for the same functionality (i.e., to set CPU frequencies) will lead to unwanted results like overheating. Hence, only use both tools in tandem if you know what you’re doing.
One tool/daemon that does not conflict with auto-cpufreq in any way, and is even recommended to have running alongside, is thermald.
Supported architectures and devices
Only devices with an Intel, AMD, or ARM CPU are supported. This tool was developed to improve performance and battery life on laptops, but running it on desktops/servers (to lower power consumption) should also be possible.

AI提炼

该软件 auto-cpufreq 的作用主要有以下几点:

  1. 自动进行与 CPU 频率相关的更改,优化 CPU 运行方式,避免其以未优化的方式运行,从而延长电池寿命。 让 Linux
  2. 内核承担大部分繁重工作,在不依赖过多手动操作(如使用 indicator-cpufreq 或 cpufreq 工具那样)的情况下,实现对
  3. CPU 频率的优化调整。 在功能上可替代 TLP,避免因同时使用 TLP 和 auto-cpufreq 设置 CPU频率而导致如过热等不良结果。
  4. 除了适用于笔记本电脑提升性能和延长电池寿命外,也可运行在台式机或服务器上,达到降低功耗的目的。

大概就是通过调节CPU的频率达到省电的作用,不过电脑的功耗大头不仅仅只有CPU,提升有但有限吧

过程解读

systemctl status power-profiles-daemon

与gnome下的power-profiles-daemon.service产生了冲突,也不奇怪,因为这个就是用来调节cpu的运行状态的。
长这样:
在这里插入图片描述
下面是警告(也就是说不是报错),意思是说两者不能共存,在安装auto-cpufreq为daemon service时会将power-profiles-daemon禁用,卸载时重新启用power-profiles-daemon服务。

ying@192 ~/p/auto-cpufreq (master)> sudo auto-cpufreq --monitor



----------------------------------- Warning -----------------------------------

Detected running GNOME Power Profiles daemon service!

This daemon might interfere with auto-cpufreq and will be automatically
disabled when auto-cpufreq daemon is installed and
it will be re-enabled after auto-cpufreq is removed.

Only necessary to be manually done on Snap package installs!
Steps to perform this action using auto-cpufreq: power_helper script:
git clone https://github.com/AdnanHodzic/auto-cpufreq.git
python3 -m auto_cpufreq.power_helper --gnome_power_disable

Reference: https://github.com/AdnanHodzic/auto-cpufreq#configuring-auto-cpufreq
press Enter to continue or Ctrl + c to exit...^C⏎  

回车查看详情信息
在这里插入图片描述

这个命令应该是临时启用 auto-cpufreq,如何看情况在安装为daemon service,重启配置就失效。
sudo auto-cpufreq --live

在这里插入图片描述
ok,给哥们主频最大频率砍了一般,稍微动动cpu占用就上去了。和轻薄本没两样了吧!

我尝试一下,可不可以退出这个监视界面,一直开着也较为碍事。
sudo auto-cpufreq --monitor
监控发现,配置基本没变。
在这里插入图片描述
谨慎起见,再查看
systemctl status power-profiles-daemon
在这里插入图片描述
可以看到这个服务还是在跑,不过尝试更改,会发现主频最高仍然是2300,所以也算是禁用了。

不过目测续航也并没有多少提高。

安装

git clone https://github.com/AdnanHodzic/auto-cpufreq.git
cd auto-cpufreq && sudo ./auto-cpufreq-installer
sudo auto-cpufreq --install

其他

它是有一个GUI程序可以图形化的管理操作,但是好像我安装过程中出了些问题,这个程序无法打开,但是命令行仍然可用。

安装之后

auto-cpufreq --stats

//To disable and remove auto-cpufreq daemon, run:

sudo auto-cpufreq --remove

内存占用不大,大概25M

systemctl status auto-cpufreq

其他

在插入电源后打开virtualbox测试,发现最大频率会波动,虚拟机也卡卡的感觉,也不知道是不是错觉。

You can configure separate profiles for the battery and power supply. These profiles will let you pick which governor to use, as well as how and when turbo boost is enabled. The possible values for turbo boost behavior are always, auto, and never. The default behavior is auto, which only activates turbo during high load.
这里有个问题,只有在高负载下会启用,那也就是说如果环境在高低负载交替的场景,可能会有明显卡顿。

作者也给出了配置的方法,可以通过配置文件来控制使用电源和电源适配器时不同的睿频调节方案。
配置文件并没有默认创建,可能需要手动创建。
在这里插入图片描述

在sudo auto-cpufreq --monitor的显示中可以看到电源适配器的插入状态,还有电池充电开始和停止的阈值,但是作者明确指出只适配联想设备,因为我是华硕所有我也就不尝试配置了,github中还有一些电源管理方案可以供选择,还有gnome插件的方案,不过需要指出,gnome插件需要在开机后登录进入桌面才会启用,也就是说这段时间内,电池会持续充电。
在这里插入图片描述

在安装为daemon后会关闭gnome的性能调节service

ying@192 ~> systemctl status power-profiles-daemon
○ power-profiles-daemon.service
     Loaded: masked (Reason: Unit power-profiles-daemon.service is masked.)
     Active: inactive (dead)

附一个我的配置文件

sudo vim /etc/auto-cpufreq.conf

在插入电源时一直启用turbo,在使用电池时auto,电池充电阈值那里还没开始搞,现在使用的gnome插件,虽然有点缺陷但可以使用,不过作者的reference我没有删除,感兴趣的可以去摸索一下,另外这个配置文件修改完保存就会生效。

# settings for when connected to a power source
[charger]
governor = performance
energy_performance_preference = performance
turbo = always

# settings for when using battery power
[battery]
governor = powersave
energy_performance_preference = power

# turbo boost setting (always, auto, or never)
turbo = auto

# battery charging threshold
# reference: https://github.com/AdnanHodzic/auto-cpufreq/#battery-charging-thresholds
#enable_thresholds = true
#start_threshold = 20
#stop_threshold = 80

本篇内容有点乱

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2374382.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

力扣热题100之环形链表 II

题目 给定一个链表的头节点 head ,返回链表开始入环的第一个节点。 如果链表无环,则返回 null。 如果链表中有某个节点,可以通过连续跟踪 next 指针再次到达,则链表中存在环。 为了表示给定链表中的环,评测系统内部使…

【记录】HunyuanVideo 文生视频工作流

HunyuanVideo 文生视频工作流指南 概述 本指南详细介绍如何在ComfyUI中使用腾讯混元HunyuanVideo模型进行文本到视频生成的全流程操作,包含环境配置、模型安装和工作流使用说明。 参考:https://comfyui-wiki.com/zh/install/install-comfyui/install-c…

SpringCloud之Ribbon基础认识-服务负载均衡

0、Ribbon基本认识 Spring Cloud Ribbon 是基于 Netflix Ribbon 实现的一套客户端 负载均衡的工具。 Ribbon 主要功能是提供客户端负载均衡算法和服务调用 Ribbon 客户端组件提供一系列完善的配置项如连接超时,重试等。 Ribbon 会基于某种规则(如简单…

重生之我在2024学Fine-tuning

一、Fine-tuning(微调)概述 Fine-tuning(微调)是机器学习和深度学习中的一个重要概念,特别是在预训练模型的应用上。它指的是在模型已经通过大量数据训练得到一个通用的预训练模型后,再针对特定的任务或数据…

Selenium Web自动化测试学习笔记(一)

自动化测试 技术手段模拟人工,执行重复性任务,准确率100%,高于人工 selenium 可通过浏览器驱动控制浏览器,通过元素定位模拟人工,实现web自动化,没有焦点(把浏览器放在最小化依然可以&#x…

2025年5月15日前 免费考试了! Oracle AI 矢量搜索专业​​认证

2025年5月5日前 免费考试了! Oracle AI 矢量搜索专业​​认证 立刻预约吧 文章目录 2025年5月5日前 免费考试了! Oracle AI 矢量搜索专业​​认证立刻预约吧🔍 探索 AI 向量搜索的强大功能!🎯 学习路径目标&#x1f6e…

EasyRTC嵌入式音视频通话SDK驱动智能硬件音视频应用新发展

一、引言 在数字化浪潮下,智能硬件蓬勃发展,从智能家居到工业物联网,深刻改变人们的生活与工作。音视频通讯作为智能硬件交互与协同的核心,重要性不言而喻。但嵌入式设备硬件资源受限,传统音视频方案集成困难。EasyRT…

Ubuntu 22.04.5 LTS 基于 kubesphere 安装 cube studio

Ubuntu 22.04.5 LTS 基于 kubesphere 安装 cube studio 前置条件 已经成功安装 kubesphere v4.3.1 参考教程: https://github.com/data-infra/cube-studio/wiki/%E5%9C%A8-kubesphere-%E4%B8%8A%E6%90%AD%E5%BB%BA-cube-studio 1. 安装基础依赖 # ubuntu安装基础依赖 apt insta…

1.短信登录

1.0 问题记录 1.0.1 redis 重复 token 问题 每次用户登录时,后端会创建一个新的 token 并存入 Redis,但之前登录的 token 还没有过期。这可能会导致以下问题: 1. Redis 中存在大量未过期但实际已不使用的 token2. 同一用户可能有多个有效 …

Linux-Ubuntu安装Stable Diffusion Forge

SD Forge在Win上配置起来相对简单且教程丰富,而在Linux平台的配置则稍有门槛且教程较少。本文提供一个基于Ubuntu24.04发行版(对其他Linux以及SD分支亦有参考价值)的Stable Diffusion ForgeUI安装配置教程,希望有所帮助 本教程以N…

MixTeX - 支持CPU推理的多模态LaTeX OCR

文章目录 一、项目概览相关资源核心特性技术特点 二、安装三、使用说明环境要求 四、版本更新五、当前限制 一、项目概览 MixTeX是一款创新的多模态LaTeX识别小程序,支持本地离线环境下的高效CPU推理。 无论是LaTeX公式、表格还是混合文本,MixTeX都能轻…

23、DeepSeek-V2论文笔记

DeepSeek-V2 1、背景2、KV缓存优化2.0 KV缓存(Cache)的核心原理2.1 KV缓存优化2.2 性能对比2.3 架构2.4多头注意力 (MHA)2.5 多头潜在注意力 (MLA)2.5.1 低秩键值联合压缩 (Low-Rank Key-Value …

【算法专题十一】字符串

文章目录 1. leetcode.14.最长公共前缀1.1 题目1.2 思路1.3 代码 2. leetcode.5.最长回文字串2.1 题目2.2 思路2.3 代码 3. leetcode.67.二进制求和3.1 题目3.2 思路3.3 代码 4. leetcode.43.字符串相乘4.1 题目4.2 思路4.3 代码 1. leetcode.14.最长公共前缀 1.1 题目 题目链…

美化IDEA注释:Idea 中快捷键 Ctrl + / 自动注释的缩进(避免添加注释自动到行首)以及 Ctrl + Alt + l 全局格式化代码的注释缩进

打开 Settings 界面,依次选择 Editor -> Code Style -> Java,选择 Code Generation, 取消 Line comment at first column 和 Block comment at first column 的勾选即可, 1、Line comment at first column (行注释在第一列…

赛灵思 XCZU11EG-2FFVC1760I XilinxFPGAZynq UltraScale+ MPSoC EG

XCZU11EG-2FFVC1760I 是 Zynq UltraScale MPSoC EG 系列中性能最强的器件之一,集成了四核 ARM Cortex-A53 应用处理器、双核 Cortex-R5 实时处理器与 Mali-400 MP2 GPU,并结合了 653,100 个逻辑单元与丰富的片上存储资源,可满足高性能计算、A…

Android Camera HAL v3 and Video4Linux 2

《小驰行动派的知识星球》 ———————————————— 推荐阅读: 关于博主 《小驰Camera私房菜》小册目录 采用v4l2loopback来实现 虚拟Camera Camera基础及一些基本概念 Android Camera 学习路线 | 个人推荐 Android Camera开发系列(干货满满&a…

基于pyqt的上位机开发

目录 安装依赖 功能包含 运行结果 安装依赖 pip install pyqt5 pyqtgraph pyserial 功能包含 自动检测串口设备,波特率选择/连接断开控制,数据发送/接收基础框架,实时绘图区域(需配合数据解析) ""&q…

CentOS 7 系统下安装 OpenSSL 1.0.2k 依赖问题的处理

前面有提到过这个openssl的版本冲突问题,也是在这次恢复服务器时遇到的问题,我整理如下,供大家参考。小小一个软件的安装,挺坑的。 一、问题 项目运行环境需要,指定PHP7.0.9这个版本,但是‌系统版本与软件…

vue修改了node_modules中的包,打补丁

1、安装patch npm i patch-package 安装完成后,会在package.json中显示版本号 2、在package.json的scripts中增加配置 "postinstall": "patch-package" 3、执行命令 npx patch-package 修改的node_modules中的包的名称 像这样 npx patch-packag…

[matlab]private和+等特殊目录在新版本matlab中不允许添加搜索路径解决方法

当我们目录包含有private,或者时候matlab搜索目录不让添加,比如截图: 在matlab2018以前这些都可以加进去后面版本都不行了。但是有时候我们必须要加进去才能兼容旧版本matlab库,比如mexopencv库就是这种情况。因此我们必须找到一个办法加进去…