Repository: stable-diffusion-webui
Issue: [Bug]: OSError: [WinError -1073741795] Windows Error 0xc000001d
Labels: bug-report

### Checklist

- [ ] The issue exists after disabling all extensions
- [ ] The issue exists on a clean installation of webui
- [X] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [X] The issue exists in the current version of the webui
- [X] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

If I try to Train or use anything else then text2img or img2img, I will get this Error Message no matter what. OSError: [WinError -1073741795] Windows Error 0xc000001d

### Steps to reproduce the problem

1) Install WebUI with the Dreambooth Extension.
2) Create your Model with Standard Settings.
3) Train your Model with Standard Settings.


### What should have happened?

WebUI should Train the Model

### What browsers do you use to access the UI ?

Google Chrome

### Sysinfo

[sysinfo-2024-05-06-17-49.json](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/15224532/sysinfo-2024-05-06-17-49.json)


### Console logs

```Shell
venv "C:\Users\Admin\Documents\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.9.3
Commit hash: 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
Installing requirements
If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth
Dreambooth revision: 45a12fe5950bf93205b6ef2b7511eb94052a241f
Checking xformers...
Checking bitsandbytes...
Checking bitsandbytes (ALL!)
Checking Dreambooth requirements...
Installed version of bitsandbytes: 0.43.0
[Dreambooth] bitsandbytes v0.43.0 is already installed.
Installed version of accelerate: 0.21.0
[Dreambooth] accelerate v0.21.0 is already installed.
Installed version of dadaptation: 3.2
[Dreambooth] dadaptation v3.2 is already installed.
Installed version of diffusers: 0.27.2
[Dreambooth] diffusers v0.25.0 is already installed.
Installed version of discord-webhook: 1.3.0
[Dreambooth] discord-webhook v1.3.0 is already installed.
Installed version of fastapi: 0.94.0
[Dreambooth] fastapi is already installed.
Installed version of gitpython: 3.1.32
[Dreambooth] gitpython v3.1.40 is not installed.
Successfully installed gitpython-3.1.43

Installed version of pytorch_optimizer: 2.12.0
[Dreambooth] pytorch_optimizer v2.12.0 is already installed.
Installed version of Pillow: 9.5.0
[Dreambooth] Pillow is already installed.
Installed version of tqdm: 4.66.2
[Dreambooth] tqdm is already installed.
Installed version of tomesd: 0.1.3
[Dreambooth] tomesd v0.1.2 is already installed.
Installed version of tensorboard: 2.13.0
[Dreambooth] tensorboard v2.13.0 is already installed.
[+] torch version 2.1.2+cu121 installed.
[+] torchvision version 0.16.2+cu121 installed.
[+] accelerate version 0.21.0 installed.
[+] diffusers version 0.27.2 installed.
[+] bitsandbytes version 0.43.0 installed.
[+] xformers version 0.0.23.post1 installed.
Launching Web UI with arguments: --xformers
[AddNet] Updating model hashes...
[AddNet] Updating model hashes...
Loading weights [6ce0161689] from C:\Users\Admin\Documents\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: C:\Users\Admin\Documents\stable-diffusion-webui\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 84.4s (prepare environment: 60.3s, import torch: 8.0s, import gradio: 1.5s, setup paths: 1.9s, initialize shared: 0.5s, other imports: 4.5s, list SD models: 0.4s, load scripts: 4.3s, create ui: 1.7s, gradio launch: 0.6s, add APIs: 0.3s).
Applying attention optimization: xformers... done.
Model loaded in 11.9s (load weights from disk: 0.9s, create model: 1.9s, apply weights to model: 7.8s, apply half(): 0.2s, move model to device: 0.1s, load textual inversion embeddings: 0.7s, calculate empty prompt: 0.2s).
Advanced elements visible: False
Extracting config from C:\Users\Admin\Documents\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\..\configs\v1-training-unfrozen.yaml
Extracting checkpoint from C:\Users\Admin\Documents\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Duration: 00:01:45
Advanced elements visible: True
Extracting config from C:\Users\Admin\Documents\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\..\configs\v1-training-unfrozen.yaml
Extracting checkpoint from C:\Users\Admin\Documents\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Duration: 00:01:29
Updating scheduler name to: DDIM
Initializing dreambooth training...
0 cached latents
Init dataset!
Preparing Dataset (With Caching)
Bucket 0 (512, 512, 0) - Instance Images: 30 | Class Images: 0 | Max Examples/batch: 30
Saving cache!
Total Buckets 1 - Instance Images: 30 | Class Images: 0 | Max Examples/batch: 30

Total images / batch: 30, total examples: 30
Initializing bucket counter!
WARNING:dreambooth.train_dreambooth:Wandb API key not set. Please set WANDB_API_KEY environment variable to use wandb.
Steps:   0%|                                                                                  | 0/3000 [00:00<?, ?it/s]Traceback (most recent call last):
  File "C:\Users\Admin\Documents\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 735, in start_training
    result = main(class_gen_method=class_gen_method)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 2003, in main
    return inner_loop()
  File "C:\Users\Admin\Documents\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\memory.py", line 126, in decorator
    return function(batch_size, grad_size, prof, *args, **kwargs)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 1811, in inner_loop
    optimizer.step()
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\accelerate\optimizer.py", line 133, in step
    self.scaler.step(self.optimizer, closure)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\amp\grad_scaler.py", line 416, in step
    retval = self._maybe_opt_step(optimizer, optimizer_state, *args, **kwargs)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\amp\grad_scaler.py", line 315, in _maybe_opt_step
    retval = optimizer.step(*args, **kwargs)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\torch\optim\lr_scheduler.py", line 68, in wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\torch\optim\optimizer.py", line 373, in wrapper
    out = func(*args, **kwargs)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\optim\optimizer.py", line 300, in step
    self.update_step(group, p, gindex, pindex)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\optim\optimizer.py", line 581, in update_step
    F.optimizer_update_8bit_blockwise(
  File "C:\Users\Admin\Documents\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\functional.py", line 1469, in optimizer_update_8bit_blockwise
    optim_func(
OSError: [WinError -1073741795] Windows Error 0xc000001d
Steps:   0%|                                                                                  | 0/3000 [00:20<?, ?it/s]
```


### Additional information

I am Using Tiny 10 (A rundown version of Windows 10)