科技 > 操作系统 > Windows

解决在Windows安装stable diffusion遇到“Torch is not able to use GPU”的问题

17人参与 2024-08-02 Windows

解决在windows安装stable diffusion遇到“torch is not able to use gpu”的问题

遇到的问题

在windows上安装stable diffusion的最后一步执行webui-user.bat时,提示了错误信息assertionerror: torch is not able to use gpu; add --skip-torch-cuda-test to commandline_args variable to disable this check

具体错误代码如下:

venv "c:\users\giray\stable-diffusion-webui\venv\scripts\python.exe"
python 3.10.6 (tags/v3.10.6:9c7b4bd, aug 1 2022, 21:53:49) [msc v.1932 64 bit (amd64)]
commit hash: 67d011b
traceback (most recent call last):
file "c:\users\giray\stable-diffusion-webui\launch.py", line 110, in
run_python("import torch; assert torch.cuda.is_available(), 'torch is not able to use gpu; add --skip-torch-cuda-test to commandline_args variable to disable this check'")
file "c:\users\giray\stable-diffusion-webui\launch.py", line 60, in run_python
return run(f'"{python}" -c "{code}"', desc, errdesc)
file "c:\users\giray\stable-diffusion-webui\launch.py", line 54, in run
raise runtimeerror(message)
runtimeerror: error running command.
command: "c:\users\giray\stable-diffusion-webui\venv\scripts\python.exe" -c "import torch; assert torch.cuda.is_available(), 'torch is not able to use gpu; add --skip-torch-cuda-test to commandline_args variable to disable this check'"
error code: 1
stdout:
stderr: traceback (most recent call last):
file "", line 1, in
assertionerror: torch is not able to use gpu; add --skip-torch-cuda-test to commandline_args variable to disable this check

解决方法

参考了github上的issue,需要修改webui-user.bat文件,具体更改如下:

保存修改之后再次运行webui-user.bat就可以了。如果这个解决方法还没解决问题,可以查看同个issue下的其它回答,或者能找到解决方法。

参考链接

  1. torch is not able to use gpu
  2. how to install stable diffusion on windows (automatic1111)
(0)

您想发表意见!!点此发布评论

推荐阅读

银河麒麟连接windows的共享文件夹

08-02

Windows中的Pagefile.sys是什么?是否应该删除它?

08-02

转录组上游-windows使用kallisto-从cleandata到表达矩阵

08-02

SVN客户端(Windows)——Tortoise SVN(中文版 )的下载及安装

08-02

【虚拟机】VMware虚拟机安装Windows 10系统 详细教程

08-02

win10重装之后无法使用Windows Hello人脸识别

08-02

猜你喜欢

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论