1. Windows下查看硬件信息 2. Linux系统查看硬件信息GUI 3. Linux命令行查看硬件设备 3.1 查看PCI设备 3.2 查看CPU 3.3 查看内存 3.4 查看显卡 3.5 查看硬盘 3.6 查看网络 3.7 综合
1. Windows下查看硬件信息
cpu-z 查看CPU,GPU,MB,RAM等主要部件。https://www.cpuid.com/softwares.html
更加详细专业的有: AIDA64...
http://www.aida64.com/downloads/latesta64xe
安装后有1个月试用期。可以导出非常详细的系统信息,比如下面这样:
https://szosoft.blogspot.com/p/tom-pc2008.html
2. Linux系统查看硬件信息GUI
使用命令或快捷方式打开:$ lstopo
打开后还有快捷键提示,如下图,可以看到2个硬盘分别接入那个地址,网卡使用那个PCI地址。
$ sudo hardinfo
可以看到硬件及操作系统软件的详细信息,如下图,可以看到这个x1的PCIe最大速率2.5GT/s
$ sudo lshw -X
打开若不显示任何内容,点一下Refresh刷新即可,如下图,可以看到USB的版本及速率
lshw的多种输出格式
$ lshw –help
-html output hardware tree as HTML 将硬件树输出为HTML -xml output hardware tree as XML 将硬件树输出为XML -short output hardware paths 输出硬件路径 -businfo output bus information 输出总线信息 -X use graphical interface 使用图形界面$ sudo lshw -html > lshw-html.html
3. Linux命令行查看硬件设备
3.1 查看PCI设备
$ lspci PCI设备列表,第一列就是设备的[ids] $ lspci -tvnn PCI设备树状列表,可以看到PCIe端口被那些设备占用了 $ lspci -vvvnn -s [ids] 根据上面列表的[ids]查询详细信息 $ lsusb.py -i 查看USB端口及设备,可以看到USB版本及速率,电流等 $ ls -l /dev/disk/by-path/ 查看硬盘使用了那些端口根据上面这些查询就能列出类似如下这张PCI设备的整体列表了
$ lspci | 简述 | $ lspci -tvnn | $ lspci -vvvnn -s [ids] // 00:02.0 | |||||||
[ids] | name | Intel Corporation | type | 补充 | 树状显示 | pin | IRQ | Kernel driver | Kernel modules | BridgeCtl: |
00:00.0 | Host bridge: | Mobile PM965/GM965/GL960 Memory Controller Hub | Host | bridge | intel_agp | |||||
00:02.0 | VGA compatible controller: | Mobile GM965/GL960 Integrated Graphics Controller (primary) | VGA | 板载显卡 | A | 16 | i915 | i915 | ||
00:02.1 | Display controller: | Mobile GM965/GL960 Integrated Graphics Controller (secondary) | Display | |||||||
00:19.0 | Ethernet controller: | 82562GT 10/100 Network Connection | Ethernet | 以太网卡 | A | 28 | e1000e | e1000e | ||
10:00.0 | Network controller: | PRO/Wireless 3945ABG [Golan] Network Connection | Wireless | 无线网卡 | -- PCIe Port 2 | A | 30 | iwl3945 | iwl3945 | |
00:1b.0 | Audio device: | 82801H (ICH8 Family) HD Audio Controller | Audio | 声卡 | A | 29 | snd_hda_intel | snd_hda_intel | ||
00:1e.0 | PCI bridge: | 82801 Mobile PCI Bridge | PCI | bridge | 02 -- | Parity- SERR+ NoISA+ VGA- VGA16- MAbort- >Reset- FastB2B- PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn- | ||||
00:1c.0 | PCI bridge: | 82801H (ICH8 Family) PCI Express Port 1 | PCIe | Port 1 bridge | 08 -- | A | 24 | pcieport | ||
00:1c.1 | PCI bridge: | 82801H (ICH8 Family) PCI Express Port 2 | PCIe | Port 2 bridge | 10 Wireless | B | 25 | pcieport | ||
00:1c.4 | PCI bridge: | 82801H (ICH8 Family) PCI Express Port 5 | PCIe | Port 5 bridge | 28 USB3.0 | A | 26 | pcieport | ||
00:1a.0 | USB controller: | 82801H (ICH8 Family) USB UHCI Controller #4 | USB | #4 | usb3 | A | 16 | uhci_hcd | uhci_hcd | |
00:1a.7 | USB controller: | 82801H (ICH8 Family) USB2 EHCI Controller #2 | USB2 | #2 | usb1 | C | 18 | ehci-pci | ehci-pci | |
00:1d.0 | USB controller: | 82801H (ICH8 Family) USB UHCI Controller #1 | USB | #1 | usb4 | A | 20 | uhci_hcd | uhci_hcd | |
00:1d.1 | USB controller: | 82801H (ICH8 Family) USB UHCI Controller #2 | USB | #2 | usb5 | B | 21 | uhci_hcd | uhci_hcd | |
00:1d.2 | USB controller: | 82801H (ICH8 Family) USB UHCI Controller #3 | USB | #3 | usb6 | C | 18 | uhci_hcd | uhci_hcd | |
00:1d.7 | USB controller: | 82801H (ICH8 Family) USB2 EHCI Controller #1 | USB2 | #1 | usb2 SD | A | 20 | ehci-pci | ehci-pci | |
28:00.0 | USB controller: | Renesas Technology Corp. uPD720202 USB 3.0 Host Controller | USB 3.0 | ExpressCard | usb7,8 PCIe P5 | A | 16 | xhci_hcd | xhci_hcd | |
00:1f.0 | ISA bridge: | 82801HM (ICH8M) LPC Interface Controller | ISA | bridge | lpc_ich | lpc_ich | ||||
00:1f.1 | IDE interface: | 82801HM/HEM (ICH8M/ICH8M-E) IDE Controller | IDE | HDD | $ ls -l /dev/disk/by-path/ | A | 16 | ata_piix | ata_piix, pata_acpi, ata_generic | |
00:1f.2 | SATA controller: | 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] | SATA | SSD | B | 27 | ahci | ahci |
3.2 查看CPU
$ cat /proc/cpuinfo | grep model\ namemodel name: Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz
model name: Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz
3.3 查看内存
$ cat /proc/meminfo | grep MemTotalMemTotal: 8146664 kB
3.4 查看显卡
$ lspci | grep VGA00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 0c)
找到显卡的ids,再查看详细内容
$ lspci -vvvnn -s 00:02.0
查看详细内容,除了用上面的ids,也可以用简单的关键字VGA
$ lspci -vnn | grep VGA -A 12
$ sudo lshw -c video | grep configuration
configuration: driver=i915 latency=0
configuration: latency=0
使用 glxinfo 命令查看 OpenGL 的详细信息:
$ glxinfo |grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) 965GM
OpenGL version string: 2.1 Mesa 19.3.4
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 19.3.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
$ pacman -Qo glxinfo
/usr/bin/glxinfo is owned by mesa-demos 8.4.0-2
- Arch 下安装 pacman S mesa-demos
- Ubuntu下安装 apt install mesa-utils
http://www.mesa3d.org/
和GPU 相关的 Linux 命令
$ glxinfo | grep rendering 查看3D加速是否有效 $ glxgears -info Testing $ nvidia-smi Nvidia自带一个命令行工具可以查看显存的使用情况 $ watch -n 10 nvidia-smi 周期性的输出显卡的使用情况,可以用watch指令实现 $ grep -i --color vga /var/log/Xorg.0.loghttps://zhuanlan.zhihu.com/p/37640419
3.5 查看硬盘
$ lsblk -f# blkid
df(disk free)
du(disk usage)
3.6 查看网络
ip, iw...https://szosoft.blogspot.com/2020/02/ip-show.html
https://szosoft.blogspot.com/2020/03/busybox.html#205
https://www.cnblogs.com/sztom/articles/10764994.html
3.7 综合
设备\命令 | $ lshw -c [class] | # dmidecode -t [type] | $ lspci -s [ids] | $ cat /proc/ | 更多命令 |
CPU | processor | processor | - | cpuinfo | $ lscpu |
内存 | memory | memory | - | meminfo | $ lsmem |
显卡 | display, video | - | [ids] | $ lsgpu | |
声卡 | multimedia | - | [ids] | ./asound/ | |
系统 | system | system | |||
总线 | bus, bridge | - | [ids] | ./bus/ | $ lspci |
网卡 | network | - | [ids] | ||
存储 | storage | - | [ids] | ./scsi/ | lsblk, blkid, Du, df, fdisk |
可用项: | $ lshw -short | 输错类型便会列出可用项 | lspci 返回的第一列 |
没有评论:
发表评论