Stability-AI / stablediffusion

High-Resolution Image Synthesis with Latent Diffusion Models
MIT License
37.84k stars 4.88k forks source link

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

Open rafaelcdv-ofc opened 7 months ago

rafaelcdv-ofc commented 7 months ago

A week ago i have instaled SD and got this issue on my screen trying to launch Stable Diffusion, i thought it was hapenning because i didn't had any GPU on my PC. Then i bought one in a while, tried to open the application again but i have got the same issue. As it shows in the code, i could easily skip "cuda test" by creating a new variable to disable and surpass it. I did many times and by different forms, but the issue was still ongoing

File "D:\stable-diffusion\stable-diffusion-webui\launch.py", line 48, in <module>
    main()
File "D:\stable-diffusion\stable-diffusion-webui\launch.py", line 39, in main
    prepare_environment()
File "D:\stable-diffusion\stable-diffusion-webui\modules\launch_utils.py", line 356, in prepare_environment
    raise RuntimeError(
RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check`

I have reinstaled venv file and got a total of 0 results, same problem as well.

After creating the previous var to ignore the "cuda test" thing, i have then prefered to open "webui.bat" for testing, this one worked better because it interpreted the var i have created the right way, as it shows: Launching Web UI with arguments: --skip-torch-cuda-test But then..

File "D:\stable-diffusion\stable-diffusion-webui\launch.py", line 48, in <module>
    main()
  File "D:\stable-diffusion\stable-diffusion-webui\launch.py", line 44, in main
    start()
  File "D:\stable-diffusion\stable-diffusion-webui\modules\launch_utils.py", line 432, in start
    import webui
  File "D:\stable-diffusion\stable-diffusion-webui\webui.py", line 13, in <module>
    initialize.imports()
  File "D:\stable-diffusion\stable-diffusion-webui\modules\initialize.py", line 21, in imports
    import gradio  # noqa: F401
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\components\annotated_image.py", line 12, in <module>
    from gradio import utils
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 353, in <module>
    class AsyncRequest:
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 372, in AsyncRequest
    client = httpx.AsyncClient()
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\httpx\_client.py", line 1397, in __init__
    self._transport = self._init_transport(
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\httpx\_client.py", line 1445, in _init_transport
    return AsyncHTTPTransport(
  File "D:\stable-diffusion\stable-diffusion-webui\venv\lib\site-packages\httpx\_transports\default.py", line 275, in __init__
    self._pool = httpcore.AsyncConnectionPool(
TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options'`

I really don't know what to do now.

Brensom commented 7 months ago

I just struggled with these two problems for half a day and solved them. Just use this thing. Everything works there. https://github.com/AbdBarho/stable-diffusion-webui-docker