一、报错
因为显卡信息过长,使用 nvidia-smi
命令不能完全显示,因此想用 lspci
命令查看一下显卡的型号,于是报错了…
$ lspci | grep -i nvidia
-bash: lspci: command not found
二、原因分析
三、解决方案
使用apt-get install安装,出错,apt命令定位不到lspci包
$ apt-get install lspci
Reading package lists.. . Done
Building dependency tree
Reading state information.. . Done
E: Unable to locate package lspci
分析:lspci
命令位于 pciutils
包的附加包 libpci3
中,因此需要安装这个包才能使用 lspci
命令 再次安装,成功
$ apt install pciutils
Reading package lists.. . Done
Building dependency tree
Reading state information.. . Done
The following package was automatically installed and is no longer required:
libprotobuf-lite9v5
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
libpci3
The following NEW packages will be installed:
四、可以愉快地使用 lspci
命令了
查看显卡星号 lspci | grep -i VGA
03:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family ( rev 41 )
1a:00.0 VGA compatible controller: NVIDIA Corporation Device 2216 ( rev a1)
1b:00.0 VGA compatible controller: NVIDIA Corporation Device 2216 ( rev a1)
3d:00.0 VGA compatible controller: NVIDIA Corporation Device 2216 ( rev a1)
3e:00.0 VGA compatible controller: NVIDIA Corporation Device 2216 ( rev a1)
89 :00.0 VGA compatible controller: NVIDIA Corporation GM200 [ GeForce GTX TITAN X] ( rev a1)
b1:00.0 VGA compatible controller: NVIDIA Corporation Device 1e04 ( rev a1)
b2:00.0 VGA compatible controller: NVIDIA Corporation Device 2216 ( rev a1)
89 :00.0 VGA compatible controller: NVIDIA Corporation GM200 [ GeForce GTX TITAN X] ( rev a1)