Linux-查看服务器配置

目录

简介

服务器型号

操作系统

查看当前操作系统发行版信息

查看操作系统发行版详细信息

CPU

查看CPU统计信息 lscpu

查看CPU内核+型号 cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

查看物理CPU个数

查看每个物理CPU中core的个数(即核数)

查看逻辑CPU的个数

内存

查看内存信息 

查看概要内存使用情况free -g

自动选择以适合理解的容量单位显示 free -h

查看内存硬件信息

查看内存详细使用情况 cat /proc/meminfo

查看内存的插槽数,已经使用多少插槽.每条内存多大

硬盘

查看硬盘和分区分布

查看硬盘大小

查看硬盘和分区的详细信息

其他

查看网卡的硬件信息

查看显卡运行状况

参考


简介

性能测试时一定要确定测试环境和的硬件配置、软件版本配置,那么linux下如何查看服务器的硬件配置信息?以下是本人skylake服务器的配置情况,因为有些命令是必须root用户才可以查看,因此如果有root权限,直接sudo xxx也可

实验环境:skylake服务器 + 3块v100+1块Tesla T4 + pyg/dgl/ogb。

  • CPU
    • 型号:Intel® Xeon® Gold 5118 CPU
    • 内存:692G
    • 内核:48核
  • GPU
    • V100 *3
      • 显存:32G
    • Tesla T4 *1
      • 显存:16G

 

服务器型号

# sudo dmidecode|grep "System Information" -A9|egrep  "Manufacturer|Product"
 Manufacturer: TYAN
 Product Name: B7102T76V12HR-2T-N

操作系统

查看当前操作系统发行版信息

# sudo cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)

查看操作系统发行版详细信息

# lsb_release -a
-bash: lsb_release: command not found  #我由于系统没有配置好,因此不行
 

CPU

查看CPU统计信息 lscpu

# lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              48 #CPU内核数
On-line CPU(s) list: 0-47
Thread(s) per core:  2 #实际上每个核每次跑的线程数
Core(s) per socket:  12 # 每个CPU核数
Socket(s):           2 #CPU个数
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz #型号
Stepping:            4
CPU MHz:             2111.267
CPU max MHz:         3200.0000
CPU min MHz:         1000.0000
BogoMIPS:            4600.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            16896K
NUMA node0 CPU(s):   0-11,24-35
NUMA node1 CPU(s):   12-23,36-47
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 cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d

查看CPU内核+型号 cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
48  Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz

查看物理CPU个数

# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2

查看每个物理CPU中core的个数(即核数)

# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores   : 12

查看逻辑CPU的个数

# cat /proc/cpuinfo| grep "processor"| wc -l
48

内存

查看内存信息 

按照单位MB计算的,708930/1024=692.316..感觉不是很一样,可以参考

# free -m
              total        used        free      shared  buff/cache   available
Mem:         708930       14717      684382         403        9830      690423
Swap:          4095           0        4095

查看概要内存使用情况free -g

按照单位GB计算的

# free -g
              total        used        free      shared  buff/cache   available
Mem:            692          14         668           0           9         674
Swap:             3           0           3

自动选择以适合理解的容量单位显示 free -h

和上面的free- g同

# free -h
              total        used        free      shared  buff/cache   available
Mem:          692Gi        14Gi       668Gi       403Mi       9.6Gi       674Gi
Swap:         4.0Gi          0B       4.0Gi

free参数分析参考

  • Mem:表示物理内存统计,如果机器剩余内存非常小,一般小于总内存的20%,则判断为系统物理内存不够 Swap: 表示硬盘上交换分区的使用情况,如剩余空间较小,需要留意当前系统内存使用情况及负载,
  • 当Swap的used值大于0时,则表示操作系统物理内存不够,已经开始使用硬盘内存了。

第1行数据

  • 692G表示物理内存总量;
  • 14G表示总计分配给缓存(包含buffers与cache)使用的数量,但其中可能部分缓存并未实际使用;
  • 668G表示未被分配的内存;
  • shared表示共享内存;
  • 9.6G表示系统分配但未被使用的buffers数量;
  • 674G表示系统分配但未被使用的available数量 

查看内存硬件信息

# sudo dmidecode -t memory

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x0034, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: Single-bit ECC
        Maximum Capacity: 2304 GB
        Error Information Handle: Not Provided
        Number Of Devices: 6

