我找到了两个命令来输出有关我的 CPU 的信息:cat /proc/cpuinfo和lscpu. /proc/cpuinfo显示我的 CPU 速度是 2.1 Ghz,而lspcu说它是 3167 Mhz。哪一个是正确的?
这是我cat /proc/cpuinfo关于处理器速度的确切输出:
model name : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
Run Code Online (Sandbox Code Playgroud)
这是来自lscpu:
CPU MHz: 3225.234
Run Code Online (Sandbox Code Playgroud)
(出于某种原因,lscpu每次输出都不同,在 3100 和 3300 MHz 之间变化)
Tim*_*tin 102
要查看每个核心的当前速度,我这样做:
watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"
Run Code Online (Sandbox Code Playgroud)
笔记:
如果您的watch命令不适用于小于一秒的间隔,请像这样修改间隔:
watch -n1 "grep \"^[c]pu MHz\" /proc/cpuinfo"
Run Code Online (Sandbox Code Playgroud)
这会cpu speed实时显示每个核心的 。
通过运行以下命令一次或多次,从另一个终端可以看到上述watch命令的速度变化,假设SpeedStep已启用(Cool'n'Quietfor AMD)。
echo "scale=10000; 4*a(1)" | bc -l &
Run Code Online (Sandbox Code Playgroud)
(此命令用于bc计算pi到 10000 个位置。)
Mic*_*icz 16
对于基于英特尔 i3、i5 和 i7 的i7zcpu,有一个专用工具可以显示所有 cpu 内核的当前速度。
从手册页(说明):
i7z 运行基于 ncurses 的 i7z 程序,没有任何选项。i7z 将打印出基于 i3、i5 和 i7 的英特尔酷睿处理器(包括 Nehalems、Sandy Bridge 和 Ivy Bridge)的 C 状态和温度。
对于基于 ubuntu 的发行版,您可以通过发出以下命令来安装它:
sudo apt-get install i7z
Run Code Online (Sandbox Code Playgroud)
然后运行它(工具需要使用 sudo 运行):
sudo i7z
Run Code Online (Sandbox Code Playgroud)
Jai*_*ime 12
在英特尔酷睿i7-4600U处理器支持Turbo Boost技术。它的基本频率为 2.10GHz,最大睿频频率为 3.30GHz。这意味着,
获取当前频率
要确定 Turbo Boost 是否已激活以及当前频率,您可以使用cpupower frequency-info. 例如,对于启用 Turbo Boost 的旧英特尔酷睿 i5-660,您将获得以下信息。
$ cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.20 GHz - 3.47 GHz
available frequency steps: 3.47 GHz, 3.33 GHz, 2.53 GHz, 1.87 GHz, 1.20 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 1.20 GHz and 3.47 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.87 GHz.
cpufreq stats: 3.47 GHz:82,67%, 3.33 GHz:0,00%, 2.53 GHz:0,00%, 1.87 GHz:0,06%, 1.20 GHz:17,28% (3)
boost state support:
Supported: yes
Active: yes
25500 MHz max turbo 4 active cores
25500 MHz max turbo 3 active cores
25500 MHz max turbo 2 active cores
25500 MHz max turbo 1 active cores
Run Code Online (Sandbox Code Playgroud)
请注意,该信息说明了硬件限制 ( 1.20 GHz - 3.47 GHz)、可能的频率 ( 3.47 GHz, 3.33 GHz, 2.53 GHz, 1.87 GHz, 1.20 GHz) 和当前频率 ( 1.87 GHz)。您可以在英特尔网站上找到这些频率的技术信息。
禁用 TurboBoost 时的频率
注意区别,当你运行采用Turbo Boost相同的命令禁止:在boost state support一节中,值Supported和Active是no。在这里,CPU 将始终处于标称/最小值 (1.20Ghz)。
$ cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.20 GHz - 3.47 GHz
available frequency steps: 3.47 GHz, 3.33 GHz, 2.53 GHz, 1.87 GHz, 1.20 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 1.20 GHz and 3.47 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.20 GHz.
cpufreq stats: 3.47 GHz:40,86%, 3.33 GHz:0,01%, 2.53 GHz:0,06%, 1.87 GHz:0,22%, 1.20 GHz:58,85% (493)
boost state support:
Supported: no
Active: no
25500 MHz max turbo 4 active cores
25500 MHz max turbo 3 active cores
25500 MHz max turbo 2 active cores
25500 MHz max turbo 1 active cores
Run Code Online (Sandbox Code Playgroud)
您可以使用 BIOS 或某些Linux 选项/命令禁用 Turbo Boost 。该内核支持可启用/使用禁用/sys/devices/system/cpu/cpufreq/boost文件。
CPU 频率保留在内核中,但它们可能有点“关闭”。您可以使用以下命令查看它们:
$ cd /sys/devices/system/cpu
$ paste <(cat cpu*/cpufreq/affected_cpus) <(cat cpu*/cpufreq/scaling_cur_freq) | column -s $'\t' -t
0 833914
1 800021
2 800086
3 800029
4 800036
5 800460
6 800118
7 800141
Run Code Online (Sandbox Code Playgroud)
如果您不需要知道 CPU #'s 更短的方法是简单地使用:
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
1396354
800058
800050
800024
800005
800017
800001
1392006
Run Code Online (Sandbox Code Playgroud)
要获取有关 CPU 的信息,请键入以下命令:
dmidecode -t processor | grep -i mhz
Run Code Online (Sandbox Code Playgroud)