38

PCI Express slots on the motherboard can be wider then the number of lanes connected. For example a motherboard can have x8 slot with only x1 lane connected.

On the other hand, you can insert a card using only for ex. 4 lanes to a x16 slot on the motherboard, and they will negotiate to use only those x4 lanes.

How to check from the running system how many lanes are used by the inserted PCIe cards?

43

Ok, it seems I missed it on first try in lspci manpages.

Note: Run the command as root/sudo otherwise a lot of detail is ommitted including the Lnk output shown below.

lspci -vv displays a lot of information, including link width:

01:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GT] (rev a2) (prog-if 00 [VGA controller])
            [...]
            LnkCap: Port #0, Speed 2.5GT/s, Width x16, ASPM L0s L1, Latency L0 <512ns, L1 <1us
                    ClockPM- Surprise- LLActRep- BwNot-
            LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- Retrain- CommClk+
                    ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
            LnkSta: Speed 2.5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
| improve this answer | |
  • 3
    in your example the output text has both width x16 and width x8. I assume this is interpretted as: the link capacity is width x16 and this device has negotiated width x8? – Trevor Boyd Smith Nov 21 '14 at 18:26
  • 1
    Yes, that's how I understand it, too. – silk Nov 24 '14 at 10:47
  • 1
    Same as @ʇsәɹoɈ 's comment at other answer; Use root/sudo – hbogert Oct 7 '18 at 13:38
  • Bad Translation: The Chipset has lanes... I think usually just one Chipset lane at 1x the processor's fastest speed... like PCI-E 3.0. Ethernet, The subsystem the USB is attached, is the chipset one, usually. use -t to get a tree for devices that have a built in switch... which saves you PCI lanes. – Ray Foss May 27 at 17:27
18

Sometimes it can be a bit more complicated.

For example, 4 Port GBit ethernet adapters have a PCIe switch on board. I trapped into an issue where I found the Ethernet Adapter connected to x4, but a bottleneck upstream when the onboard pcie switch was connected at x1 to the motherboard only.

See this thread for the issue: http://thread.gmane.org/gmane.linux.drivers.e1000.devel/15192/focus=15254

To get a grasp on tree connectivity, compare the view of

sudo lspci -tv
sudo lspci -vv | grep -P "[0-9a-f]{2}:[0-9a-f]{2}\.[0-9a-f]|LnkSta:"

The last line will show you the Link Status below every device on the bus without the overwelming detail of vv option.

| improve this answer | |
  • 14
    Note: When run as an unprivileged user, lspci doesn't show the LnkCap / LnkSta / Width stats. Run it with sudo to see them. – ʇsәɹoɈ Jan 7 '17 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.