Handle 0x0036, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0034
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC0_DIM_CH_A0
        Bank Locator: NODE 1
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2DC97
        Asset Tag: P0_MC0_DIM_CH_A0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0038, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0034
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC0_DIM_CH_A1
        Bank Locator: NODE 1
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2E787
        Asset Tag: P0_MC0_DIM_CH_A1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x003A, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0034
        Error Information Handle: Not Provided
        Total Width: Unknown
        Data Width: Unknown
        Size: No Module Installed
        Form Factor: Unknown
        Set: None
        Locator: P0_MC0_DIM_CH_B0
        Bank Locator: NODE 1
        Type: Unknown
        Type Detail: Unknown
        Speed: Unknown
        Manufacturer: NO DIMM
        Serial Number: NO DIMM
        Asset Tag: NO DIMM
        Part Number: NO DIMM
        Rank: Unknown
        Configured Memory Speed: Unknown
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x003B, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0034
        Error Information Handle: Not Provided
        Total Width: Unknown
        Data Width: Unknown
        Size: No Module Installed
        Form Factor: Unknown
        Set: None
        Locator: P0_MC0_DIM_CH_B1
        Bank Locator: NODE 1
        Type: Unknown
        Type Detail: Unknown
        Speed: Unknown
        Manufacturer: NO DIMM
        Serial Number: NO DIMM
        Asset Tag: NO DIMM
        Part Number: NO DIMM
        Rank: Unknown
        Configured Memory Speed: Unknown
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x003C, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0034
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC0_DIM_CH_C0
        Bank Locator: NODE 1
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2F816
        Asset Tag: P0_MC0_DIM_CH_C0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x003E, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0034
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC0_DIM_CH_C1
        Bank Locator: NODE 1
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2E7E3
        Asset Tag: P0_MC0_DIM_CH_C1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0040, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: Single-bit ECC
        Maximum Capacity: 2304 GB
        Error Information Handle: Not Provided
        Number Of Devices: 6

Handle 0x0042, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0040
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC1_DIM_CH_D0
        Bank Locator: NODE 2
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2F818
        Asset Tag: P0_MC1_DIM_CH_D0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0044, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0040
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC1_DIM_CH_D1
        Bank Locator: NODE 2
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2DC9A
        Asset Tag: P0_MC1_DIM_CH_D1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0046, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0040
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC1_DIM_CH_E0
        Bank Locator: NODE 2
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2666 MT/s
        Manufacturer: Samsung
        Serial Number: 232E33AF
        Asset Tag: P0_MC1_DIM_CH_E0_AssetTag
        Part Number: M393A4K40CB2-CTD
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0048, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0040
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC1_DIM_CH_E1
        Bank Locator: NODE 2
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2DD99
        Asset Tag: P0_MC1_DIM_CH_E1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x004A, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0040
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC1_DIM_CH_F0
        Bank Locator: NODE 2
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2E75C
        Asset Tag: P0_MC1_DIM_CH_F0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x004C, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0040
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P0_MC1_DIM_CH_F1
        Bank Locator: NODE 2
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2E3CD
        Asset Tag: P0_MC1_DIM_CH_F1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x004E, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: Single-bit ECC
        Maximum Capacity: 2304 GB
        Error Information Handle: Not Provided
        Number Of Devices: 6

Handle 0x0050, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x004E
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC0_DIM_CH_A0
        Bank Locator: NODE 3
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2E3D2
        Asset Tag: P1_MC0_DIM_CH_A0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0052, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x004E
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC0_DIM_CH_A1
        Bank Locator: NODE 3
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2F817
        Asset Tag: P1_MC0_DIM_CH_A1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0054, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x004E
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC0_DIM_CH_B0
        Bank Locator: NODE 3
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2BC87
        Asset Tag: P1_MC0_DIM_CH_B0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0056, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x004E
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC0_DIM_CH_B1
        Bank Locator: NODE 3
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22BD9861
        Asset Tag: P1_MC0_DIM_CH_B1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0058, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x004E
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC0_DIM_CH_C0
        Bank Locator: NODE 3
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2DC99
        Asset Tag: P1_MC0_DIM_CH_C0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x005A, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x004E
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC0_DIM_CH_C1
        Bank Locator: NODE 3
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2E3CE
        Asset Tag: P1_MC0_DIM_CH_C1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x005C, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: Single-bit ECC
        Maximum Capacity: 2304 GB
        Error Information Handle: Not Provided
        Number Of Devices: 6

