Linux/ROCmでのComfyUIにはバグがある(対処方法あり)

事象

Linux+AMD GPU上で ComfyUI を使っていると以下のようなエラーでセグフォする。

Page not present or supervisor privilege. という言葉が穏やかではない。

Memory access fault by GPU node-1 (Agent handle: 0x3f18fe70) on address 0x7f925bdff000. Reason: Page not present or supervisor privilege.
Failed to write segment data to pipe: Broken pipe
GPU coredump: handler exited with error (status: 1)
GPU core dump failed

(付記)インストール内容

ComfyUIのコミット b7d7cc1d496afe3c82279eec74c4d47399aab8ea で確認している。

インストールには uv を使用した。

uv venv --python 3.13 --seed
uv pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/
uv pip install -r requirements.txt
uv pip install -r manager_requirements.txt

回避方法

おそらくROCm7.2あたりで解消すると思われる。上流で修正されるまでの間は以下の2つを両方とも行うことで回避できる。

1. カーネルパラメータ

カーネルパラメータに amdgpu.cwsr_enable=0 をつける。GRUBであれば /etc/default/grub に追記して grub-mkconfig でコンフィグを再生成すればよい。再起動して反映させる。

2. ComfyUIのオプション

ComfyUIの起動引数に --disable-smart-memory をつける。

uv run main.py --enable-manager --disable-smart-memory

参考