8-Hour Debug of ComfyUI Black Images Uncovers PyTorch FP16 Overflow Bug
rtsitola · reddit · 2026-08-01
A developer spent 8 hours debugging pure black image outputs and NaN errors in ComfyUI on a Quadro RTX 6000, uncovering three independent issues and providing a complete fix.
Core Issues & Fixes:
- PyTorch FP16 Overflow Bug: The main culprit. torch.mm() in FP16 overflows to infinity when input values exceed 44, affecting both Turing and Ampere GPUs. The fix is changing .half() to .bfloat16().
- Turing Startup Crash: ComfyUI may crash with cudaMallocAsync != native on Turing GPUs. Fix by setting the environment variable PYTORCHCUDAALLOCCONF=backend:cudaMallocAsync.
- VRAM Hardware Defect: If issues persist, the GPU might have physical VRAM damage (e.g., ECC errors).
The author open-sourced a GitHub repo with diagnostic scripts and launchers. The included NaN trap accurately pinpoints the exact ComfyUI module triggering the error.
More from Infra
- DeepSeek's Claimed 83.4% Ascend 950DT Margin Debunked: Losing ¥36.6/Hour at 60% Utilization — teortaxesTex · 2026-12-02
- One number = +27%: raising MLX's 20-op CUDA graph cap on DGX Spark boosts Qwen3 to 430 tok/s — AIFlow_ML · 2026-12-02
- Polymarket: Jensen Huang admits under oath Nvidia AI chips were diverted to China — Polymarket · 2026-12-02
- China pours billions into optical chips for AI data centers despite US curbs threat — pstAsiatech · 2026-12-02
- 2.5-bit quantization runs a 35B MoE with 1M context in ~13.4 GiB on a 16GB MacBook — MatMuloi9128 · 2026-12-02
- Air New Zealand to roll out free Starlink-powered inflight Wi-Fi starting 2027 — elonmusk · 2026-12-02