AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1089879
Accepted
Tomaz Pablo
Tomaz Pablo
Asked: 2018-11-04 22:11:49 +0800 CST2018-11-04 22:11:49 +0800 CST 2018-11-04 22:11:49 +0800 CST

CPU导致游戏性能低下

  • 772

好的,首先,英语不是我的母语,所以我为任何糟糕的措辞道歉。

其次,我还在学习 Linux,更具体地说是 Ubuntu 18.04。这是我第一次使用这个操作系统,我对终端、命令、包的了解还是很基础的。而我能做的事情我不确定我是否完全理解它们。请耐心等待。

所以,对于问题。我最近决定尝试一些游戏,令我惊讶的是,我之前可以在 W10 上玩的一些游戏由于某些性能问题而无法玩。这些游戏以 35-45 fps 开始,然后突然下降到 1-15 fps(是的,1 fps!)。

起初我认为这可能与 gpu 相关,可能是驱动程序,但不,我从一些 ppa 获得了最新的驱动程序。弄乱了游戏的图形质量,但我开始注意到只有对 CPU 要求更高的才会遇到这个问题。

然后我开始寻找跟踪 CPU 使用情况的方法。系统监视器还不够,所以我找到了一些watch跟踪 cpu 速度和 cpu 温度的命令。我必须安装lm-sensors温度。

最后,我的笔记本电脑的薄度似乎使它过热,然后 cpu 油门,使这些 fps 大幅下降。我是根据温度升高时 CPU 速度突然下降得出的结论。但实际上我不能说我得到的温度是否那么高,我得到的最高温度是 CPU 上的 80°C 左右。而且,风扇似乎工作正常,转速约为 5000 RPM。

为了改善这一点,我尝试将控制参数cpufreq从省电更改为性能。虽然它没有解决性能下降的问题,但我注意到了一些改进。CPU 速度从 600 Mhz 下降到 1600 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: 100MHz

lspci | 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 174mm

tomaz@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
games cpu overheating cpufreq temperature
  • 1 1 个回答
  • 979 Views

1 个回答

  • Voted
  1. Best Answer
    Doug Smythies
    2018-11-05T08:35:54+08:002018-11-05T08:35:54+08:00

    您应该能够使用以下命令将 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
    

    用于监控事物的一个非常好的工具是 turbostat,它包含在 linux-tools-common 包中。

    以下是我的计算机负载很重且处理器封装温度已达到最高点的示例。然后在另一个终端中,我限制了 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。但是,嘿,turbostat 之前显示 3500 MHz。为什么?因为所有内核都很忙,因此处理器本身内部的最大 CPU 频率被限制为 3500 MHZ。此信息也可通过不使用该quiet指令的 turbostat 获得。例子:

    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 温度限制在低于极端值。一个是 thermod,我在另一个答案中有一个示例配置脚本。

    • 0

相关问题

  • 任何人都可以在 Ubuntu 10.04 上正常使用 DOOM 3 音频吗?[关闭]

  • 创建一个启动器(用于 Mechinarium)

  • 如何在 Ubuntu 上安装依赖于 libgtk1.2 的 Wolfenstein Enemy Teritory?

  • 如何安装 Steam?

  • 如何安装 Windows 软件或游戏?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve