Ubuntu 15.04 带有 intel_pstate-当前 CPU 频率低

Ubuntu 15.04 带有 intel_pstate-当前 CPU 频率低

我在台式机上运行 Ubuntu 15.04,配有 6 核 5930K 处理器、msi x99s 主板、32gb 内存、固态硬盘和 nvidia gtx 980ti。令人惊讶的是,整体系统性能远低于预期,比我的笔记本电脑慢得多。至少乍一看是这样,因为这台电脑是新的,我没有机会在上面运行大量计算。问题似乎根源于新的 intel_pstate 驱动程序使 CPU 频率保持在较低水平。

实际上,cpufreq-info 的输出是

analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 1.20 GHz - 3.70 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.70 GHz and 3.70 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 428 MHz.

如果有任何建议,或者是什么导致 CPU 频率如此之低,我们将不胜感激。

我的问题似乎与 Kubuntu 15.04 运行非常慢,尽管每个任务的 CPU 使用率都很高我的 CPU 运行一段时间后就慢了,并且无法恢复

虽然我还没有尝试关闭 intel_pstate 选项,因为我曾希望它能够被正确配置来解决这个问题。但在经过几个小时的谷歌搜索、盯着配置和与 intel_pstate 的斗争后,希望几乎破灭了。

更新

sudo cpupower -c all frequency-info 
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 1.20 GHz - 3.70 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.70 GHz and 3.70 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 425 MHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes

glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: GeForce GTX 980 Ti/PCIe/SSE2
    GL_ARB_compute_variable_group_size, GL_ARB_conditional_render_inverted, 
    GL_KTX_buffer_region, GL_NVX_conditional_render, GL_NVX_gpu_memory_info, 
    GL_NV_conditional_render, GL_NV_conservative_raster, 
    GL_NV_path_rendering, GL_NV_path_rendering_shared_edge, 
    GL_ARB_compute_variable_group_size, GL_ARB_conditional_render_inverted, 
    GL_KTX_buffer_region, GL_NVX_conditional_render, GL_NVX_gpu_memory_info, 
    GL_NV_conditional_render, GL_NV_conservative_raster, 
    GL_NV_path_rendering, GL_NV_path_rendering_shared_edge, 
    GL_EXT_render_snorm, GL_EXT_robustness, GL_EXT_sRGB, 
    GL_NV_blend_equation_advanced_coherent, GL_NV_conditional_render, 
    GL_NV_packed_float_linear, GL_NV_path_rendering, 
    GL_NV_path_rendering_shared_edge, GL_NV_pixel_buffer_object, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, 

i7z 输出

Cpu speed from cpuinfo 3500.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 3499 MHz
  CPU Multiplier 35x || Bus clock frequency (BCLK) 99.97 MHz

Socket [0] - [physical cores=6, logical cores=12, max online cores ever=6]
  TURBO ENABLED on 6 Cores, Hyper Threading ON
  Max Frequency without considering Turbo 3598.97 MHz (99.97 x [36])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4/5/6 Cores is  37x/37x/36x/36x/36x/36x
  Real Current Frequency 800.24 MHz [99.97 x 8.00] (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %  Temp      VCore
        Core 1 [0]:       800.24 (8.00x)        2.38     8.1       0    91.4    28      0.7832
        Core 2 [1]:       800.14 (8.00x)        3.94    25.4       0    73.7    32      0.7549
        Core 3 [2]:       799.96 (8.00x)        22.9    76.7       0    18.1    27      0.7939
        Core 4 [3]:       799.93 (8.00x)        3.56    8.44       0    90.7    27      0.7604
        Core 5 [4]:       799.82 (8.00x)        1.11    3.16       0    96.6    28      0.7871
        Core 6 [5]:       799.83 (8.00x)        4.98    12.7       0    86.2    30      0.7421

C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver modes with cores idling)
C3 = Cores running with PLL turned off and core cache turned off
C6, C7 = Everything in C3 + core state saved to last level cache, C7 is deeper than C6

/proc/cpu信息

grep -E '^model name|^cpu MHz' /proc/cpuinfo
model name  : Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz
cpu MHz     : 422.324

答案1

这可能是因为 bios 限制了 cpu 频率缩放。为了在 14.04 和 16.04 上解决这个问题,我必须执行以下操作:

打开 grub:

sudo vim /etc/default/grub

替换 GRUB_CMDLINE_LINUX_DEFAULT 行:

- GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
+ GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable processor.ignore_ppc=1"

更新 grub:

sudo update-grub

然后重启:

echo 1 | sudo dd of=/sys/module/processor/parameters/ignore_ppc
echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 
echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 
echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq 
echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq 

对我有用。检查 CPU 核心数并相应更新所有内容。您可能希望将这些额外的行放入 /etc/rc.local 中,以便它们在每次启动时执行。

Ninja 编辑:将上面的 2900000 替换为以下值:

cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq

答案2

在 grub 配置中禁用 intel_pstate 会将当前 CPU 频率精确固定为 3.5GHz,这又有点可疑。而且整体性能仍然很慢。cpufreq-info 报告 acpi-cpufreq 为驱动程序,但是

lsmod |grep acpi 

什么都没显示,并modinfo acpi-cpufreq显示错误。

modprobe acpi-cpufreq 

默默执行,没有任何效果。

最后,我简单地安装了 Ubuntu 14.04,嘿,一切都非常快,即使使用 intel_pstate。

fram@hydra:~$ cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 1.20 GHz - 3.70 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.70 GHz and 3.70 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 3.51 GHz.

仍然不知道原因是什么,希望更新不会再次出现这个问题。

答案3

我在使用 Vivid 的 LTS 支持堆栈的 Ubuntu 14.04.3 中遇到了类似的问题。

经过大约一周的苦思冥想后,我发现这是因为我intel-microcode安装的它似乎与内核 3.19 冲突。

我一将其移除,问题就消失了。

答案4

Phoronix 测试显示,Skylake 仍在开发中,但内核 4.2 及更高版本运行良好,因此我建议您从主线 ppa 安装它。

相关内容