Handle 0x005E, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x005C
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC1_DIM_CH_D0
        Bank Locator: NODE 4
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2666 MT/s
        Manufacturer: Samsung
        Serial Number: 232E3663
        Asset Tag: P1_MC1_DIM_CH_D0_AssetTag
        Part Number: M393A4K40CB2-CTD
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0060, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x005C
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC1_DIM_CH_D1
        Bank Locator: NODE 4
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2DE31
        Asset Tag: P1_MC1_DIM_CH_D1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0062, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x005C
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC1_DIM_CH_E0
        Bank Locator: NODE 4
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2666 MT/s
        Manufacturer: Samsung
        Serial Number: 232E353E
        Asset Tag: P1_MC1_DIM_CH_E0_AssetTag
        Part Number: M393A4K40CB2-CTD
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0064, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x005C
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC1_DIM_CH_E1
        Bank Locator: NODE 4
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22BD97BD
        Asset Tag: P1_MC1_DIM_CH_E1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0066, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x005C
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC1_DIM_CH_F0
        Bank Locator: NODE 4
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2E957
        Asset Tag: P1_MC1_DIM_CH_F0_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

Handle 0x0068, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x005C
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 32 GB
        Form Factor: DIMM
        Set: None
        Locator: P1_MC1_DIM_CH_F1
        Bank Locator: NODE 4
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: Samsung
        Serial Number: 22C2BD47
        Asset Tag: P1_MC1_DIM_CH_F1_AssetTag
        Part Number: M393A4K40BB1-CRC
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
        Maximum Voltage: 1.2 V
        Configured Voltage: 1.2 V

查看内存详细使用情况 cat /proc/meminfo

# cat /proc/meminfo
MemTotal:       725944392 kB #内存大小
MemFree:        700877996 kB
MemAvailable:   707022128 kB
Buffers:            7816 kB
Cached:          9596040 kB
SwapCached:            0 kB
Active:         15354848 kB
Inactive:        7675076 kB
Active(anon):   13093352 kB
Inactive(anon):   346832 kB
Active(file):    2261496 kB
Inactive(file):  7328244 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4194300 kB
SwapFree:        4194300 kB
Dirty:               776 kB
Writeback:             0 kB
AnonPages:      13422752 kB
Mapped:           775664 kB
Shmem:            413676 kB
KReclaimable:     419356 kB
Slab:            1011216 kB
SReclaimable:     419356 kB
SUnreclaim:       591860 kB
KernelStack:       33296 kB
PageTables:       153344 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    367166496 kB
Committed_AS:   26061252 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
Percpu:            32448 kB
HardwareCorrupted:     0 kB
AnonHugePages:    362496 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:     1151456 kB
DirectMap2M:    16320512 kB
DirectMap1G:    722468864 kB

查看内存的插槽数,已经使用多少插槽.每条内存多大

32*22=704

# dmidecode|grep -A5 "Memory Device"|grep Size|grep -v Range
        Size: 32 GB
        Size: 32 GB
        Size: No Module Installed
        Size: No Module Installed
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB
        Size: 32 GB

硬盘

查看硬盘和分区分布

# lsblk
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                             8:0    0   3.7T  0 disk
├─sda1                                          8:1    0   600M  0 part  /boot/efi
├─sda2                                          8:2    0     1G  0 part  /boot
└─sda3                                          8:3    0   3.7T  0 part
  └─luks-32b60050-6fe4-46af-a919-9840a41ae523 253:0    0   3.7T  0 crypt
    ├─cl-root                                 253:1    0    50G  0 lvm   /
    ├─cl-swap                                 253:2    0     4G  0 lvm   [SWAP]
    └─cl-home                                 253:6    0   3.6T  0 lvm   /home
sdb                                             8:16   0 931.5G  0 disk
├─sdb1                                          8:17   0     1G  0 part
└─sdb2                                          8:18   0 930.5G  0 part
  ├─centos-swap                               253:3    0     4G  0 lvm
  ├─centos-home                               253:4    0 876.5G  0 lvm
  └─centos-root                               253:5    0    50G  0 lvm
sdc                                             8:32   0 931.5G  0 disk  /mnt/EDA_RISC_V
nvme0n1                                       259:0    0 745.2G  0 disk
└─nvme0n1p1                                   259:1    0 745.2G  0 part

查看硬盘大小

