ComfyUI for ROCm安装流程参考这个

https://www.bilibili.com/opus/1038635087755739140
其中在运行install.bat时可能要挂梯来下PyTorch

问题描述

按照教程运行install.bat会这样,可以看到只识别到并安装了780m核显对应的GFX110X

====================================================
       comfyui-rocm - Automatic Installer
  [AMD GCN5/Vega * RDNA1 * RDNA2 * RDNA3 * RDNA4]
====================================================

[*] Python environment found. Skipping download.

[*] Detecting GPU...
[*] Detected GPU architecture: gfx110X
[*] Installing ROCm for RDNA3 (gfx110X)...
[*] Installing PyTorch for RDNA3 (gfx110X)...

[*] Installing comfyui-rocm...
[*] Installing extensions...
[*] Installing triton - sageattention(v1)
[*] Patching sage-attention...
[*] Installing bitsandbytes if available...
[*] Installing bitsandbytes (unified RDNA build)...
[*] Installing flash-attention (aiter triton backend)...

[*] Verifying installation...

PyTorch Version: 2.10.0+rocm7.13.0a20260506
ROCm Available: True
ROCm Version: 7.13.26176

====================================================
  Installation Complete
  Run "comfyui-user.bat" to start comfyui-rocm
====================================================

打开comfyui-user.bat也可以看到其中识别到了9060xt

...
Set: torch.backends.cudnn.enabled = False for better AMD performance.
AMD arch: gfx1200
ROCm version: (7, 13)
Set vram state to: NORMAL_VRAM
Disabling smart memory management
Device: cuda:0 AMD Radeon RX 9060 XT : native
Using async weight offloading with 2 streams
...

但在ComfyUI中运行工作流会出现报错,其中有一行为

...
torch.AcceleratorError: HIP error: device kernel image is invalid
...

其实就是没安装显卡支持的版本

问题检查

在comfyui-rocm的文件夹中右键“在终端中打开”运行

python_env\python.exe -c "import torch; print(torch.cuda.get_arch_list())"

会出现类似下方的信息,可以看到当前支持的构架,不包含RX9060xt的gfx1200

['gfx1100', 'gfx1101', 'gfx1102', 'gfx1103']

问题解决

解决方法很简单,记事本编辑install.bat,查找“gfx120X”可以看到

if "!arch!"=="gfx120X" (
    echo [*] Installing ROCm for RDNA4 ^(gfx120X^)...
    .\python_env\python.exe -m pip install rocm[devel,libraries] --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/ --no-warn-script-location %Q%
    if errorlevel 1 goto :install_failed
    .\python_env\scripts\rocm-sdk init %Q%
    if errorlevel 1 (
        echo [!] Warning: rocm-sdk init failed, continuing anyway...
    )
	echo [*] Installing PyTorch for RDNA4 ^(gfx120X^)...
    .\python_env\python.exe -m pip install --pre --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/ torch torchaudio torchvision --no-warn-script-location %Q%
    if errorlevel 1 goto :install_failed
    goto :install_requirements
)

可以看到其实有gfx120X的支持,我们手动安装
还是在comfyui-rocm的文件夹中右键“在终端中打开”运行
为防止其他问题先删除一下原来的

python_env\python.exe -m pip uninstall -y torch torchvision torchaudio

再安装gfx120X的支持

python_env\python.exe -m pip install --pre --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/ torch torchvision torchaudio

此处说明安装完成

Successfully installed torch-2.13.0a0+rocm7.13.0a20260416 torchaudio-2.11.0+rocm7.13.0a20260416 torchvision-0.27.0a0+rocm7.13.0a20260416

再运行

python_env\python.exe -c "import torch; print(torch.cuda.get_arch_list())"

就会出现

['gfx1200', 'gfx1201']

这样就应该能正常运行了


备注:编辑日期2026年5月10日
AMD驱动版本为最新26.5.1
HIP SDK版本为最新5.7.0

Logo

免费领 150 小时云算力,进群参与显卡、AI PC 幸运抽奖

更多推荐