lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.34k stars 812 forks source link

`--use-cpu` not work #2231

Open psydok opened 1 week ago

psydok commented 1 week ago

I tested from .github/workflow. Forge only runs on gpu. The values are hardcoded.

Run python -m coverage run --data-file=.coverage.server launch.py --skip-prepare-environment --skip-torch-cuda-test --test-server --do-not-download-clip --no-half --disable-opt-split-attention --use-cpu all --api-server-stop 2>&1 | tee output.txt &
Traceback (most recent call last):
  File "/home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/launch.py", line 54, in <module>
    main()
  File "/home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/launch.py", line 50, in main
    start()
  File "/home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/modules/launch_utils.py", line 549, in start
    import webui
  File "/home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/webui.py", line 21, in <module>
    initialize_forge()
  File "/home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/modules_forge/initialization.py", line 58, in initialize_forge
    from backend import memory_management
  File "/home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/backend/memory_management.py", line 133, in <module>
    total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
  File "/home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/backend/memory_management.py", line 100, in get_torch_device
    return torch.device(torch.cuda.current_device())
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/torch/cuda/__init__.py", line 778, in current_device
    _lazy_init()
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/torch/cuda/__init__.py", line 284, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Launching Web UI with arguments: --skip-prepare-environment --skip-torch-cuda-test --test-server --do-not-download-clip --no-half --disable-opt-split-attention --use-cpu all --api-server-stop --api --ckpt /home/runner/work/stable-diffusion-webui-forge/stable-diffusion-webui-forge/test/test_files/empty.pt --disable-nan-check
linuarM commented 3 days ago

can you try writing " --use-cpu SD GFPGAN BSRGAN ESRGAN SCUNet CodeFormer --all " instead of " --use-cpu "
also try this other code : --precision full --no-half --use-cpu SD GFPGAN BSRGAN ESRGAN SCUNet CodeFormer --all and did you ever installed xformers?

JMaatCode commented 3 days ago

use --always-cpu instead of -- use-cpu