首页 » 随笔 » 正文

Torch not compiled with CUDA enabled报错

comfyui本就可以正常运行,在安装comfyui-mixlab-nodes插件时报错,提示

AssertionError: Torch not compiled with CUDA enabled

打开cmd进入到python中发现cuda居然没了,离了个大谱

前不久才配置了ChatGLM3的呢

下面是解决方案:

1、在显卡支持cuda的情况下,执行下面命令查看是否已安装cuda

nvcc --version

如果看到上面的结果,说明已经安装,且需要根据上面的版本执行PyTorch的安装

2、PyTorch安装

打开https://pytorch.org/get-started/locally/,看到如下界面:

根据自己的情况选择版本和安装方式,这里我选pip(网络稳定是前提),复制上面的命令进行安装

python.exe -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

有时候这个whl文件下载非常慢,此时可以用工具下载,然后执行pip install XXX.whl 来完成安装。

错误提示和警告可以忽略

网络没问题基本就没问题了

发表评论