21 Mayıs 2020 Perşembe

lscpu komutu

Giriş
lshw, lsusb, lsblklspcii, lsmod gibi komutlarla kardeştir. İşlemcileri listeler. Linux işletim sistemi CPU değişse de etkilenmez. Açıklaması şöyle.
Ubuntu (and generally speaking Linux) don't particularly care what hardware they're running on, and will perform a check on all devices at boot rather than assuming that the same devices are there each time. So long as your CPU is compatible with your chipset, Ubuntu will see it and start using it. Ubuntu 18.04 is also only available in the 64-bit version, so that's not a concern either.

Windows, on the other hand, has licensing to worry about. When you buy a copy of Windows, the idea is that you buy it for a single machine, so Windows tends to more or less "lock" itself to a system's hardware. This doesn't mean that you can't change hardware, but if you do it too frequently (like I've managed to do) it will start to say your key is invalid. If you're in a dual-boot system, this is something to keep in mind.

seçeneksiz çalıştırma
Örnek
Şöyle yaparız. 2 işlemci gösterir. 2 socket x 1 core x 1 threads per core = 2 işlemci
$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Model name:            Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
Stepping:              0
CPU MHz:               2494.224
BogoMIPS:              4988.44
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              30720K
NUMA node0 CPU(s):     0,1
Örnek
Şöyle yaparız. 16 işlemci gösterir. 1 socket x 8 core x 2 threads per core = 16 işlemci
$ lscpu
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   39 bits physical, 48 bits virtual
CPU(s):                          16
On-line CPU(s) list:             0-15
Thread(s) per core:              2
Core(s) per socket:              8
Socket(s):                       1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           165
Model name:                      Intel(R) Core(TM) i7-10700T CPU @ 2.00GHz
Stepping:                        5
CPU MHz:                         1991.998
BogoMIPS:                        3983.99
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       256 KiB
L1i cache:                       256 KiB
L2 cache:                        2 MiB
L3 cache:                        16 MiB
Vulnerability Itlb multihit:     KVM: Mitigation: VMX unsupported
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxs
                                 r sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpui
                                 d pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdran
                                 d hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhance
                                 d fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt xsaveopt xsavec
                                 xgetbv1 xsaves flush_l1d arch_capabilities

CPU op-mode Alanı

Eğer çıktı şöyle ise hem 32 bit hem de 64 bit işletim sistemi çalıştırabilir.
CPU op-mode(s):      32-bit, 64-bit
CPU(s) Alanı
Şöyle yaparız. 4 işlemci gösterir.
lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
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
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Model name:            Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz
Stepping:              9
CPU MHz:               1600.132
BogoMIPS:              6200.36
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0-3
Örnek - CPU Sayısı Hesaplama
Elimizde şöyle bir çıktı olsun. Burada CPU sayısı 80 gösteriyor. 
CPU(s):                          80
On-line CPU(s) list:             0-79
Thread(s) per core:              2
Core(s) per socket:              20
Socket(s):                       2
NUMA node(s):                    2
Model name:                      Intel(R) Xeon(R) Gold 6242R CPU @ 3.10GHz
NUMA node0 CPU(s):               0-19,40-59
NUMA node1 CPU(s):               20-39,60-79
Cpu(s) sayısı şöyle hesaplanır.
... you have 2 physical CPUs, which each have 20 cores, which each can run 2 threads (hyperthreading). So 2x20x2 = 80, which is the number of CPUs displayed.
Örnek  - MHz Ortalaması
Açıklaması şöyle
This command shows the current "average" clock between cores (CPU MHz), and the max normal clock (CPU max MHZ).
Şöyle yaparız
$ lscpu | grep "MHz"
CPU MHz:                         1181.650
CPU max MHz:                     2200.0000
CPU min MHz:                     800.0000
Eğer şu anki durumu görmek istersek şöyle yaparız
$ cat /proc/cpuinfo | grep "MHz"
cpu MHz         : 1260.714
cpu MHz         : 1070.646
cpu MHz         : 1124.995
cpu MHz         : 1234.689
Açıklaması şöyle
This command shows the current clock for each processor core: 
Peki CPU Clock Nedir?
Açıklaması şöyle
Modern clocks are originally generated by quartz crystal oscillators of about 20MHz or so, and then the frequency is multiplied by one or more phase-locked loops to generate the clock signals for different parts of the system. (such as 4GHz for a CPU core).

Flags Alanı
Çıktı şöyle olabilir
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 nx lm constant_tsc arch_perfmon pebs bts cpuid
 aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm pti
 tpr_shadow vnmi flexpriority dtherm

f16c  half precision suppport anlamına gelir.


Hiç yorum yok:

Yorum Gönder