好的,首先,英语不是我的母语,所以我对任何用词不当表示歉意。
其次,我还在学习Linux,Ubuntu18.04,更具体一点。这是我第一次使用这个操作系统,我对终端、命令、包的了解还很基本。而我能做的事情我不确定我完全理解它们。请耐心点。
所以,关于这个问题。我最近决定尝试一些游戏,令我惊讶的是,我以前可以在W10上玩的一些游戏是不能玩的,因为一些性能问题。这些游戏开始于35-45 fps,突然下降到1-15 fps (是的,一个fps!)
一开始我认为这可能是与gpu相关的东西,也许是驱动程序,但不,我从一些ppa获得了最新的驱动程序。影响了游戏的图形质量,但我开始注意到,只有要求更高的cpu才会有这种麻烦。
然后,我开始寻找跟踪cpu使用情况的方法。系统监视器是不够的,所以我发现了一些跟踪cpu速度和cpu温度的watch命令。我不得不为温度安装lm-sensors。
最后,似乎我的笔记本电脑的稀薄使它过热,然后cpu节流,使这些异常下降的fps。我得出的结论是,随着温度的升高,cpu的速度突然下降。但实际上我不能说如果我得到的温度那么高,我得到的最大温度在CPU上大约80摄氏度。而且,风扇似乎工作正常,它得到了大约5000 RPM。
为了改进这一点,我尝试将cpufreq的治理参数从powersave更改为性能。虽然它没有解决性能下降的问题,但我注意到了一些改进。CPU速度下降到1600 Mhz,而不是600 MHz。然后,它让我想知道我是否应该设置一个最小的CPU频率或停用剥落。但我担心这会导致过热,然后融化。我也可以尝试一些更酷的支持,但我不确定这些支持的效率。
所以,有谁能对这件事有所了解吗?
sudo lshw -c cpu
descrição: CPU
produto: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
fabricante: Intel Corp.
ID físico: 36
informações do barramento: cpu@0
versão: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
serial: To Be Filled By O.E.M.
slot: U3E1
tamanho: 2228MHz
capacidade: 3100MHz
largura: 64 bits
clock: 100MHzlspci | grep -i VGA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)lspci | grep -i 3D
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)xandr | grep connected
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mmtomaz@tomaz-Inspiron-7460:~$ stress-ng -t 5m -v --tz -c 4
stress-ng: debug: [15960] 4 processors online, 4 processors configured
stress-ng: info: [15960] dispatching hogs: 4 cpu
stress-ng: debug: [15960] cache allocate: default cache size: 3072K
stress-ng: debug: [15960] starting stressors
stress-ng: debug: [15961] stress-ng-cpu: started [15961] (instance 0)
stress-ng: debug: [15962] stress-ng-cpu: started [15962] (instance 1)
stress-ng: debug: [15960] 4 stressors spawned
stress-ng: debug: [15961] stress-ng-cpu using method 'all'
stress-ng: debug: [15964] stress-ng-cpu: started [15964] (instance 3)
stress-ng: debug: [15963] stress-ng-cpu: started [15963] (instance 2)
stress-ng: debug: [15964] stress-ng-cpu using method 'all'
stress-ng: debug: [15963] stress-ng-cpu using method 'all'
stress-ng: debug: [15962] stress-ng-cpu using method 'all'
stress-ng: debug: [15961] stress-ng-cpu: exited [15961] (instance 0)
stress-ng: debug: [15960] process [15961] terminated
stress-ng: debug: [15963] stress-ng-cpu: exited [15963] (instance 2)
stress-ng: debug: [15962] stress-ng-cpu: exited [15962] (instance 1)
stress-ng: debug: [15960] process [15962] terminated
stress-ng: debug: [15960] process [15963] terminated
stress-ng: debug: [15964] stress-ng-cpu: exited [15964] (instance 3)
stress-ng: debug: [15960] process [15964] terminated
stress-ng: info: [15960] successful run completed in 300.05s (5 mins, 0.05 secs)
stress-ng: info: [15960] cpu:
stress-ng: info: [15960] pch_skylake 59.25 °C
stress-ng: info: [15960] B0D4 62.12 °C
stress-ng: info: [15960] INT3400 Thermal 48.08 °C
stress-ng: info: [15960] SEN2 50.81 °C
stress-ng: info: [15960] TMEM 50.15 °C
stress-ng: info: [15960] x86_pkg_temp 54.88 °C
stress-ng: info: [15960] acpitz 50.61 °C
stress-ng: info: [15960] SEN1 50.78 °C发布于 2018-11-04 16:35:54
您应该能够限制上CPU频率,例如65%,使用以下命令:
echo 65 | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct以上假设您使用的是intel_pstate CPU频率缩放驱动程序,默认情况下应该是该驱动程序。检查:
doug@s15:~/temp$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate一个非常好的工具,用来监控事情是涡轮统计,这是包括在linux工具-通用包。
下面是一个例子,我的计算机是沉重的,而处理器包的温度已经达到最高点。在另一个终端中,我限制CPU频率(向下显示),您可以观察频率、温度和瓦特下降:
doug@s15:~/temp$ sudo turbostat --quiet --Summary --show Busy%,Bzy_MHz,PkgTmp,PkgWatt --interval 15
Busy% Bzy_MHz PkgTmp PkgWatt
100.00 3500 79 63.91
100.00 3500 78 63.91
100.00 3500 78 63.91
100.00 3500 78 63.88
100.00 3500 79 63.89
100.00 3500 79 63.90
100.00 2755 70 45.86
100.00 2500 68 39.42
100.00 2500 67 39.26
100.00 2500 66 39.10
100.00 2500 65 39.07
100.00 2500 65 38.94
100.00 2500 64 38.93
100.00 2500 65 38.92在另一个航站楼所做的工作:
doug@s15:~$ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
100
doug@s15:~$ echo 65 | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct
65
doug@s15:~$ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
65注意: 2500 MHz CPU频率是最近的100 MHz舍入值(最近的pstate 25)到3800 * 0.65。不过,涡轮增压器之前显示了3500 MHz。为什么?因为所有内核都很忙,因此最大CPU频率被限制在处理器内部的3500 MHZ以内。通过不使用quiet指令,还可以通过涡轮增压器获得此信息。示例:
doug@s15:~/temp$ sudo turbostat --Summary --show Busy%,Bzy_MHz,PkgTmp,PkgWatt --interval 15
... [snip]...
cpu4: MSR_PLATFORM_INFO: 0x100070012200
16 * 100.0 = 1600.0 MHz max efficiency frequency
34 * 100.0 = 3400.0 MHz base frequency
cpu4: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled)
cpu4: MSR_TURBO_RATIO_LIMIT: 0x23242526
35 * 100.0 = 3500.0 MHz max turbo 4 active cores
36 * 100.0 = 3600.0 MHz max turbo 3 active cores
37 * 100.0 = 3700.0 MHz max turbo 2 active cores
38 * 100.0 = 3800.0 MHz max turbo 1 active cores
...[snip]...有许多方法可以自动将CPU温度限制在小于极值的范围内。一个是使用thermald,我在另一个回答中有一个示例配置脚本。
https://askubuntu.com/questions/1089879
复制相似问题