我在桌面 Ubuntu 22.04.3、23.10、常规版本和lowlatency
版本上尝试过。我必须提高核心的最低频率,该核心运行需要高 CPU 时钟的图像捕获过程。这是一个例子:
paul@box4x4:~$ sudo cpupower -c 5 frequency-set -d 3000MHz
Setting cpu: 5
它设置了核心 #5 的最低频率,但实际频率不会改变:
paul@box4x4:~/profiler$ cpupower -c 5 frequency-info
analyzing CPU 5:
driver: amd-pstate-epp
CPUs which run at the same hardware frequency: 5
CPUs which need to have their frequency coordinated by software: 5
maximum transition latency: Cannot determine or is not supported.
hardware limits: 400 MHz - 5.58 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 3.00 GHz and 5.58 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 400 MHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: no
并且停留在400MHz。我做错了吗?还有另一种(希望不是太麻烦的)方法和工具来完成它吗?
我在这里看到的一个危险信号是虚假的最大频率 5.58GHz。这不可能。4.9GHz 是我使用的 AMD Ryzen 5 7640U CPU 的最大睿频频率。
我在 Intel N100 PC 上进行了健全性测试,它似乎可以在那里工作:
paul@cube:~$ sudo cpupower -c 3 frequency-info
analyzing CPU 3:
driver: intel_pstate
CPUs which run at the same hardware frequency: 3
CPUs which need to have their frequency coordinated by software: 3
maximum transition latency: Cannot determine or is not supported.
hardware limits: 700 MHz - 3.40 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 3.40 GHz and 3.40 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 3.30 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
核心 #3 频率达到要求的 3.4GHz,但有时在使用 进行监控时读数会较低watch grep \"cpu MHz\" /proc/cpuinfo
。尽管如此,还是比 AMD CPU 上的结果好得多。
这里的问题是
driver: amd-pstate-epp
. 它试图变得太聪明,所以让我们禁用它:sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT=
amd_pstate=disable
双引号内。如果还有其他项目,请将其添加到末尾,并用空格将其与前面的项目分隔开。sudo update-grub
reboot
sudo cpupower -c 5 frequency-set -d 3000MHz
中的 EPP
amd-pstate-epp
代表energy_performance_preference
. 它还可能与“以相同硬件频率运行的 CPU [...并且...] 需要通过软件协调其频率”进行某种交互。根据文档,其他模式类似。该
amd-pstate
属性控制它将使用哪种策略(如果有的话)。司机
acpi-cpufreq
是个老司机。它通常只会执行您告诉它执行的操作。在这种情况下,您确实想要“增加核心的最低频率”,基于您的专业知识,它将用于“图像捕获过程”,因此您需要这个驱动程序。