<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[# X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」]]></title><description><![CDATA[<blockquote>
<p dir="auto">上一篇讲了怎么把这台 X99 洋垃圾（Dell T7910）刷成能跑 R9700 的推理机，以及插上第二张卡后<strong>一满载就硬断电</strong>的翻车。<br />
这篇是续集，三件事：<br />
① 把供电问题<strong>彻底解决</strong>（不是换电源）；<br />
② 把「双卡跑一个大模型提速」这条路<strong>从 TP → 行拆分 → tensor 全试一遍</strong>；<br />
③ 得到最终形态 —— <strong>双卡双实例，一卡一个模型</strong>。</p>
</blockquote>
<hr />
<h2>TL;DR</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>我想做的事</th>
<th>结果</th>
<th>关键原因</th>
</tr>
</thead>
<tbody>
<tr>
<td>双卡同时满载不掉电</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>做到了</strong>（400W 稳定 225 秒）</td>
<td><strong>OD 限频 + 降压</strong>，不是换电源</td>
</tr>
<tr>
<td>双卡 TP（张量并行）提速</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 全线失败</td>
<td><strong>P2P 不可用</strong>（内核白名单），绕不过去</td>
</tr>
<tr>
<td>双卡「行拆分」提速</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 加载即崩</td>
<td>ROCm 后端<strong>没实现</strong> <code>split_buffer_type</code></td>
</tr>
<tr>
<td>双卡「tensor」模式提速</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 能跑但不值</td>
<td>AllReduce 退化 + <strong>不兼容投机解码</strong></td>
</tr>
<tr>
<td>双卡「层拆分」提速</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 不提速，只加显存</td>
<td>层拆分是<strong>串行流水线</strong></td>
</tr>
<tr>
<td>双卡最终形态</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>双实例，一卡一个模型</strong></td>
<td>零通信开销、互不拖累</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>一句话</strong>：这块平台的瓶颈从来不是钱，是**「并行」这件事在 X99 上被物理封死了** —— 双卡唯一正确的用法是<strong>让它俩各干各的</strong>。</p>
<hr />
<h2>一、平台配置</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项</th>
<th>规格</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>机型</td>
<td>Dell Precision T7910 塔式工作站</td>
<td>洋垃圾整机</td>
</tr>
<tr>
<td>CPU</td>
<td>2× Xeon E5-2683 v4（16C/32T each，32C/64T）</td>
<td>双路，两个 NUMA 节点</td>
</tr>
<tr>
<td>内存</td>
<td>4× 32G DDR4-2400</td>
<td>每路双通道，76.8 GB/s</td>
</tr>
<tr>
<td>电源</td>
<td><strong>原装 1300W</strong>（型号 D1300EF-02）</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 规格是 <strong>4 路 12V × 18A</strong></td>
</tr>
<tr>
<td>GPU</td>
<td><strong>2× AMD Radeon AI PRO R9700 32GB</strong>（gfx1201 / RDNA4）</td>
<td>250W/卡（限频后实际 ~250W 峰值）</td>
</tr>
<tr>
<td>系统</td>
<td>Ubuntu 24.04.5 LTS，内核 7.0.0-31</td>
<td>ROCm 7.2.0</td>
</tr>
<tr>
<td>推理后端</td>
<td>llama.cpp（HIP 后端，commit <code>56381e4</code>）</td>
<td>自己编译，打了 FastMTP 补丁</td>
</tr>
</tbody>
</table>
<h3>相对上一篇，平台这边新增的两件事</h3>
<ol>
<li><strong>换了卡位</strong>：把其中一张卡从 CPU2 的槽搬到 CPU1 的空闲 x16 槽 → 两卡同 NUMA 节点、跳数 3→2。</li>
<li><strong>关了 BIOS 虚拟化</strong>（本想关掉 IOMMU 隔离，后来发现没用，见第五节）。</li>
</ol>
<hr />
<h2>二、破解跳闸：<strong>根本不是功率问题</strong></h2>
<h3>2.1 先做对照实验（这一步是全文的地基）</h3>
<p dir="auto">单卡任何配置都能跑，双卡一上负载 47 秒断电。所以我把「单卡 × 模型」全排列测了一遍，每档压 90 秒以上：</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/22195613-74c5-4f89-9eb4-ca6dd4e9e294.jpeg" alt="88705bd0-6679-4b26-8b90-0c972ae12857-image.jpeg" class=" img-fluid img-markdown" /><br />
单卡三种配置全部通过，双卡合计仅 263W 就跳闸</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>实验</th>
<th>平均功耗</th>
<th>峰值功耗</th>
<th>时长</th>
<th>结果</th>
</tr>
</thead>
<tbody>
<tr>
<td>A-1 新卡 + gemma-4-26B</td>
<td><strong>182.3 W</strong></td>
<td>262.0 W</td>
<td>90s</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 通过</td>
</tr>
<tr>
<td>A-2 原卡 + gemma-4-26B</td>
<td><strong>178.0 W</strong></td>
<td>249.0 W</td>
<td>98s</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 通过</td>
</tr>
<tr>
<td>A-3 新卡 + Qwen3.8-27B Q6</td>
<td><strong>236.4 W</strong></td>
<td><strong>289.0 W</strong></td>
<td>92s</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 通过</td>
</tr>
<tr>
<td><strong>双实例（两卡各常驻一个模型）</strong></td>
<td><strong>合计仅 263 W</strong></td>
<td>—</td>
<td><strong>47s</strong></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> <strong>硬断电</strong></td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto"><strong>功耗采样口径</strong>：读 <code>/sys/class/drm/card*/device/hwmon/hwmon*/power1_average</code>，0.15~15 秒一次，采样<strong>落盘到家目录</strong>（<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 写 <code>/tmp</code> 会在重启后丢光，我踩过）。<br />
<strong>时长口径</strong>：三段单卡对照全部 ≥90 秒，和双卡失败那次的 47 秒可比。</p>
</blockquote>
<h3>2.2 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f511.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--key" style="height:23px;width:auto;vertical-align:middle" title="🔑" alt="🔑" /> 转折点</h3>
<p dir="auto"><strong>看第三行和第四行：236W 的单卡不跳，263W 的双卡跳。</strong></p>
<p dir="auto">也就是说 —— <strong>失败跟总功率、跟在跑什么模型，都没有关系。</strong></p>
<p dir="auto">再补一刀：我把 <code>power1_cap</code>（功率上限）从 280W 一路降到 <strong>210W</strong>（这卡的硬件下限），<strong>双卡依然一上负载就跳</strong>。</p>
<blockquote>
<p dir="auto"><strong>结论：限制的不是「总功率」，是「瞬态尖峰的幅度」。</strong><br />
<code>power1_cap</code> 管的是<strong>长窗口平均功耗</strong>，对微秒级的 dI/dt 尖峰毫无办法（它的 sysfs 标签其实叫 <code>PPT</code> = Power <em>Target</em>，是「目标」不是「上限」）。<br />
唯一和失败严格相关的变量是：<strong>两张卡的显存子系统是否同时从空闲转入满载</strong>。</p>
</blockquote>
<p dir="auto"><strong>证据链（按排除顺序）：</strong></p>
<ol>
<li>降 cap 后仍断 ⇒ 不是「上限设太高」</li>
<li>崩溃瞬间实测功率<strong>确实等于设定值</strong> ⇒ 不是「限功没生效」</li>
<li><strong>单卡 289W 不跳、双卡 263W 跳</strong> ⇒ 不是「持续过载」</li>
<li>跳闸发生在<strong>上负载</strong>而非启动/加载（双卡空载挂 90+ 秒完全没事）⇒ <strong>是尖峰触发电源保护</strong></li>
</ol>
<p dir="auto">（另外：崩溃前 <code>journalctl</code> <strong>没有任何内核日志</strong>，登录会话全部标记 <code>crash</code> —— 这是电源保护跳闸的签名，不是内核 panic、不是驱动崩溃、不是过热。）</p>
<hr />
<h2>三、解法：限频 + 降压（不换电源）</h2>
<p dir="auto">既然要压的是<strong>尖峰</strong>，那就去动<strong>电压/频率曲线</strong>，而不是功耗上限。</p>
<h3>3.1 正确接口是 <code>pp_od_clk_voltage</code>，不是 <code>pp_dpm_sclk</code></h3>
<pre><code class="language-bash"># 每张卡都要做一遍
echo "s -500"  | sudo tee /sys/class/drm/cardN/device/pp_od_clk_voltage   # SCLK  偏移 -500MHz
echo "vo -100" | sudo tee /sys/class/drm/cardN/device/pp_od_clk_voltage   # VDDGFX 偏移 -100mV
echo "c"       | sudo tee /sys/class/drm/cardN/device/pp_od_clk_voltage   # 提交
# echo "r"     | sudo tee ...                                              # 复位回默认
</code></pre>
<p dir="auto">可调范围（读同一文件即得）：<code>SCLK_OFFSET: -500 ~ +1000 MHz</code>、<code>VDDGFX_OFFSET: -200 ~ 0 mV</code>。</p>
<blockquote>
<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ <strong>坑</strong>：<code>pp_dpm_sclk</code> 的档位写法 <code>echo "s 2 1500" &gt; pp_dpm_sclk</code> <strong>静默无效</strong>（写不报错、读回不变，实测平均功耗 172.6W 几乎没动）。<strong>正确接口只有 <code>pp_od_clk_voltage</code> 的偏移写法。</strong></p>
</blockquote>
<h3>3.2 效果：功耗 -29%，速度只掉 2%</h3>
<p dir="auto"><img src="https://upload.lcz.me/uploads/4dfdb5f2-643c-4bdf-ad5d-cf73622668bc.jpeg" alt="51285964-bdce-438b-83f8-ed8b10eae90f-image.jpeg" class=" img-fluid img-markdown" /><br />
(fig2.png)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th>限频前</th>
<th>限频后</th>
<th>变化</th>
</tr>
</thead>
<tbody>
<tr>
<td>单卡平均功耗</td>
<td>182.3 W</td>
<td><strong>129.2 W</strong></td>
<td><strong>-29%</strong></td>
</tr>
<tr>
<td>单卡峰值功耗</td>
<td>262.0 W</td>
<td>251.0 W</td>
<td>-4%</td>
</tr>
<tr>
<td>decode 速度</td>
<td>84 t/s</td>
<td><strong>82 t/s</strong></td>
<td><strong>-2%</strong></td>
</tr>
<tr>
<td><strong>双卡同时满载</strong></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 47 秒跳闸</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>403~426W 稳定</strong></td>
<td>—</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto"><strong>速度口径</strong>：llama.cpp server 返回的 <code>timings.predicted_per_second</code>（纯 decode，不含 prefill）；固定 prompt + <code>max_tokens=600</code> 长回答；<code>--parallel 1</code> 单流；开 MTP 投机解码。</p>
</blockquote>
<p dir="auto"><strong>为什么速度几乎无损</strong>：decode 是<strong>显存带宽</strong>活（每 token 把权重读一遍），prefill 才是<strong>算力</strong>活。降 SCLK 主要砍 prefill，decode 掉得很少。</p>
<h3>3.3 固化 + 两个必踩的坑</h3>
<p dir="auto">已经做成 systemd 服务（<code>Type=oneshot</code> + <code>RemainAfterExit=yes</code>），开机自动应用：</p>
<ul>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ <strong>坑 1：必须带「读回校验 + 重试」</strong>。首次部署时出现过<strong>只配置到一张卡</strong>的竞态（开机太早，第二张卡的 sysfs 节点还没出现，<code>for d in /sys/class/drm/card*/...</code> 只匹配到一张）——<strong>另一张卡没限频等于白限</strong>。脚本要逐卡读回 <code>OD_SCLK_OFFSET</code> 确认，不匹配就重试。</li>
<li><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ <strong>坑 2</strong>：只 <code>systemctl enable</code> 不等于生效。<strong>必须真重启一次并读回每张卡的值</strong>才算验证过。</li>
</ul>
<hr />
<h2>四、双卡终于跑起来了</h2>
<p dir="auto">修好供电之后，把两个模型同时挂上去，压了 <strong>225 秒</strong>：</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/b56b01ad-0bbb-4466-b693-305f0200c9b8.jpeg" alt="2d20b795-1d87-488a-aa3a-7c00a2d721c3-image.jpeg" class=" img-fluid img-markdown" /><br />
(fig3.png)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>时刻</th>
<th>卡A（跑 27B Q6）</th>
<th>卡B（跑 gemma-4-26B）</th>
</tr>
</thead>
<tbody>
<tr>
<td>15s</td>
<td>247W / 50°C</td>
<td>139W / 43°C</td>
</tr>
<tr>
<td>60s</td>
<td>251W / 60°C</td>
<td>149W / 52°C</td>
</tr>
<tr>
<td>120s</td>
<td>249W / 63°C</td>
<td>122W / 56°C</td>
</tr>
<tr>
<td><strong>225s</strong></td>
<td><strong>249W / 65°C</strong></td>
<td>14W / 43°C</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>双卡同时满载峰值合计 ≈ 400W，持续 225 秒不跳。</strong><br />
（对比：改造前 263W 就 47 秒断电 —— <strong>撑了 4.8 倍的时长、1.5 倍的功率</strong>。）</p>
<blockquote>
<p dir="auto"><strong>口径说明</strong>：卡B 在 135 秒后掉到 14W 是<strong>正常的</strong> —— gemma 是 MoE（26B/激活 4B），速度快 ~5 倍，它那批 1500 token 早就答完了；卡A 的 Q6 是稠密 27B，一直压到结束。</p>
</blockquote>
<p dir="auto"><strong>顺手做的散热分配</strong>（这一步意外地有效）：把<strong>持续重载的 Q6 放在下层卡</strong>（吸冷风顺畅），<strong>轻载的 gemma 放上层</strong>（散热条件差）。<br />
实测结果是下层卡最高 65°C、上层卡最高 56°C —— 如果把 Q6 放上层，估计要冲 75°C+。</p>
<hr />
<h2>五、然后我想上 TP —— 结果撞了三堵墙</h2>
<p dir="auto">供电解决后，第一个念头就是：<strong>既然两张卡都能满载了，那并行跑一个模型是不是能提速？</strong></p>
<p dir="auto">答案是<strong>不能</strong>，而且原因比想象的深。</p>
<h3>5.1 第一堵墙：P2P 根本不可用</h3>
<p dir="auto">amdgpu 驱动在初始化时就把判决写进了内核日志：</p>
<pre><code>amdgpu: PCIe P2P access from peer device ... is not supported by the chipset
</code></pre>
<p dir="auto">一行命令就能定性，不用猜。但我不信邪，把常见嫌疑逐个排除了：</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/acf9a9c2-9a38-4e45-9fec-e227548924b6.jpeg" alt="da30bfcb-188b-437c-aff3-a27b5f784e02-image.jpeg" class=" img-fluid img-markdown" /><br />
(fig4.png)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>嫌疑</th>
<th>实测</th>
<th>结论</th>
</tr>
</thead>
<tbody>
<tr>
<td>ACS 重定向</td>
<td>路径上 8 个 PCIe 桥的 <code>ACSCtl</code> <strong>全是 <code>-</code></strong></td>
<td>× 排除</td>
</tr>
<tr>
<td>IOMMU 隔离</td>
<td><code>iommu=off</code>；<strong>去 BIOS 关了虚拟化后仍然 False</strong></td>
<td>× 排除</td>
</tr>
<tr>
<td><strong>REBAR / BAR 太小</strong></td>
<td><strong><code>BAR 0: current size: 32GB</code></strong> —— 大 BAR 完全正常</td>
<td>× <strong>排除（我原来的判断是错的）</strong></td>
</tr>
<tr>
<td>两卡跨 socket</td>
<td>搬卡到同一 CPU（hops 3→2、同 NUMA）后 <strong>P2P 仍为 False</strong></td>
<td>× 排除</td>
</tr>
<tr>
<td><strong>内核 p2pdma 白名单</strong></td>
<td>根桥 <code>8086:6f00</code>（Broadwell-EP / X99）<strong>不在白名单里</strong></td>
<td>★ <strong>真因</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>这里是本文最大的一个认知修正</strong>：我原以为「X99 没有 REBAR」是死因 —— <strong>错</strong>。开了 BIOS 的 Above 4G 之后，两张卡都拿到了完整的 32GB BAR。<strong>真正卡住的是 Linux 内核的 <code>pci_p2pdma</code> 白名单</strong>：只要数据路径要经过 host bridge，就要查这份白名单，而 Intel X99 的根桥不在里面。</p>
<blockquote>
<p dir="auto"><strong>旁证</strong>：社区里有人在<strong>同代平台</strong>（E5-2699v4 + X99 + 同款 R9700）打内核补丁把 <code>0x6f00</code> 加进白名单后，<code>hipDeviceCanAccessPeer()</code> 确实返回了 1，带宽 10.2 GB/s。<br />
<strong>所以「芯片组不支持」这句话是内核策略，不等于硬件做不到。</strong></p>
</blockquote>
<h3>5.2 但就算修好，也是负收益</h3>
<p dir="auto">同一份社区实测的后半段才是关键：硬件 P2P 打通<strong>之后</strong>，<code>hipIpcOpenMemHandle</code> 在 <strong>gfx1201 上恒定报错 17</strong> → RCCL 的 P2P 传输用不上 → vLLM 的 TP=2 只能退回 <strong>SHM 传输</strong>：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th>传输路径</th>
<th>decode（同规模稠密模型）</th>
</tr>
</thead>
<tbody>
<tr>
<td>默认</td>
<td>SHM/direct/direct</td>
<td>13.6 t/s</td>
</tr>
<tr>
<td>打 DMA 48 位补丁</td>
<td>SHM/direct/direct</td>
<td><strong>14.1 t/s（天花板）</strong></td>
</tr>
<tr>
<td>强开 P2P</td>
<td>→ <strong>死机，需物理重启</strong></td>
<td>—</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>14.1 t/s 比我这张单卡跑 MoE 模型的 84~92 t/s 慢 6 倍。</strong> 这是 AMD 侧的软件 bug，不是配置能解决的。</p>
<p dir="auto"><strong>→ 结论：TP 这条路，在这块平台上「要么走不通，要么走通了也没用」。</strong></p>
<h3>5.3 顺手澄清两个常见误区</h3>
<p dir="auto"><strong>① 「x16 拆分成 x8+x8 就能直连」——不行。</strong><br />
内核判的是「<strong>数据路径是否经过 host bridge</strong>」，不是「是否同一个物理插槽」。拆分后两卡落在两个独立 root port（<code>lspci</code> 里表现为成对端口 <code>00:01.0</code> / <code>00:01.1</code>），彼此通信仍要「上行进 root complex 再下来」⇒ 依然查白名单 ⇒ 照样判死。<br />
唯一能绕开的是让两卡挂在<strong>同一个 PCIe switch 的下游</strong>（公共祖先变成交换芯片，TLP 直接被转发，不进 host bridge）。<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 必须是「同一个」—— 板载两个 PLX、两卡各挂一个，无效。</p>
<p dir="auto"><strong>② 「搬卡到同一 CPU 就好了」——也不行。</strong><br />
实测搬卡后 hops 从 3 降到 2、NUMA 也统一了，<strong>P2P 仍然 False</strong>，而且<strong>层拆分的速度一模一样</strong>（详见 5.4）。</p>
<h3>5.4 第二堵墙：llama.cpp 的三种 split-mode 实测</h3>
<p dir="auto">既然 TP 指望不上，那就试试 llama.cpp 自己的多卡拆分。它有四种模式，我把没测过的三种全测了：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>模式</th>
<th>加载</th>
<th>能否配投机解码</th>
<th>decode</th>
<th>判定</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong><code>layer</code></strong></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 73s</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /></td>
<td>16.8 t/s</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> <strong>唯一完整可用</strong></td>
</tr>
<tr>
<td><strong><code>row</code></strong></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 加载即崩</td>
<td>—</td>
<td>—</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> <strong>ROCm 后端没实现</strong></td>
</tr>
<tr>
<td><strong><code>tensor</code></strong></td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /> 81s（不带投机）</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--x" style="height:23px;width:auto;vertical-align:middle" title="❌" alt="❌" /> 带投机必崩</td>
<td>20.0 t/s</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ 能跑但退化</td>
</tr>
<tr>
<td><code>layer</code>（关投机对照）</td>
<td><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2705.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--white_check_mark" style="height:23px;width:auto;vertical-align:middle" title="✅" alt="✅" /></td>
<td>—</td>
<td>18.6 t/s</td>
<td>投机在双卡下≈没开</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong><code>row</code> 为什么直接崩</strong>（源码里是硬性 <code>throw</code>）：</p>
<pre><code>E llama_model_load: error loading model: device ROCm0 does not support split buffers
</code></pre>
<p dir="auto">llama.cpp 的 <code>ROW</code> 模式要求后端提供 <code>ggml_backend_split_buffer_type</code> 这个接口 —— <strong>HIP/CUDA 后端没实现</strong>（只有 SYCL 和 Hexagon 有）。所以这不是配置问题，是<strong>后端实现缺口</strong>。</p>
<p dir="auto"><strong><code>tensor</code> 为什么「能跑但不值」</strong>：日志里明说了</p>
<pre><code>W internal AllReduce init failed (n_devices != 2?); falling back to meta-backend butterfly
W set_sampler: backend sampling not supported with SPLIT_MODE_TENSOR; using CPU
</code></pre>
<p dir="auto"><strong>快速 AllReduce 初始化失败，退化成了软件 butterfly</strong> —— 而它依赖的正是 peer access（P2P）。<strong>没有 P2P，tensor 模式注定退化。</strong> 再加上带投机解码会直接断言崩溃（<code>GGML_ASSERT(... GGML_BACKEND_SPLIT_AXIS_1) failed</code>），实际是负收益。</p>
<h3>5.5 闭环：为什么「双卡只能层拆分」是必然的</h3>
<pre><code>X99 根桥不在 Linux pci_p2pdma 白名单
        ↓
P2P 永远不可用
        ↓
├─ vLLM / SGLang TP2   → RCCL 用不上 P2P → 14.1 t/s 天花板
├─ llama.cpp `row`     → 后端没实现（另一条独立死因）
└─ llama.cpp `tensor`  → AllReduce 退化 → 只 +19%，还不兼容投机
        ↓
唯一能完整跑通的 = `layer`（串行流水线，不依赖 P2P）
        ↓
但 layer 不提速，只加显存
</code></pre>
<p dir="auto"><strong>「双卡并行」这件事，在这块平台上是被物理封死的，不是没调好参数。</strong></p>
<hr />
<h2>六、速度总账</h2>
<p dir="auto"><img src="https://upload.lcz.me/uploads/6e7939e7-3f05-4639-9e5b-a5c73e876de7.jpeg" alt="d6abfd3a-d115-4736-8c5e-d19b463d0508-image.jpeg" class=" img-fluid img-markdown" /><br />
(fig5.png)</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th>decode</th>
<th>上下文</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>gemma-4-26B-A4B 单卡 · 写代码</td>
<td><strong>100.4 t/s</strong></td>
<td>256K</td>
<td>MoE 26B/激活 4B</td>
</tr>
<tr>
<td>gemma-4-26B-A4B 单卡 · 写文章</td>
<td><strong>83.9 t/s</strong></td>
<td>256K</td>
<td></td>
</tr>
<tr>
<td>Qwen3.8-27B Q6 单卡 · 写代码</td>
<td>35.1 t/s</td>
<td>128K</td>
<td>稠密 27B</td>
</tr>
<tr>
<td>Qwen3.8-27B Q6 单卡 · 写文章</td>
<td>21.7 t/s</td>
<td>128K</td>
<td></td>
</tr>
<tr>
<td>Qwen3.8-27B Q6 <strong>双卡 tensor</strong></td>
<td>20.0 t/s</td>
<td>128K</td>
<td>不兼容投机</td>
</tr>
<tr>
<td>Qwen3.8-27B Q6 <strong>双卡层拆分 · 关投机</strong></td>
<td>18.6 t/s</td>
<td>256K</td>
<td></td>
</tr>
<tr>
<td>Qwen3.8-27B Q6 <strong>双卡层拆分</strong></td>
<td><strong>18.4 t/s</strong></td>
<td>256K</td>
<td></td>
</tr>
<tr>
<td>Qwen3.8-27B Q6 单卡（同档对照）</td>
<td>17.3 t/s</td>
<td>256K</td>
<td>KV 降 q4_0 贴边</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>关键读法：</strong></p>
<ul>
<li><strong>双卡层拆分 18.4 vs 单卡 17.3 —— 双卡连 1 帧都没快，反而略慢。</strong> 层拆分是串行流水线，单请求延迟 = 两卡耗时之和。</li>
<li><strong>搬卡前后完全一致</strong>（18.4/18.9/16.2/12.7）⇒ <strong>卡间通信从来不是瓶颈</strong>，这条实验直接证明了 5.1 的结论：P2P 通不通，对层拆分毫无影响。</li>
<li><strong>真正拉开差距的是模型选择</strong>：MoE 26B（激活 4B）比稠密 27B 快 <strong>4 倍</strong> —— 换模型比加卡有效得多。</li>
</ul>
<hr />
<h2>七、两个附带发现（都实打实能提速）</h2>
<h3>7.1 投机解码（MTP）的收益完全取决于<strong>内容</strong></h3>
<p dir="auto"><img src="https://upload.lcz.me/uploads/5cea889b-2e78-4139-94e1-26d6c8ed8198.jpeg" alt="29062bd8-7e62-40d8-b304-db56ed7e7380-image.jpeg" class=" img-fluid img-markdown" /><br />
(fig6.png)</p>
<p dir="auto">同样的模型、同样的量化、同样的上下文，<strong>只换任务类型</strong>：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>任务</th>
<th>MTP 接受率</th>
<th>平均接受长度</th>
<th>decode</th>
</tr>
</thead>
<tbody>
<tr>
<td>写代码（Python 函数）</td>
<td><strong>49.5%</strong></td>
<td>2.49</td>
<td><strong>35.1 t/s</strong></td>
</tr>
<tr>
<td>写文章（科普散文）</td>
<td>15.6%</td>
<td>1.48</td>
<td>21.7 t/s</td>
</tr>
<tr>
<td>（双卡层拆分下）</td>
<td>13.5%</td>
<td>1.40</td>
<td>18.4 t/s</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>差 62%。</strong> 代码 / JSON / tool-calling 这类结构化输出可预测性高，投机大赚；自由创作每个 token 都是选择，草稿基本对不上，等于白干。</p>
<blockquote>
<p dir="auto"><strong>口径</strong>：接受率 = llama.cpp 日志里的 <code>draft acceptance</code>（<code>draft_n_accepted / draft_n</code>），<code>--spec-draft-n-max 3</code>、<code>p-min 0</code>。<br />
<strong>给后来人的提醒</strong>：看到别人贴「MTP 3 倍提速」时，先问一句<strong>他跑的是什么内容</strong>。</p>
</blockquote>
<h3>7.2 一个被白白浪费的性能：FlashAttention 量化核没编进去</h3>
<p dir="auto">启动日志里有这么一行（很容易被刷过去）：</p>
<pre><code>W ggml_cuda_flash_attn_ext_vec: no FlashAttention vector kernel compiled
  for K/V types q8_0-q4_0, converting K and V to f16 instead (slow).
  Add "q8_0-q4_0" to GGML_CUDA_FA_QUANTS to compile it.
</code></pre>
<p dir="auto">llama.cpp 默认只编了 4 组 FA 组合：<code>q4_0-q4_0; q8_0-q8_0; f16-f16; bf16-bf16</code>。<br />
而我们常用的省显存组合 <strong><code>-ctk q8_0 -ctv q4_0</code> 不在里面</strong> → <strong>每次注意力都把 K/V 转成 f16</strong>，一直在走慢路径。</p>
<p dir="auto">补一个组合、增量重编译（只重编 FA 模板实例 + 重链接，<strong>4.5 分钟</strong>）：</p>
<pre><code class="language-bash">cmake -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=gfx1201 -DCMAKE_BUILD_TYPE=Release \
  -DGGML_CUDA_FA_QUANTS="q4_0-q4_0;q8_0-q8_0;q8_0-q4_0;f16-f16;bf16-bf16"
</code></pre>
<p dir="auto">实测（同 benchmark，两次复测取一致值）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>场景</th>
<th>重编译前</th>
<th>重编译后</th>
<th>变化</th>
</tr>
</thead>
<tbody>
<tr>
<td>7K 写文章</td>
<td>84.2</td>
<td>83.9</td>
<td>持平</td>
</tr>
<tr>
<td><strong>15K 写代码</strong></td>
<td>91.9</td>
<td><strong>100.4</strong></td>
<td><strong>+9.2%</strong></td>
</tr>
<tr>
<td><strong>46K 写文章</strong></td>
<td>52.5</td>
<td><strong>54.4</strong></td>
<td><strong>+3.6%</strong></td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>真实但温和（+4~9%），短上下文中性</strong> —— 因为 decode 是权重带宽活，注意力只占一小部分；上下文越长、注意力占比越高，收益才越明显。<strong>单卡就受益、不依赖 P2P、无副作用，白捡的。</strong></p>
<blockquote>
<p dir="auto">增量重编译的小知识：<strong>运行中的进程持有旧 inode，重链接不会影响它</strong>（但要生效得重启服务）。</p>
</blockquote>
<hr />
<h2>八、最终形态：双卡双实例</h2>
<p dir="auto">既然「并行」被物理封死，那双卡的正确用法就只剩一个 —— <strong>各跑各的</strong>：</p>
<pre><code>卡A（下层，散热好）→ Qwen3.8-27B Q6  @128K  → 端口 8081   ← 编程 / 严谨推理
卡B（上层，散热差）→ gemma-4-26B-A4B @256K  → 端口 8080   ← 日常 / 轻任务
</code></pre>
<p dir="auto"><strong>两个 systemd 服务常驻，并且：</strong></p>
<ul>
<li><strong>错峰启动</strong>：第二个实例延迟 30 秒起（避免两卡同时从空闲转满载 —— 那正是当初跳闸的瞬间）</li>
<li><strong>互相依赖</strong>：<code>After=</code> 保证限频服务先生效</li>
<li><strong>各自独立</strong>：任一服务重启/换模型，另一个不受影响</li>
</ul>
<p dir="auto"><strong>好处</strong>：零通信开销、互不拖累、总吞吐直接翻倍。客户端想用哪个就连哪个端口，也可以配成两个模型档位随手切。</p>
<hr />
<h2>九、给后来人的建议清单</h2>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4b0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--moneybag" style="height:23px;width:auto;vertical-align:middle" title="💰" alt="💰" /> 买之前</h3>
<ul>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>先算供电账，但别只算总瓦数</strong>：这台 1300W 电源带双卡稳态只有 ~400W（利用率 30%），照样跳闸。<strong>看的是单路 12V 的瞬态承载能力</strong>，不是铭牌总功率。</li>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>查平台有没有 P2P 能力</strong>（想跑多卡并行/TP 的话）：<code>lspci -s 00:00.0 -nn</code> 拿根桥 ID，对照 Linux <code>drivers/pci/p2pdma.c</code> 的白名单。<strong>X99/C612（Broadwell-EP，<code>8086:6f00</code>）不在里面。</strong></li>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>别信「老平台没有 REBAR」这个说法</strong>：X99 开 BIOS 的 Above 4G 之后，32G 卡能拿到完整的 32GB BAR。</li>
<li><div class="plugin-markdown"><input type="checkbox" />想要「多卡一个模型真提速」的平台取向：</div><strong>AMD 单路（TRX40/EPYC）或 Xeon Scalable（C621）</strong> —— root complex 支持端口间 P2P 且在白名单里。</li>
</ul>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f527.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--wrench" style="height:23px;width:auto;vertical-align:middle" title="🔧" alt="🔧" /> 装机时</h3>
<ul>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>BIOS 打开 <code>Memory Mapped I/O above 4GB</code></strong>（大显存卡的硬前提）。</li>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>散热条件好的槽位留给持续重载的卡</strong>（下层/进风顺畅的那个）。实测差 10°C。</li>
<li><div class="plugin-markdown"><input type="checkbox" />侧记：</div><strong>关 BIOS 虚拟化 / 关 IOMMU 对 P2P 没有任何帮助</strong>（如果你的 cmdline 里本来就有 <code>iommu=off</code>，改了等于没改）。</li>
</ul>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a1.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--zap" style="height:23px;width:auto;vertical-align:middle" title="⚡" alt="⚡" /> 遇到「一满载就断电」</h3>
<ul>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>先做单卡 × 模型的全排列对照</strong>，每档 ≥90 秒 —— 这一步直接把「总功率」和「瞬时尖峰」区分开。</li>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>降 <code>power1_cap</code> 没用就别再降了</strong>：它管平均功耗，管不住微秒尖峰。</li>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>正解是 <code>pp_od_clk_voltage</code> 限频 + 降压</strong>（不是换电源）：<br />
<code>SCLK -500MHz</code> + <code>VDDGFX -100mV</code> → 平均功耗 -29%、decode 仅 -2%、双卡 400W 稳。</li>
<li><div class="plugin-markdown"><input type="checkbox" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ </div><strong>别用 <code>pp_dpm_sclk</code> 的档位写法</strong>（静默无效）。</li>
<li><div class="plugin-markdown"><input type="checkbox" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ </div><strong>开机自动应用必须带「读回校验 + 重试」</strong>，否则会只配到一张卡。</li>
<li><div class="plugin-markdown"><input type="checkbox" /><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--warning" style="height:23px;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ </div><strong>采样数据要落盘到家目录</strong>，写 <code>/tmp</code> 会在跳闸重启后丢光。</li>
</ul>
<h3><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f680.png?v=0650a1064dd" class="not-responsive emoji emoji-android emoji--rocket" style="height:23px;width:auto;vertical-align:middle" title="🚀" alt="🚀" /> 调优时</h3>
<ul>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>先确认 FA 量化核齐不齐</strong>：<code>grep -i 'FlashAttention vector kernel' 日志</code> —— 有这行 warning 就是在走 f16 慢路径，补编对应组合。</li>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>投机解码必须按「内容」看收益</strong>：代码/JSON 大赚（接受率 ~50%），自由创作基本白干（~15%）。</li>
<li><div class="plugin-markdown"><input type="checkbox" /></div><strong>优先换模型，而不是加卡</strong>：MoE（激活参数少）比同体积稠密快 4 倍。</li>
<li><div class="plugin-markdown"><input type="checkbox" />多卡只跑一个模型时：</div><strong>层拆分只换容量不提速</strong>；<code>row</code>/<code>tensor</code> 在 ROCm 上要么不支持、要么退化。</li>
</ul>
<hr />
<h2>十、当前状态与下一步</h2>
<p dir="auto"><strong>现状</strong>：双卡双实例稳定运行（400W / 65°C 峰值），供电问题彻底解决，两个模型随取随用。</p>
<p dir="auto"><strong>还没做 / 想做的</strong>：</p>
<ul>
<li><strong>给服务加 <code>--api-key</code></strong>：现在两个端点是无鉴权的，放公网或公司内网同网段都不安全。</li>
<li><strong>异地部署的两个保命项</strong>：这机器<strong>没有 BMC/IPMI</strong>，搬去异地前必须配 ① 智能插座（远程硬断电重启）② BIOS <code>AC Power Recovery = On</code>（断电恢复自动开机）。只靠 systemd 自启只能救服务崩，救不了机器没起来。</li>
<li><strong><code>tensor</code> 模式待验证的部分</strong>：它的 AllReduce 退化是不是<strong>必然</strong>由 P2P 缺失导致，我只观测到相关性 —— 属于<strong>推测，待验证</strong>。有 P2P 平台的朋友可以对照测一下，欢迎补充。</li>
</ul>
<hr />
<blockquote>
<p dir="auto"><strong>数据口径汇总</strong>（避免争论）：</p>
<ul>
<li><strong>功耗</strong>：<code>power1_average</code> sysfs，0.15~15s 采样，落盘；<code>power1_cap</code> 经 sysfs 写入并回读校验。</li>
<li><strong>速度</strong>：llama.cpp server 自带 <code>timings.predicted_per_second</code>（纯 decode，不含 prefill）；<code>--parallel 1</code> 单流；固定填充 prompt + 任务指令；<code>max_tokens</code> 600（写作）/1500（压力测试）；<code>temperature</code> 0.3~0.7；<code>stream=false</code>。</li>
<li><strong>投机解码</strong>：<code>--spec-type draft-mtp</code>、<code>--spec-draft-n-max 3</code>、<code>--spec-draft-p-min 0</code>；接受率取 llama.cpp 日志 <code>draft acceptance</code>。</li>
<li><strong>上下文</strong>：文中标注 128K / 256K 均为 <code>--ctx-size</code> 实际值（<code>n_ctx</code>，单槽）。</li>
<li>所有功耗/温度数据均为<strong>实采</strong>，非推算。</li>
</ul>
</blockquote>
]]></description><link>https://lcz.me/topic/1685</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 22:47:10 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1685.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 13 Sep 2026 16:22:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Mon, 14 Sep 2026 04:59:52 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/xiaote" aria-label="Profile: Xiaote">@<bdi>Xiaote</bdi></a> <a href="/post/18010">说</a>:</p>
<p dir="auto">PCIe 交换机确实能改写拓扑，但对 P2P 不一定有用。</p>
<p dir="auto">关键是交换机要支持跨端口的 peer-to-peer DMA 直通。很多消费级 PLX/PEX 拆分卡只做端口扩展，帧仍然上行到 host 再转发，等于绕不开根桥，<code>hipDeviceCanAccessPeer()</code> 和实际带宽都上不去。企业级 Broadcom PEX / ATLAS 支持 NT 和真 P2P，但价格、功耗都上台阶，而且常见只到 PCIe 3.0/4.0。</p>
<p dir="auto">买之前确认两件事：数据手册里有没有 peer-to-peer / NT 支持；能不能实机用 rccl-tests 或 hipMemcpyPeer 测到 ≥10GB/s，而不是只听卖家说支持。</p>
<p dir="auto">X99 这代，把预算放在已经跑通的「双卡双实例」上，大概率比赌交换机更稳。</p>
</blockquote>
<p dir="auto">真的没有勇士来试试交换机吗？</p>
]]></description><link>https://lcz.me/post/18018</link><guid isPermaLink="true">https://lcz.me/post/18018</guid><dc:creator><![CDATA[张光璞]]></dc:creator><pubDate>Mon, 14 Sep 2026 04:59:52 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Mon, 14 Sep 2026 04:02:53 GMT]]></title><description><![CDATA[<p dir="auto">PCIe 交换机确实能改写拓扑，但对 P2P 不一定有用。</p>
<p dir="auto">关键是交换机要支持跨端口的 peer-to-peer DMA 直通。很多消费级 PLX/PEX 拆分卡只做端口扩展，帧仍然上行到 host 再转发，等于绕不开根桥，<code>hipDeviceCanAccessPeer()</code> 和实际带宽都上不去。企业级 Broadcom PEX / ATLAS 支持 NT 和真 P2P，但价格、功耗都上台阶，而且常见只到 PCIe 3.0/4.0。</p>
<p dir="auto">买之前确认两件事：数据手册里有没有 peer-to-peer / NT 支持；能不能实机用 rccl-tests 或 hipMemcpyPeer 测到 ≥10GB/s，而不是只听卖家说支持。</p>
<p dir="auto">X99 这代，把预算放在已经跑通的「双卡双实例」上，大概率比赌交换机更稳。</p>
]]></description><link>https://lcz.me/post/18010</link><guid isPermaLink="true">https://lcz.me/post/18010</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Mon, 14 Sep 2026 04:02:53 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Mon, 14 Sep 2026 02:16:44 GMT]]></title><description><![CDATA[<p dir="auto">PCIE 交换机才是我的最终归宿</p>
]]></description><link>https://lcz.me/post/17987</link><guid isPermaLink="true">https://lcz.me/post/17987</guid><dc:creator><![CDATA[张光璞]]></dc:creator><pubDate>Mon, 14 Sep 2026 02:16:44 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 22:02:47 GMT]]></title><description><![CDATA[<p dir="auto">别人能跑双卡 TP，多半不是平台比 X99 强，而是他们那条路径上的 bridge 正好在 <code>pci_p2pdma</code> 白名单里。amdgpu 判的是 host bridge 的 PCI ID，同一代 X99 不同板子/芯片组出来的根桥 ID 不同，结果就可能一个能 P2P 一个不能；带 PLX 交换芯片的板子又是另一条路径。淘宝说的「支持 P2P」不能当依据，很多时候只是能同时认到两张卡。</p>
<p dir="auto">唯一靠谱的确认方式是实打带宽：两卡都可见（HIP_VISIBLE_DEVICES=0,1），跑 rccl-tests 的 all_reduce_perf，或直接 hipMemcpyPeer，看能不能稳定到 10GB/s 量级；掉到 1-2GB/s 就是 host bounce，TP 会慢到不如双实例。别为这一个问题专门买板子，能借就先借来实测。</p>
<p dir="auto">单路 X99 AD3/4 如果根桥还是 8086:6f00/6f01 这一家族，大概率同样不在白名单，换主板不一定解决。真想多卡跑大模型，把预算放到原生支持 P2P 的 EPYC/TR 平台或双机，比在 X99 上赌 P2P 稳。</p>
]]></description><link>https://lcz.me/post/17950</link><guid isPermaLink="true">https://lcz.me/post/17950</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 13 Sep 2026 22:02:47 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 20:17:28 GMT]]></title><description><![CDATA[<p dir="auto">那论坛里那几个人 是怎么跑的双卡TP？<a href="https://lcz.me/topic/1670">https://lcz.me/topic/1670</a></p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/c0f55ba5-db01-4be9-ba28-5b8dcc6b97a3.jpeg" alt="cf49c289-eaee-4b68-91c3-552fdecc108a-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">淘宝也说支持P2P</p>
]]></description><link>https://lcz.me/post/17940</link><guid isPermaLink="true">https://lcz.me/post/17940</guid><dc:creator><![CDATA[Geekyang]]></dc:creator><pubDate>Sun, 13 Sep 2026 20:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 19:16:35 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iamvirus" aria-label="Profile: iamvirus">@<bdi>iamvirus</bdi></a> <a href="/post/17920">说</a>:</p>
<p dir="auto">通过 QEMU 模拟共享 PCIe 交换机都能解决P2P的问题，你这个再接再厉！不是硬件限制 或者换个E5 V3就在白名单里面了，估计就没后面的事情了，而且代价也低，几十块钱的事情<br />
我觉得x99平台可能只有物理pcie交换机这条路了</p>
</blockquote>
]]></description><link>https://lcz.me/post/17939</link><guid isPermaLink="true">https://lcz.me/post/17939</guid><dc:creator><![CDATA[张光璞]]></dc:creator><pubDate>Sun, 13 Sep 2026 19:16:35 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 19:03:32 GMT]]></title><description><![CDATA[<p dir="auto">P2P 定位到 pci_p2pdma 白名单这一层是对的：根桥 8086:6f00 不在表里，amdgpu 初始化时就判决不支持；ACS、IOMMU、REBAR 都被干净排除，这个排查很扎实。</p>
<p dir="auto">补两句：</p>
<ul>
<li>换 E5 v3 不一定能进白名单。这张表是按 host bridge 的 PCI ID 判定的，判的是根桥而不是 CPU 型号，X99 两代根桥默认都不在主线表里。最直接还是打内核补丁把 0x6f00 加进去（你引的旁证也是这么干的），但要接受非上游代码在长跑下的稳定性风险。</li>
<li>QEMU 模拟共享交换机能改变 guest 看到的拓扑，可能让 hipDeviceCanAccessPeer() 返回 1，但真实 TLP 仍由物理根桥路由；X99 若不做 P2P 路由，要么直接失败，要么退回 host bounce，带宽反而更差。要验证就实打实测 P2P 带宽（rccl-tests 或 hipMemcpyPeer，看能不能到 10GB/s 量级），别只看返回值。</li>
</ul>
<p dir="auto">最终形态选双卡双实例是对的。还能再省一点：两个实例分别用 HIP_VISIBLE_DEVICES 隔离，并用 numactl --cpunodebind=N --membind=N 把各自服务钉在对应 CPU 的 NUMA 节点上，PLE/专家卸载就不会跨 socket 吃延迟。</p>
]]></description><link>https://lcz.me/post/17935</link><guid isPermaLink="true">https://lcz.me/post/17935</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 13 Sep 2026 19:03:32 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 17:36:18 GMT]]></title><description><![CDATA[<p dir="auto">非常好的分享，帮助其他人踩坑了。</p>
]]></description><link>https://lcz.me/post/17923</link><guid isPermaLink="true">https://lcz.me/post/17923</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 13 Sep 2026 17:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 17:05:47 GMT]]></title><description><![CDATA[<p dir="auto">P2P就是GPU DMA通信。</p>
]]></description><link>https://lcz.me/post/17921</link><guid isPermaLink="true">https://lcz.me/post/17921</guid><dc:creator><![CDATA[iamvirus]]></dc:creator><pubDate>Sun, 13 Sep 2026 17:05:47 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 17:20:53 GMT]]></title><description><![CDATA[<p dir="auto">通过 QEMU 模拟共享 PCIe 交换机都能解决P2P的问题，你这个再接再厉！不是硬件限制 或者换个E5 V3就在白名单里面了，估计就没后面的事情了，而且代价也低，几十块钱的事情</p>
]]></description><link>https://lcz.me/post/17920</link><guid isPermaLink="true">https://lcz.me/post/17920</guid><dc:creator><![CDATA[iamvirus]]></dc:creator><pubDate>Sun, 13 Sep 2026 17:20:53 GMT</pubDate></item><item><title><![CDATA[Reply to # X99 洋垃圾 + 双 R9700 续篇：限频降压救活双卡供电，P2P/TP 却全线阵亡 —— 最终形态是「双卡双实例」 on Sun, 13 Sep 2026 16:30:34 GMT]]></title><description><![CDATA[<p dir="auto">今天刚强度折腾了一天，梁圣收费11元。  梁文谷依旧无敌！</p>
]]></description><link>https://lcz.me/post/17918</link><guid isPermaLink="true">https://lcz.me/post/17918</guid><dc:creator><![CDATA[张光璞]]></dc:creator><pubDate>Sun, 13 Sep 2026 16:30:34 GMT</pubDate></item></channel></rss>