我可以在 Linux 终端中找出 PCI-e 插槽是 1.0、2.0 还是 3.0 吗?

sta*_*orn 29 linux pci-express terminal pci hardware-detection

我打算购买一个用于 PCI-e 3.0 的 GPU。但是由于我不知道我的计算机中的 PCI-e 插槽是什么,所以我需要以某种方式找到它。是否可以从 linux 的终端中找到它?

qua*_*gar 24

使用lspci -vv,您可以获得传输速率并将其与为修订指定的传输速率进行比较。示例输出将显示为:

# lspci -vv | grep -E 'PCI bridge|LnkCap'
00:02.0 PCI bridge: NVIDIA Corporation C51 PCI Express Bridge (rev a1) (prog-if 00 [Normal decode])
                LnkCap: Port #2, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <4us
00:03.0 PCI bridge: NVIDIA Corporation C51 PCI Express Bridge (rev a1) (prog-if 00 [Normal decode])
                LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <512ns, L1 <4us
00:04.0 PCI bridge: NVIDIA Corporation C51 PCI Express Bridge (rev a1) (prog-if 00 [Normal decode])
                LnkCap: Port #0, Speed 2.5GT/s, Width x16, ASPM L0s L1, Latency L0 <512ns, L1 <4us
00:10.0 PCI bridge: NVIDIA Corporation MCP51 PCI Bridge (rev a2) (prog-if 01 [Subtractive decode])
Run Code Online (Sandbox Code Playgroud)

这说明这里的速度是2.5GT/s,对应PCIe 1.x。

  • 这就是`#` 的意思。 (13认同)
  • 这需要以 root 身份运行;没有它,`lspci` 会默默地打印 `Capabilities: &lt;access denied&gt;`,它被 `grep` 删除。 (9认同)
  • @KenSharp我的理解是`LnkCap`是链路能力,而不是当前的吞吐量。您的主张有来源吗? (2认同)

dav*_*dgo 16

您可以使用“dmidecode”命令给出系统上所有硬件的详细列表,然后查看。我做了一个“快速而肮脏”的命令来显示相关位,如下所示:

dmidecode | grep "PCI"
Run Code Online (Sandbox Code Playgroud)

哪个返回

PCI is supported
Type: x16 PCI Express 2 x8
Type: x8 PCI Express 2 x4
Type: x8 PCI Express 2 x4
Type: x8 PCI Express 2 x4
Type: 32-bit PCI
Run Code Online (Sandbox Code Playgroud)

  • 只为我显示“类型:x16 PCI Express”。所以没有 PCIe 版本... (9认同)
  • `dmidecode --type 9` 也可用于过滤,同时保留其余信息。 (6认同)