linux cpu info

2017032009:36
Linux 下查詢  CPU 資料

$ lscpu
Architecture:          armv7l
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
Model name:            ARMv7 Processor rev 4 (v7l)
CPU max MHz:           900.0000
CPU min MHz:           600.0000


$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2709
Revision        : a02082
Serial          : 0000000089ec0711
www@raspberrypi /boot$



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

$ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
600000

**單位 Mhz

current CPU frequence:
$ sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
900000

 

Raspberry PI 修改 cpu 頻率 overclock

(PI 3 無法用這個程式改頻率,自行修改 /boot/config.txt )

$ sudo raspi-config


修改 /boot/config.txt 檔主要的參數
arm_freq=1000
core_freq=250
over_voltage=2
disable_splash=1
gpu_mem=16   # GPU的記憶體

 

Raspberry Pi 3 Overclock options

  • arm_freq– Frequency of ARM in MHz. (Raspberry Pi 3 Overclock)
  • core_freq -Frequency of GPU processor core in MHz. It has an impact on ARM performance since it drives L2 cache.
  • sdram_freq -Frequency of SDRAM in MHz.
  • over_voltage – ARM/GPU core voltage adjust. Values above 6 are only allowed when force_turbo or current_limit_override are specified (which set the warranty bit).
  • force_turbo – Disables dynamic cpufreq driver and minimum settings below. Voids Warranty.
  • initial_turbo -Enables turbo mode from boot for the given value in seconds (up to 60) or until cpufreq sets a frequency. Default 0
  • arm_freq_min – Minimum value of arm_freq used for dynamic clocking.
  • core_freq_min – Minimum value of core_freq used for dynamic clocking.
  • sdram_freq_min – Minimum value of sdram_freq used for dynamic clocking.
  • temp_limit – Overheat protection. Sets clocks and voltages to default when the SoC reaches this Celsius value. Setting this higher than default voids warranty. Default 85
  • disable_splash – If set to 1, avoids the rainbow splash screen on boot.
  • boot_delay – Wait for x number of seconds in start.elf before loading kernel. Default 1
  • gpu_mem – GPU memory in megabyte. Sets the memory split between the ARM and GPU. ARM gets the remaining memory.



監控 CPU 頻率/溫度

https://mike632t.wordpress.com/2014/01/30/monitor-cpu-speed-and-temprature-raspberry-pi/
 
#!/bin/bash
#
# Usage:       sh-pi-get_cpu_temp
#
# Monitors CPU clock speed and temperature.
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

cpu_freq=/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
cpu_temp=/sys/class/thermal/thermal_zone0/temp
if [ -e $cpu_freq ] ; then
  if [ -e $cpu_temp ] ; then
    while [ true ] ; do
      clk=$(cat $cpu_freq)
      cpu=$(cat $cpu_temp)
      echo -ne $(($clk/1000))" Mhz / "$(($cpu/1000))" C \r" 
      sleep 1
    done
  fi
fi



https://gist.github.com/ecampidoglio/5009512
另一個 CPU Stat script