解决 RuntimeError: Torch is not able to use GPU; add –skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

安装stable-diffusion-webui时报错:
RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check,如何解决?

在 https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1742 处得到解决,记录:

in webui-user.sh line 8:

# Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
export COMMANDLINE_ARGS="--skip-torch-cuda-test"

然后继续:./webui.sh