我有一个服务器 HPE ProLiant 系统,配备 AMD Epyc CPU、BIOS A43 v1.20、Linux 内核 4.19.71(我也尝试过 5.4.0)。现在,我正在尝试设置 CPU 性能调节器:
# cpupower frequency-set -g performance
Setting cpu: 0
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
for example because of hardware which cannot be set to a specific frequency
or because the userspace governor isn't loaded?
#
所以我开始排除故障:
# cpupower frequency-info
analyzing CPU 0:
no or unknown cpufreq driver is active on this CPU
CPUs which run at the same hardware frequency: Not Available
CPUs which need to have their frequency coordinated by software: Not Available
maximum transition latency: Cannot determine or is not supported.
Not Available
available cpufreq governors: Not Available
Unable to determine current policy
current CPU frequency: Unable to call hardware
current CPU frequency: Unable to call to kernel
boost state support:
Supported: yes
Active: yes
Boost States: 0
Total States: 3
Pstate-P0: 2000MHz
Pstate-P1: 1800MHz
Pstate-P2: 1500MHz
#
# ls /sys/devices/system/cpu/cpufreq/
<Empty>
#
#
因此,无论出于何种原因,它都认为cpufreq
司机失踪了。但是,内核.config
启用了以下功能:
CONFIG_CPU_FREQ=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_CPB=y
CONFIG_X86_INTEL_PSTATE=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
我确实尝试禁用CONFIG_X86_INTEL_PSTATE
并添加CONFIG_X86_POWERNOW_K8
(当前内核中唯一特定于 AMD 的),但它似乎没有帮助。
我很乐意提供任何建议。
答案1
如果您使用第二代 EPYC CPU (Rome),很可能并非所有功能都在您的内核上实现。我不知道你正在使用哪个发行版(它可以向后移植),但根据 Ubuntu 上的这篇博文https://ubuntu.com/blog/amd-epyc-rome-support-in-ubuntu-server您的内核可能不完全支持您的 CPU。
来自 Ubuntu 网站:
从 5.4 系列开始,对 AMD EPYC Rome 的支持已合并到 Linux 内核中。因此,所有安装了 5.4 内核的 Ubuntu 版本都支持该 CPU 及其所有新功能。不过,Canonical 还将对 AMD EPYC Rome 的基本支持向后移植到较早的 LTS 版本,以确保它们能够在这款新 CPU 上正常工作。