<?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[7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a><br />
可复现，三次都OOM了。但不是说XTX有多弱，实属甲沟炎踢到痔疮上了。<br />
动一个参数就能绕过去。</p>
<h1>7900 XTX 单卡 15 秒 OOM 复现与绕过报告</h1>
<blockquote>
<p dir="auto">测试时间：2026-11-08　测试机器：本机 2× RX 7900 XTX 24 GB（gfx1100）<br />
参考帖：<a href="https://lcz.me/topic/2867">https://lcz.me/topic/2867</a> 《六张卡跑同一个 MiniMax-H3 视频工作流，差多少？》<br />
说明：全部为单卡实测，未使用 TP2。</p>
</blockquote>
<hr />
<h2>一、结论摘要</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>待验证的说法</th>
<th>判定</th>
<th>依据</th>
</tr>
</thead>
<tbody>
<tr>
<td>7900 XTX 单卡 15 秒 OOM，5080 16 GB 能跑</td>
<td><strong>属实</strong></td>
<td>本机 3 次配置复现，均在约 105 s 失败</td>
</tr>
<tr>
<td>原因是「AMD ROCm 缺 comfy-aimdo 动态卸载」</td>
<td><strong>不成立</strong></td>
<td><code>comfy-aimdo 0.6.0</code> 在 7900 XTX 上成功初始化（有 ROCm 原生 .so）</td>
</tr>
<tr>
<td>24 GB 是「必须同时装下权重+激活」的硬门槛</td>
<td><strong>不成立</strong></td>
<td>OOM 时 PyTorch 侧仅占用 0.18–3.25 GiB，崩溃点在音频 VAE 编码</td>
</tr>
<tr>
<td><code>expandable_segments</code> 无效</td>
<td><strong>属实</strong></td>
<td>碎片不是主因（与原帖一致）</td>
</tr>
<tr>
<td>可通过配置/单点代码修改绕过</td>
<td><strong>成立</strong></td>
<td>分段编码补丁已使流程越过 OOM 点</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>一句话结论：这不是显存容量墙，而是「音频 VAE 一次性编码峰值」叠加「显存被权重铺满至 0 余量、且不为普通张量分配让路」的实现缺陷。</strong></p>
<hr />
<h2>二、测试条件</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>项目</th>
<th>设置</th>
</tr>
</thead>
<tbody>
<tr>
<td>模型</td>
<td><code>minimax_h3_ref2va_pruned_int8_convrot</code>（20.97 GB）</td>
</tr>
<tr>
<td>文本编码器</td>
<td><code>qwen3vl_32b_minimax_h3_int8_convrot</code>（原帖为 <code>nvfp4_awq</code>，本机无该文件）</td>
</tr>
<tr>
<td>视频 VAE</td>
<td><code>minimax_h3_video_vae_int8_convrot</code></td>
</tr>
<tr>
<td>音频 VAE</td>
<td><code>minimax_h3_audio_vae_fp32</code></td>
</tr>
<tr>
<td>分辨率</td>
<td>1344×768（ResolutionSelector 1.0 MP，16:9，multiple 32）</td>
</tr>
<tr>
<td>步数 / 采样器</td>
<td>8 步（<code>BasicScheduler</code> beta）</td>
</tr>
<tr>
<td>显存策略</td>
<td>按原帖 <code>--lowvram</code>；另做对照</td>
</tr>
<tr>
<td>时长</td>
<td>15 秒（<code>H3LVUnified.max_seconds=15 / target_seconds=15</code>）</td>
</tr>
<tr>
<td>服务</td>
<td>端口 8199，HIP_VISIBLE_DEVICES=0，ComfyUI <code>/mnt/ai/ComfyUI-AMD/ComfyUI</code></td>
</tr>
<tr>
<td>显存采样</td>
<td>直接读 <code>/sys/class/drm/card*/device/mem_info_vram_used</code>，100 ms 一次</td>
</tr>
</tbody>
</table>
<p dir="auto">工作流取自本机实际执行过的 API 快照（<code>queue_snapshot.json</code>），节点与参数与原帖一致。</p>
<hr />
<h2>三、复现数据</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>启动参数</th>
<th>结果</th>
<th>用时</th>
<th>显存峰值</th>
<th>失败位置</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><code>--lowvram</code>（动态 VRAM 默认开启）</td>
<td>OOM</td>
<td>107.64 s</td>
<td>22.49 GiB</td>
<td>音频 VAE 编码</td>
</tr>
<tr>
<td>2</td>
<td><code>--lowvram --reserve-vram 6</code></td>
<td>OOM</td>
<td>105.27 s</td>
<td>23.97 GiB</td>
<td>音频 VAE 编码</td>
</tr>
<tr>
<td>3</td>
<td><code>--lowvram --disable-dynamic-vram</code></td>
<td>OOM</td>
<td>105.14 s</td>
<td>23.86 GiB</td>
<td>音频 VAE 编码</td>
</tr>
<tr>
<td>4</td>
<td>动态 VRAM 开 + 文本编码器置 CPU</td>
<td>OOM</td>
<td>—</td>
<td>—</td>
<td>音频 VAE 编码（请求 10.76 GiB）</td>
</tr>
<tr>
<td>5</td>
<td>分段编码补丁（见第五节）</td>
<td><strong>不再中断</strong></td>
<td>超时 240 s 仍在跑</td>
<td>23.98 GiB</td>
<td>越过了原失败点</td>
</tr>
</tbody>
</table>
<p dir="auto">典型报错（第 2 次）：</p>
<pre><code>torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 3.07 GiB.
GPU 0 has a total capacity of 23.98 GiB of which 38.00 MiB is free.
Of the allocated memory 180.74 MiB is allocated by PyTorch
Warning: Ran out of memory when regular VAE encoding, retrying with tiled VAE encoding.
[ERROR] Exception during processing !!! ... Tried to allocate 490.00 MiB ... 64.00 MiB free
</code></pre>
<hr />
<h2>四、根因分析</h2>
<h3>4.1 OOM 不在视频 UNET 采样，而在音频 VAE 编码</h3>
<p dir="auto">调用栈固定为：</p>
<pre><code>comfy_extras/nodes_lt_audio.py:57   execute
comfy_extras/nodes_audio.py:93      t = vae.encode(waveform.movedim(1, -1))
comfy/sd.py:1473                    self.first_stage_model.encode(...)
comfy/ldm/minimax/audio_vae.py:438  x = self.pre_block(x.transpose(1, 2)).transpose(1, 2)
</code></pre>
<p dir="auto">即<strong>参考音频（音色参考）的 fp32 编码器</strong>里一个 conv1d 要一次性申请 3.07–10.76 GiB 连续显存。它与 20 GB 视频 UNET 是否放得下无关。</p>
<h3>4.2 三次尝试中，显存余量在编码前就已经是 0</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>配置</th>
<th>失败瞬间 PyTorch 记账</th>
<th>卡内其它占用</th>
<th>可用余量</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--lowvram</code></td>
<td>3.25 GiB</td>
<td>≈19.2 GiB（aimdo staged 权重）</td>
<td>0 B</td>
</tr>
<tr>
<td><code>--reserve-vram 6</code></td>
<td>0.18 GiB</td>
<td>≈23.8 GiB</td>
<td>38 MiB</td>
</tr>
<tr>
<td><code>--disable-dynamic-vram</code></td>
<td>少量</td>
<td>≈23.8 GiB</td>
<td>158 MiB</td>
</tr>
</tbody>
</table>
<p dir="auto"><code>--reserve-vram</code> 在 comfy-aimdo 0.6.0 的 ROCm 后端<strong>没有生效</strong>：保留量没有变成可用余量，峰值反而更高。这解释了为什么分段后连 274 MiB 的请求仍会失败。</p>
<h3>4.3 为什么 5080（16 GB）反而能跑</h3>
<ul>
<li>
<p dir="auto">5080 的原帖数据显示峰值<strong>恒定 15.2 GB</strong>，即被稳定压在预算内（NVIDIA 侧 aimdo/CUDA 的 evict 正常，分配压力能触发权重回收）；</p>
</li>
<li>
<p dir="auto">7900 XTX 峰值是 17.7 GB（5 s）→ 23.2 GB（10 s）→ 15 s 溢出，<strong>随音频时长上涨</strong>，说明 AMD 侧权重只进不出，编码器再要一块就必然失败。</p>
</li>
</ul>
<h3>4.4 原帖还有一处不可比因素</h3>
<p dir="auto">原帖文本编码器用的是 <code>qwen3vl_32b_minimax_h3_nvfp4_awq</code>。<strong>nvfp4 是 NVIDIA Blackwell 的 FP4 格式，ROCm 没有对应 kernel</strong>，在 AMD 上只能反量化运行，会同时放大显存占用和时间。因此「490 s vs 124 s」里混入了格式不兼容的开销，不能直接当作 A/N 硬件差距。</p>
<hr />
<h2>五、绕过方案与验证</h2>
<h3>5.1 已实施：音频分段编码（<code>nodes_audio.py</code>）</h3>
<p dir="auto">改动文件：[comfy_extras/nodes_audio.py](file:///mnt/ai/ComfyUI-AMD/ComfyUI/comfy_extras/nodes_audio.py)</p>
<ul>
<li>
<p dir="auto">新增 <code>_encode_audio_chunked()</code>（第 67–107 行），把第 93 行的单次 <code>vae.encode</code> 改为调用它；</p>
</li>
<li>
<p dir="auto">按 <code>H3_AUDIO_ENCODE_CHUNK</code>（默认 5 秒）切段，并对齐到 <code>hop_length=800</code>，保证每段 latent 完整；</p>
</li>
<li>
<p dir="auto">逐段编码后 <code>torch.cat(outs, dim=-1)</code> 沿时间维拼接（latent 形状 <code>[B, 32, 2, T]</code>）；</p>
</li>
<li>
<p dir="auto">某段在 GPU 仍 OOM 时，把音频 VAE 临时移 CPU 跑完再放回，日志打印 <code>audio VAE encode OOM at Xs, finishing on CPU</code>；</p>
</li>
<li>
<p dir="auto"><code>H3_AUDIO_ENCODE_CHUNK=0</code> 可完全关闭本补丁。</p>
</li>
</ul>
<p dir="auto">结果：原第 105 秒必崩的路径被越过，流程继续执行；首段仍有一次 274 MiB 的 OOM，随后由 CPU 兜底接管。</p>
<h3>5.2 已验证无效（不必再试）</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>手段</th>
<th>结果</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>PYTORCH_HIP_ALLOC_CONF=expandable_segments:True</code></td>
<td>无效，碎片非主因</td>
</tr>
<tr>
<td><code>--reserve-vram 6</code></td>
<td>无效，峰值反升</td>
</tr>
<tr>
<td><code>--disable-dynamic-vram</code>（旧路径）</td>
<td>无效，同样崩在音频编码</td>
</tr>
<tr>
<td>文本编码器置 CPU</td>
<td>减小不了音频编码峰值（请求涨到 10.76 GiB）</td>
</tr>
<tr>
<td>TP2 双卡</td>
<td>已按要求排除；且实测 5 s 仅 1.79× 加速，性价比低</td>
</tr>
</tbody>
</table>
<h3>5.3 待验证（按成功率排序）</h3>
<ol>
<li><strong><code>--novram</code></strong> <strong>+ 分段编码</strong>：强制最小显存常驻，把余量腾出来，可能让 15 秒全程跑在 GPU 上；</li>
<li><strong>给 aimdo 的 ROCm 后端补 reserve 水位</strong>：让 staging 上限 = 总显存 − 预留，从根上解决「铺满到 0」；</li>
<li><strong>喂 ≤8–10 秒参考音频</strong>，15 秒用两段串接（尾帧接首帧）生成，这是生产口径下最省事的做法；</li>
<li>换用本机已有的 <code>qwen3vl_32b_minimax_h3-w4a8_convrot</code> 文本编码器，压低常驻占用。</li>
</ol>
<hr />
<h2>六、对原帖数据的复核意见</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>原帖结论</th>
<th>复核</th>
</tr>
</thead>
<tbody>
<tr>
<td>5 s / 10 s 峰值 17.7 / 23.2 GB</td>
<td>与本次观测的「随时长上涨」一致，可信</td>
</tr>
<tr>
<td>15 s 单卡 OOM</td>
<td>已复现，属实</td>
</tr>
<tr>
<td>16 GB 能跑 / 24 GB 不能跑是「动态换页」差异</td>
<td>方向对，但机制描述不准：N 卡被压在预算内，A 卡是权重铺满+不回收</td>
</tr>
<tr>
<td>AMD 缺 comfy-aimdo</td>
<td>事实错误，0.6.0 有 <code>aimdo_rocm.so</code> 并能初始化</td>
</tr>
<tr>
<td>24 GB 是硬门槛</td>
<td>不成立，属实现缺陷，可绕过</td>
</tr>
<tr>
<td>TP2「通信开销大」</td>
<td>5 s 加速 1.79×，能耗代价仅 +3%，问题在单卡基线慢 5.57×</td>
</tr>
</tbody>
</table>
<hr />
<h2>七、附件与复现方式</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>文件</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>/tmp/h3bench/bench.py</code></td>
<td>无头跑批脚本：起服务、提交真实 prompt、100 ms 采样显存</td>
</tr>
<tr>
<td><code>/tmp/h3bench/results/server_*.log</code></td>
<td>各配置完整服务日志</td>
</tr>
<tr>
<td><code>/tmp/h3bench/results/summary_*.json</code></td>
<td>状态、耗时、显存峰值、OOM 摘要</td>
</tr>
<tr>
<td><code>/tmp/h3bench/results/vram_*.csv</code></td>
<td>显存时间序列</td>
</tr>
</tbody>
</table>
<p dir="auto">复现命令示例（单卡、原帖口径）：</p>
<pre><code class="language-bash">/home/jay/ComfyUI-AMD/venv/bin/python /tmp/h3bench/bench.py \
  --tag post_15s --seconds 15 --dynamic on \
  --server-args=--lowvram --steps 8 --megapixels 1.0 --timeout 1800
</code></pre>
]]></description><link>https://lcz.me/topic/2920</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 06:02:33 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/2920.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 08 Nov 2026 13:24:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Mon, 09 Nov 2026 03:44:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%E6%87%92%E4%BA%BA%E7%83%98%E5%9F%B9" aria-label="Profile: 懒人烘培">@<bdi>懒人烘培</bdi></a> 搓出来苏妈给你发OFFER<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60a.png?v=5be5614064c" class="not-responsive emoji emoji-android emoji--blush" style="height:1.4em;width:auto;vertical-align:middle" title=":blush:" alt="😊" /></p>
]]></description><link>https://lcz.me/post/32056</link><guid isPermaLink="true">https://lcz.me/post/32056</guid><dc:creator><![CDATA[xiongjie gao]]></dc:creator><pubDate>Mon, 09 Nov 2026 03:44:19 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Mon, 09 Nov 2026 03:03:18 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a> <a href="/post/31972">说</a>:</p>
<p dir="auto">这个你去验证了</p>
</blockquote>
<p dir="auto">周末忙乎家里事情，我测试看看</p>
]]></description><link>https://lcz.me/post/32027</link><guid isPermaLink="true">https://lcz.me/post/32027</guid><dc:creator><![CDATA[懒人烘培]]></dc:creator><pubDate>Mon, 09 Nov 2026 03:03:18 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Sun, 08 Nov 2026 16:44:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%E6%87%92%E4%BA%BA%E7%83%98%E5%9F%B9" aria-label="Profile: 懒人烘培">@<bdi>懒人烘培</bdi></a> 消失了？这个你去验证了<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=5be5614064c" class="not-responsive emoji emoji-android emoji--joy" style="height:1.4em;width:auto;vertical-align:middle" title="😂" alt="😂" /><br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/%E5%A4%A9%E7%9F%A5%E9%81%93" aria-label="Profile: 天知道">@<bdi>天知道</bdi></a> 你有空可以测试下发个帖子，其实只要是软件问题都有解。</p>
]]></description><link>https://lcz.me/post/31972</link><guid isPermaLink="true">https://lcz.me/post/31972</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 08 Nov 2026 16:44:38 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Sun, 08 Nov 2026 16:40:53 GMT]]></title><description><![CDATA[<p dir="auto">没跑过15秒，我跑过OOM的情况是10秒的动作迁移，因为要参考一个10秒的视频，频繁的OOM，最后用KJ的low vram attention和chunk feedforward节点分块解决的。如果硬要跑15秒，可以试试这两个节点。<br />
当然如果能从根本上解决这个问题就是大家福音了，期待有好消息。</p>
]]></description><link>https://lcz.me/post/31971</link><guid isPermaLink="true">https://lcz.me/post/31971</guid><dc:creator><![CDATA[天知道]]></dc:creator><pubDate>Sun, 08 Nov 2026 16:40:53 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Sun, 08 Nov 2026 15:04:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/xiongjie-gao" aria-label="Profile: xiongjie-gao">@<bdi>xiongjie-gao</bdi></a> 好吧，这个问题就让我来解决吧，我来重写！<img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=5be5614064c" class="not-responsive emoji emoji-android emoji--joy" style="height:1.4em;width:auto;vertical-align:middle" title="😂" alt="😂" /><br />
再这一方面AMD真特么是脑残，Intel更是。老黄吃肉是有道理的。</p>
]]></description><link>https://lcz.me/post/31966</link><guid isPermaLink="true">https://lcz.me/post/31966</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 08 Nov 2026 15:04:54 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Sun, 08 Nov 2026 15:04:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry" aria-label="Profile: terry">@<bdi>terry</bdi></a> 是驱动有残疾。N卡把缺页迁移的能力写到的驱动层面，这个是Rocm没想到的。<br />
所以，Aimdo可以在Rocm里加载，但没起到显存警戒线的作用。一次性音频编码的峰值最后点火把这个问题引爆。<br />
所以，怎么形容好呢？阿喀琉斯之踵？</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/2baf7473-fe83-43ca-8372-9d342a7b4147.jpeg" alt="image.jpeg" class="img-markdown  img-fluid" /></p>
]]></description><link>https://lcz.me/post/31964</link><guid isPermaLink="true">https://lcz.me/post/31964</guid><dc:creator><![CDATA[xiongjie gao]]></dc:creator><pubDate>Sun, 08 Nov 2026 15:04:05 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Sun, 08 Nov 2026 14:39:53 GMT]]></title><description><![CDATA[<p dir="auto">这个，AMD没办法像Nvidia那样流式进出？驱动问题？就是单卡能跑到理想水准吗？</p>
]]></description><link>https://lcz.me/post/31961</link><guid isPermaLink="true">https://lcz.me/post/31961</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Sun, 08 Nov 2026 14:39:53 GMT</pubDate></item><item><title><![CDATA[Reply to 7900 XTX 单卡 15 秒 OOM 复现与绕过报告，4080 16G能跑 XTX24G OOM！ on Sun, 08 Nov 2026 14:35:13 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/2b50.png?v=5be5614064c" class="not-responsive emoji emoji-android emoji--star" style="height:1.4em;width:auto;vertical-align:middle" title="⭐" alt="⭐" /> 版主审定：本帖设为<strong>精华</strong>，作者 <strong>+6 积分</strong>奖励，希望再接再厉！</p>
<blockquote>
<p dir="auto">奖励凭证：精华 +6 分 · 编号 f2920-3256-1</p>
</blockquote>
]]></description><link>https://lcz.me/post/31960</link><guid isPermaLink="true">https://lcz.me/post/31960</guid><dc:creator><![CDATA[Xiaote]]></dc:creator><pubDate>Sun, 08 Nov 2026 14:35:13 GMT</pubDate></item></channel></rss>