Linux get current cpu frequency

(Irrelevant) Background

I called Dell, and they suggested to update the Bios and disable SpeedStep and C-States. I did, afterwards the windows task manager started reporting 2.6GHz and so did the bios, but the Open Hardware Monitor in windows still said 800MHz CPU and 100Mhz bus.

So the numbers in Windows seem inconsistent, but I frankly mostly care about Ubuntu. After the bios changes, Ubuntu still feels slow.

Question

I want to know at which speed my CPU or cores actually run. So made sure the cores had some work to do

for i in `seq 5`; do (echo "i=0"; echo "while True: i=1+1") | python& done 

Now 5 threads are full active in the task manager; a reason for the performance governor to scale up the cores. What I see is this:

lshw

$ sudo lshw -c cpu *-cpu description: CPU product: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz vendor: Intel Corp. physical id: 3c bus info: cpu@0 version: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz serial: To Be Filled By O.E.M. slot: U3E1 size: 799MHz # suggests the current speed is 800MHz capacity: 3500MHz width: 64 bits clock: 100MHz capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp cpufreq configuration: cores=4 threads=8 

/proc/cpuinfo

$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 94 model name : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz stepping : 3 microcode : 0x9e cpu MHz : 799.906 cache size : 6144 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 22 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp bugs : bogomips : 5183.76 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: # Repeated 8 times for all threads, cpu MHz around 800MHz for all 

dmidecode

$ sudo dmidecode -t processor # dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.8 present. Handle 0x003C, DMI type 4, 48 bytes Processor Information Socket Designation: U3E1 Type: Central Processor Family: Core i7 Manufacturer: Intel(R) Corporation ID: E3 06 05 00 FF FB EB BF Signature: Type 0, Family 6, Model 94, Stepping 3 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Multi-threading) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz Voltage: 0.6 V External Clock: 100 MHz Max Speed: 2600 MHz Current Speed: 2600 MHz Status: Populated, Enabled Upgrade: Other L1 Cache Handle: 0x0039 L2 Cache Handle: 0x003A L3 Cache Handle: 0x003B Serial Number: To Be Filled By O.E.M. Asset Tag: To Be Filled By O.E.M. Part Number: To Be Filled By O.E.M. Core Count: 4 Thread Count: 8 Characteristics: 64-bit capable Multi-Core Hardware Thread Execute Protection Enhanced Virtualization Power/Performance Control 

