Add section on NaN errors

ClashSAN
2023-07-01 04:22:42 -04:00
parent 9abe516850
commit 458847b587

@@ -3,7 +3,7 @@
- The installer creates a python virtual environment, so none of the installed modules will affect existing system installations of python.
- To use the system's python rather than creating a virtual environment, use custom parameter replacing `set VENV_DIR=-`.
- To reinstall from scratch, delete directories: `venv`, `repositories`.
- When starting the program for the first time, the path to python interpreter is displayed. If this is not the python you installed, you can specify full path in the `webui-user` script; see [Running with custom parameters](Run-with-Custom-Parameters).
- When starting the program for the first time, the path to python interpreter is displayed. If this is not the python you installed, you can specify full path in the `webui-user` script; see [Command-Line-Arguments-and-Settings#environment-variables](Command-Line-Arguments-and-Settings#environment-variables).
- If the desired version of Python is not in PATH, modify the line `set PYTHON=python` in `webui-user.bat` with the full path to the python executable.
- Example: `set PYTHON=B:\soft\Python310\python.exe`
- Installer requirements from `requirements_versions.txt`, which lists versions for modules specifically compatible with Python 3.10.6. If this doesn't work with other versions of Python, setting the custom parameter `set REQS_FILE=requirements.txt` may help.
@@ -11,13 +11,14 @@
# Low VRAM Video-cards
When running on video cards with a low amount of VRAM (<=4GB), out of memory errors may arise.
Various optimizations may be enabled through command line arguments, sacrificing some/a lot of speed in favor of using less VRAM:
- Use `--opt-sdp-attention` OR the optional dependency `--xformers` to cut the gpu memory usage down by half on many cards.
- If you have 4GB VRAM and want to make 512x512 (or maybe up to 640x640) images, use `--medvram`.
- If you have 4GB VRAM and want to make 512x512 images, but you get an out of memory error with `--medvram`, use `--lowvram --always-batch-cond-uncond` instead.
- If you have 4GB VRAM and want to make images larger than you can with `--medvram`, use `--lowvram`.
# Torch is not able to use GPU
This is one of the most frequently mentioned problems, but it's usually not a WebUI fault, there are many reasons for it.
- WebUI uses GPU by default, so if you don't have suitable hardware, you need to add `--use-cpu`.
- WebUI uses GPU by default, so if you don't have suitable hardware, you need to [run on CPU](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings#running-on-cpu).
- Make sure you configure the WebUI correctly, refer to the corresponding installation tutorial in the [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki).
- If you encounter this issue after some component updates, try undoing the most recent actions.
@@ -33,6 +34,20 @@ Video cards
Certain GPU video cards don't support half precision: a green or black screen may appear instead of the generated pictures. Use `--upcast-sampling`. This should stack with `--xformers` if you are using.
If still not fixed, use command line arguments `--precision full --no-half` at a significant increase in VRAM usage, which may require `--medvram`.
# A Tensor with all NaNs was produced in the vae
This is the same problem as the one from above, to verify, Use `--skip-nan-check`. With this on, if one of the images fail the rest of the pictures are displayed.
It is either a model cause - [resource](https://github.com/arenasys/stable-diffusion-webui-model-toolkit#clip)
Merge cause - [resource](https://github.com/Mikubill/sd-webui-controlnet/discussions/1214)
Or GPU related.
- NVIDIA 16XX and 10XX cards should be using --upcast-sampling and --xformers to run at equivalent speed. If issue is persisting, try running the vae in fp32 by adding `--no-half-vae` If this fails, you will have to fall back to running with `--no-half`, which would be the the slowest + using the most gpu memory.
- AMD cards that cannot run fp16 normally should be on `--upcast-sampling --opt-sub-quad-attention` / `--opt-split-attention-v1`. The fallback order should ideally be the same as the one above. Following that, if it continues to fail, AMD users may need to utilize some trick like "export HSA_OVERRIDE_GFX_VERSION=10.3.0" specific to their GPU. It would be ideal to do a thorough google search + all of github search to find the HSA_OVERRIDE_GFX_VERSION right for your specific GPU.
(These are word-of-mouth troubleshooting tips. Test with a fp32 4gb SD1 model)
# "CUDA error: no kernel image is available for execution on the device" after enabling xformers
Your installed xformers is incompatible with your GPU. If you use Python 3.10, have a Pascal or higher card and run on Windows, add `--reinstall-xformers --xformers` to your `COMMANDLINE_ARGS` to upgrade to a working version. Remove `--reinstall-xformers` after upgrading.