【Ubuntu】在Ubuntu中实现酣畅淋漓的性能释放:调整CPU频率

您所在的位置:网站首页 设置cpu降频 【Ubuntu】在Ubuntu中实现酣畅淋漓的性能释放:调整CPU频率

【Ubuntu】在Ubuntu中实现酣畅淋漓的性能释放:调整CPU频率

2024-07-10 06:20:10| 来源: 网络整理| 查看: 265

一、问题描述

在机器人开发中,经常需要运行诸如 SLAM 和 Planning 等 CPU 密集型程序,这些程序需要充分发挥计算机的性能,以确保算法的高效运行。然而,默认情况下,Ubuntu 通常将 CPU 设置为节能模式,导致 CPU 在低频率下运行,从而可能影响算法的执行效率。因此,为了最大化 CPU 性能,需要将所有核心的工作模式设置为高性能。

查看各 CPU 核心的工作模式可以通过下面这条命令:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

终端打印以下内容:

powersave powersave powersave powersave powersave powersave powersave powersave powersave powersave powersave powersave powersave powersave powersave powersave

这说明CPU处于节点模式,正在养生

二、软件安装与设置

执行以下命令安装 indicator-cpufreq:

sudo apt-get install indicator-cpufreq

安装完成后,重新启动计算机。重新启动后,在界面右上角会出现如下图标。 在这里插入图片描述

点击该图标,并选择“性能”模式。

performance:高性能模式,将 CPU 频率设为最高值,以最大化 CPU 性能。powersave:节能模式,降低 CPU频率,以最大化节能。 三、查看各 CPU 状态

执行以下命令,查看各 CPU 核心的工作模式:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

终端将会打印以下内容:

performance performance performance performance performance performance performance performance performance performance performance performance performance performance performance performance

这说明所有 CPU 都处于 “performance” (性能) 模式。

四、开机默认高性能设置

上述步骤可以方便快捷地设置当前 CPU 状态,但重启计算机后,系统会恢复默认设置。为了确保系统在每次启动时都以高性能模式运行,可以按照以下步骤进行设置:

4.1 安装 cpufrequtils

执行以下命令安装 cpufrequtils 软件:

sudo apt-get install cpufrequtils

该软件包含一些常用命令,如:

cpufreq-info:查看 CPU 状态;sudo cpufreq-set -c 0 -g performance:设置指定 CPU 的状态。其中,-c 0 指定要设置的 CPU 核心编号performance 表示将 CPU 状态设置为高性能模式;sudo cpufreq-set -c 1 -d 900MHz:设置指定 CPU 的最低频率为 900MHz;sudo cpufreq-set -c 2 -u 2.6GHz:设置指定 CPU 的最高频率为 2.6GHz。 4.2 编写脚本

创建 set_cpu_performance.sh 文件,并赋予可执行权限:

#!/bin/bash # Check if the cpufrequtils package is installed if ! [ -x "$(command -v cpufreq-set)" ]; then echo "Error: cpufrequtils package is not installed. Please install the package first." exit 1 fi cpu_mode=performance # CPU operating mode, defaulting to performance mode # Get the number of CPU cores cpu_cores=$(nproc) # Set each CPU core to performance mode for ((cpu=0; cpu


【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