Syllo / nvtop

GPU & Accelerator process monitoring for AMD, Apple, Huawei, Intel, NVIDIA and Qualcomm
Other
7.7k stars 282 forks source link

Looks like something mislead about PCIe GEN #242

Open NTMan opened 9 months ago

NTMan commented 9 months ago

How nvtop calculate PCIe GEN information? I ask because that I see in nvtop does not match what I see via /sys/bus/pci/devices

Screenshot from 2023-09-24 14-39-18

Generation Released Speed
PCIe 1.0 2003 2 GT/s
PCIe 2.0 2007 5 GT/s
PCIe 3.0 2010 8 GT/s
PCIe 4.0 2017 16 GT/s
PCIe 5.0 2019 32 GT/s
PCIe 6.0 2021 64 GT/s

Which means GPU with 16 GT/s should have GEN 4

Here is my HW specs: https://linux-hardware.org/?probe=dd5735f315

Umio-Yasuno commented 9 months ago

possible duplicate of: https://github.com/Syllo/nvtop/issues/138#issuecomment-1532288951 https://gitlab.freedesktop.org/drm/amd/-/issues/1967

NTMan commented 9 months ago
❯ cat /sys/bus/pci/devices/0000:03:00.0/pp_dpm_pcie
0: 2.5GT/s, x1 78Mhz 
1: 5.0GT/s, x4 156Mhz 
2: 16.0GT/s, x16 623Mhz

Hmm... What means absence of asterisk symbol?

Umio-Yasuno commented 9 months ago
❯ cat /sys/bus/pci/devices/0000:03:00.0/pp_dpm_pcie
0: 2.5GT/s, x1 78Mhz 
1: 5.0GT/s, x4 156Mhz 
2: 16.0GT/s, x16 623Mhz

Hmm... What means absence of asterisk symbol?

Oh, the same problem occurred on RX 6600.
Probably it is an AMDGPU driver issue, I will report it to drm/amd.

Umio-Yasuno commented 9 months ago

Reported: https://gitlab.freedesktop.org/drm/amd/-/issues/1447#note_2101382

Syllo commented 9 months ago

Hello, Nvtop extracts the PCIe bus from the device using libudev and does not rely on pp_dpm_pcie (code). The code walks the PCIe bus from the device up to the root and takes the smallest value for speed and width it sees on the path.

The link speed is translated similar to your table here.

It can be that the reporting is wrong somewhere through the PCIe path. Also recent GPUs have internal PCIe switches that dynamically lower/increase the PCIe speed to reduce power consumption. Do you see the same value while running heavy GPU workloads (games, AI)?

NTMan commented 9 months ago

Do you see the same value while running heavy GPU workloads (games, AI)?

Yes

Screenshot from 2023-09-26 16-04-14