【解决错误】-bash: lspci: command not found

一、报错

  • 因为显卡信息过长,使用 nvidia-smi 命令不能完全显示,因此想用 lspci 命令查看一下显卡的型号,于是报错了…
$ lspci | grep -i nvidia
-bash: lspci: command not found

二、原因分析

  • linux环境中没有lspci命令,那就安装一个

三、解决方案

  • 使用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)
  • lspci | grep GeForce
89:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX TITAN X] (rev a1)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值