计算CPU的内存带宽和CPU-GPU的PCIE带宽

计算CPU的最大内存带宽

在FastDecode文章中,红框里显示CPU的最大内存带宽,这是怎么计算的呢?

image-20240821220423762

首先有几个基础知识:

  • 内存核心频率
  • 倍增系数:DDR通过数据预取技术放大速率,每代ddr倍率是固定的,ddr=2, ddr2=4, ddr3=8, ddr4=8, ddr5=16,这里的单位是B
  • 通道数

那么理论最大带宽=内存核心频率×倍增系数×通道数MB/s

以这个Intel Xeon Gold 5218为例。内存核心频率是2667MHz。最大通道数是6,使用的是DDR4,则倍增系数是8。

image-20240821221047403

因此理论最大带宽 = 2667×8×6 = 128016MB/s = 128GB/s

查看CPU-GPU之间的PCIE带宽

https://cloud.tencent.com/developer/article/2371902

运行结果如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
设备编号: 17:00.0
设备类型: 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 16GB] (rev a1)
设备信息: 10de:1db4
带宽信息:
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)

设备编号: 65:00.0
设备类型: 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 16GB] (rev a1)
设备信息: 10de:1db4
带宽信息:
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)

设备编号: ca:00.0
设备类型: 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 16GB] (rev a1)
设备信息: 10de:1db4
带宽信息:
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)

设备编号: e3:00.0
设备类型: 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 16GB] (rev a1)
设备信息: 10de:1db4
带宽信息:
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x8 (downgraded)
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported
LnkSta: Speed 8GT/s (ok), Width x16 (ok)

8GT/s对应的是PCIE3.0,与V100显示的规格一致,16通道的话,最终的带宽是16GB/s

image-20240823171823377