# sudo fdisk -l | grep Disk
[sudo] password for lj:
Disk /dev/nvme0n1: 745.2 GiB, 800166076416 bytes, 1562824368 sectors
Disklabel type: gpt
Disk identifier: 8863DC68-5771-48DF-9217-0098B1E3098E
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disklabel type: gpt
Disk identifier: B92962FC-5F6F-4491-80C9-EAB3605066B5
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disklabel type: dos
Disk identifier: 0x000de9ba
Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk /dev/mapper/luks-32b60050-6fe4-46af-a919-9840a41ae523: 3.7 TiB, 3999080120320 bytes, 7810703360 sectors
Disk /dev/mapper/cl-root: 50 GiB, 53687091200 bytes, 104857600 sectors
Disk /dev/mapper/cl-swap: 4 GiB, 4294967296 bytes, 8388608 sectors
Disk /dev/mapper/centos-swap: 4 GiB, 4294967296 bytes, 8388608 sectors
Disk /dev/mapper/centos-home: 876.5 GiB, 941143097344 bytes, 1838170112 sectors
Disk /dev/mapper/centos-root: 50 GiB, 53687091200 bytes, 104857600 sectors
Disk /dev/mapper/cl-home: 3.6 TiB, 3941093867520 bytes, 7697448960 sectors

查看硬盘和分区的详细信息

# sudo fdisk -l

Disk /dev/nvme0n1: 745.2 GiB, 800166076416 bytes, 1562824368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8863DC68-5771-48DF-9217-0098B1E3098E

Device         Start        End    Sectors   Size Type
/dev/nvme0n1p1  2048 1562824334 1562822287 745.2G Linux filesystem


Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B92962FC-5F6F-4491-80C9-EAB3605066B5

Device       Start        End    Sectors  Size Type
/dev/sda1     2048    1230847    1228800  600M EFI System
/dev/sda2  1230848    3327999    2097152    1G Linux filesystem
/dev/sda3  3328000 7814035455 7810707456  3.7T Linux filesystem


Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000de9ba

Device     Boot   Start        End    Sectors   Size Id Type
/dev/sdb1  *       2048    2099199    2097152     1G 83 Linux
/dev/sdb2       2099200 1953523711 1951424512 930.5G 8e Linux LVM


Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/luks-32b60050-6fe4-46af-a919-9840a41ae523: 3.7 TiB, 3999080120320 bytes, 7810703360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/cl-root: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/cl-swap: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-home: 876.5 GiB, 941143097344 bytes, 1838170112 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-root: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/cl-home: 3.6 TiB, 3941093867520 bytes, 7697448960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

其他

查看网卡的硬件信息

# lspci | grep -i 'eth'
3b:00.0 Ethernet controller: Intel Corporation Ethernet Controller 10G X550T (rev 01)
3b:00.1 Ethernet controller: Intel Corporation Ethernet Controller 10G X550T (rev 01)

查看显卡运行状况

# nvidia-smi

-bash: nvidia-smi: command not found  #由于系统暂未配置好,因此未输出

Thu Nov 23 10:32:20 2017       #正常情况下的输出
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.26                 Driver Version: 375.26                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla K80           Off  | 0000:04:00.0     Off |                    0 |
| N/A   60C    P0    75W / 149W |   4344MiB / 11439MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Tesla K80           Off  | 0000:05:00.0     Off |                    0 |
| N/A   43C    P0    89W / 149W |   2196MiB / 11439MiB |     15%      Default |
+-------------------------------+----------------------+----------------------+
|   2  Tesla K80           Off  | 0000:08:00.0     Off |                    0 |
| N/A   90C    P0   100W / 149W |   2196MiB / 11439MiB |     98%      Default |
+-------------------------------+----------------------+----------------------+
|   3  Tesla K80           Off  | 0000:09:00.0     Off |                    0 |
| N/A   60C    P0    87W / 149W |   4212MiB / 11439MiB |     26%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0     25459    C   python3                                       4336MiB |
|    1     25459    C   python3                                       2188MiB |
|    2     25459    C   python3                                       2188MiB |
|    3     25459    C   python3                                       4204MiB |
+-----------------------------------------------------------------------------+

参考

常用的Linux下查看服务器配置的命令

linux下如何查看服务器的硬件配置信息

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

一、查看cpu信息

1、所有信息 lscpu

2、查看逻辑cpu的数量

3、查看物理cpu的数量

4、查看每个物理cpu的内核数

5、每个物理CPU上逻辑CPU个数

6、判断是否开启了抄超线程:

如果多个逻辑CPU的"physical id"和"core id"均相同,说明开启了超线程

或者换句话说

 逻辑CPU个数 > 物理CPU个数 * CPU内核数   开启了超线程

 逻辑CPU个数 = 物理CPU个数 * CPU内核数   没有开启超线程

 

二、查看内存信息

1、free -m

2、查看内存详细信息   cat /proc/meminfo

 

 

你可能感兴趣的:(Linux)