Here /proc/cpuinfo and lshw suggest the actual CPU speed is 800MHz, this is backed up by how slow my machine is. However, `dmidecode says the Current Speed is 2600MHz, and so does my BIOS. Why are this numbers inconsistent? Is there an empirical way, check how long a CPU needs to calculate something, to guess the CPU speed? (800MHz should be quite distinguishable from 2600MHz)

Читайте также:  Пароли в линукс минт

Moreover, Open Hardware Monitor also reports 800Mhz, while Windows Task Manager reports 2.6GHz.

Obviously, any suggestions on how to to solve the CPU throttling would be well appreciated. I already found the ‘open laptop, unmount battery for some minutes’ and ‘completely drain battery, leave uncharged for some minutes’ solutions. Will still need to try those.

Источник

Как посмотреть текущую частоту процессора в Linux

Системный монитор или программа top показывают относительную загруженность центрального процессора. Иногда нужно (или просто хочется) посмотреть частоту CPU в данный момент. В этой заметке я расскажу, как узнать, на какой частоте работает процессор в Linux, а также другие его характеристики, такие как температуру и напряжение.

i7z

Самой наглядной программой для просмотра частоты центрального процессора в реальном времени является i7z.

Установка в Ubuntu, Linux Mint, Kali Linux, Debian и их производные:

Для установки в Arch Linux, BlackArch и их производные:a

Программа постоянно обновляет данные и интерактивно показывает такие характеристики процессора для каждого ядра как:

В самом верху показана базовая частота процессора из cpuinfo, у меня на скриншоте это 2208.00Mhz.

Затем идёт настоящая частота (без учёта Turbo).

Также показан CPU Multiplier и Bus clock frequency (BCLK).

Далее идёт информация о сокетах — обычно в домашних компьютерах только один сокет, он обозначается цифрой 0. Также сказано, сколько ядер и сколько логических ядер.

Строка мультипликатор (Max TURBO Multiplier) содержит информацию о том, как умножается частота шины (Bus clock frequency (BCLK)) при Турбо ускорении (Turbo Boost) в зависимости он нагрузки на ядра. В моём скриншоте 41x/41x/40x/40x/39x/39x показывает умножение при нагрузке на соответствующее число ядер 1/2/3/4/5/6. То есть при нагрузке на 1 или 2 ядра, умножение будет 41x, соответственно максимальная частота 100.32 * 41 = 4113,12, то есть максимальная частота 4.1 Гигагерц. При нагрузке на шесть ядер: 100.32 * 39 = 3912,48, то есть максимальная частота 3.9 Гигагерц.

Читайте также:  Set time zone on linux

Real Current Frequency — это реальная текущая частота.

Далее идёт таблица со следующими полями:

  • Core [core-id] — номер ядра
  • Actual Freq (Mult.) — текущая частота
  • C0% — Загруженность процессора в процентах
  • Halt(C1)% — Работа процессора с остановками (Состояния когда >C0 означает режимы энергосбережения с холостым ходом)
  • C3 % — Ядра, работающие с PLL, отключены, и кэш ядра отключён
  • C6 % — Как C3 + состояние ядра сохраняется в кэше последнего уровня
  • C7 % — как и C6, но глубже
  • Temp — температура в данный момент на каждое ядро
  • Vcore — напряжение в данный момент на каждое ядро

Данные в таблице меняются каждую секунду. [core-id] соответствует числу core-id в /proc/cpuinfo

Сообщение ‘Garbage Values’ выводиться когда считываются «мусорные» (которые невозможно интерпретировать) значения.

Внешний вид i7z основан на ncurses. Обычно программ запускается без опций, но при желании вы можете настроить ведение журнала и отключить интерфейс.

i7z поддерживает следующие опции:

Вместо дозаписи, начать журнал заново (старый стирается):

Источник

How Do I Find CPU Frequency in Linux?

The Central Processing Unit (CPU) is considered an essential component in any system. It is also referred the “Computer’s Brain” because it handles all kinds of data processing operations. CPU is embedded in any system based on various specifications; frequency is one of them. The CPU frequency is also known as Clock speed or Clock rate. The clock speed of your CPU figures out how quickly it can process instructions per second. It is a unit of measurement for the number of your CPU execution, expressed in MHz or GHz.

But have you ever thought of knowing what kind of CPU your computer has and how fast it runs? There exist many reasons why you would want to know what CPU you have in your system. Perhaps you are troubleshooting any hardware issue or loading a kernel module. Whatever the cause is, determining the CPU speed and type from the command line is quite easy in Linux. Several commands can be utilized for obtaining information about your processor, including CPU frequency. In this article, we have compiled some of those commands to get to know your CPU better.

Читайте также:  Понимает ли linux ntfs

Dmseg command

Dmseg is used for showing messages from the ring buffer of the kernel. In the following example, we have combined the Dmseg command with grep for filtering out the CPU speed from other related information.

lscpu command

lscpu command helps you to know about your CPU architecture. Lscpu pre-exists in the util-Linux package. Write out the below-given command in your terminal.

In the output, check out the “CPU MHz.”

i7z command

i7z is an exclusive tool for retrieving the processor states in Intel-based CPUs such as i3, i5, and i7.

Executing this command will provide you the following information:

Retrieving CPU speed from “/proc/cpuinfo” file

The “/proc/cpuinfo” file has all content related to the individual CPU cores. Now we will utilize the ‘grep’ and ‘cat’ command to only extract the information about the CPU speed from this file.

Instead of using “grep,” you can also use the “less” command for the same execution purpose.

hwinfo command

In the terminal, the detailed information about each hardware device can be printed using “hwinfo.” We will specify the “–cpu” parameter in the “hwinfo” command for displaying only the CPU speed.

inxi script

inxi is a powerful Linux script that permits you to print out the system’s hardware details. Execute the inxi command in your terminal with the “-C” option for displaying the processor-related information.

Conclusion:

As a result of efficient technology, we have developed a need for speed everywhere we go. CPU and its frequency or clock speed are the most widely associated characteristics with the high-performance of any computer. This post looks at how to get CPU speed details using various commands in Linux.

About the author

Talha Saif Malik

Talha is a contributor at Linux Hint with a vision to bring value and do useful things for the world. He loves to read, write and speak about Linux, Data, Computers and Technology.

Источник

Оцените статью
Adblock
detector