vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.61k stars 413 forks source link

[Issue]: Cannot run after the second time (Intel Arc, WSL) #1936

Closed cyatarow closed 1 year ago

cyatarow commented 1 year ago

Issue Description

@Disty0

After this update, only the setup (first run) can be done successfully, but I cannot run the webui after the second time.

Version Platform Description

The following is shown only at the setup run:

Starting SD.Next
01:16:45-376852 INFO     Python 3.10.12 on Linux
01:16:45-396292 INFO     Version: 81cfb444 Fri Aug 4 16:55:15 2023 +0300
01:16:45-399283 INFO     Intel OneAPI Toolkit detected
01:16:45-399979 INFO     Installing package: torch==2.0.1a0 torchvision==0.15.2a0 intel_extension_for_pytorch==2.0.110+xpu -f
                         https://developer.intel.com/ipex-whl-stable-xpu
01:17:17-225477 INFO     Disabled extensions: []
01:17:17-226583 INFO     Enabled extensions-builtin: ['sd-dynamic-thresholding', 'multidiffusion-upscaler-for-automatic1111', 'Lora', 'ScuNET', 'a1111-sd-webui-lycoris',
                         'sd-webui-agent-scheduler', 'clip-interrogator-ext', 'LDSR', 'stable-diffusion-webui-images-browser', 'sd-extension-system-info', 'SwinIR',
                         'stable-diffusion-webui-rembg', 'sd-webui-controlnet']
01:17:17-242863 INFO     Enabled extensions: []

Relevant log output

arc@machine-RE2:~/a/automatic$ ./webui.sh
Create and activate python venv
Setting OneAPI environment

:: initializing oneAPI environment ...
   webui.sh: BASH_VERSION = 5.1.16(1)-release
   args: Using "$@" for setvars.sh arguments:
:: compiler -- latest
/opt/intel/oneapi/compiler/2023.2.0/linux/lib/oclfpga/fpgavars.sh: line 51: export: `Files/Eclipse': not a valid identifier
/opt/intel/oneapi/compiler/2023.2.0/linux/lib/oclfpga/fpgavars.sh: line 51: export: `Adoptium/jre-17.0.7.7-hotspot/bin:/mnt/c/Program': not a valid identifier
/opt/intel/oneapi/compiler/2023.2.0/linux/lib/oclfpga/fpgavars.sh: line 51: export: `Files/Python310/Scripts/:/mnt/c/Program': not a valid identifier
/opt/intel/oneapi/compiler/2023.2.0/linux/lib/oclfpga/fpgavars.sh: line 51: export: `Files/Python310/:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Program': not a valid identifier
/opt/intel/oneapi/compiler/2023.2.0/linux/lib/oclfpga/fpgavars.sh: line 51: export: `Files/dotnet/:/mnt/c/Program': not a valid identifier
/opt/intel/oneapi/compiler/2023.2.0/linux/lib/oclfpga/fpgavars.sh: line 51: export: `Files/Git/cmd:/mnt/c/Users/a1/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/a1/AppData/Roaming/Python/Python310/Scripts:/mnt/c/ADB:/mnt/c/FFMPEG/bin:/snap/bin': not a valid identifier
:: debugger -- latest
:: dev-utilities -- latest
:: dpl -- latest
:: mkl -- latest
:: tbb -- latest
:: oneAPI environment initialized ::

Launching ipexrun launch.py...
/home/arc/a/automatic/venv/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
  warn(
2023-08-05 01:22:34.115894: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-08-05 01:22:34.117093: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-05 01:22:34.143210: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-05 01:22:34.143533: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-05 01:22:34.590244: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-08-05 01:22:35.180679: I itex/core/wrapper/itex_gpu_wrapper.cc:35] Intel Extension for Tensorflow* GPU backend is loaded.
2023-08-05 01:22:35.221277: W itex/core/ops/op_init.cc:58] Op: _QuantizedMaxPool3D is already registered in Tensorflow
2023-08-05 01:22:35.234937: I itex/core/devices/gpu/itex_gpu_runtime.cc:129] Selected platform: Intel(R) Level-Zero
2023-08-05 01:22:35.235190: I itex/core/devices/gpu/itex_gpu_runtime.cc:154] number of sub-devices is zero, expose root device.
2023-08-05 01:22:35,428 - numexpr.utils - INFO - NumExpr defaulting to 8 threads.
/home/arc/a/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/launcher.py:102: UserWarning: Backend is not specified, it will automatically default to cpu.
  warnings.warn(
2023-08-05 01:22:35,729 - intel_extension_for_pytorch.cpu.launch.launch - WARNING - Neither of ['tcmalloc', 'jemalloc'] memory allocator is found in ['/home/arc/a/automatic/venv/lib/', '/home/arc/.local/lib/', '/usr/local/lib/', '/usr/local/lib64/', '/usr/lib/', '/usr/lib64/', '/usr/lib/x86_64-linux-gnu/'].
2023-08-05 01:22:35,729 - intel_extension_for_pytorch.cpu.launch.launch - INFO - Use 'default' memory allocator. This may drop the performance.
2023-08-05 01:22:35,729 - intel_extension_for_pytorch.cpu.launch.launch - WARNING - 'intel' OpenMP runtime is not found in ['/home/arc/a/automatic/venv/lib/', '/home/arc/.local/lib/', '/usr/local/lib/', '/usr/local/lib64/', '/usr/lib/', '/usr/lib64/', '/usr/lib/x86_64-linux-gnu/'].
2023-08-05 01:22:35,729 - intel_extension_for_pytorch.cpu.launch.launch - INFO - Use 'default' OpenMP runtime.
2023-08-05 01:22:35,730 - intel_extension_for_pytorch.cpu.launch.launch - INFO - Use 'auto' => 'numactl' multi-task manager.
2023-08-05 01:22:35,730 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: Untouched preset environment variables are not displayed.
2023-08-05 01:22:35,730 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: OMP_SCHEDULE=STATIC
2023-08-05 01:22:35,730 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: OMP_PROC_BIND=CLOSE
2023-08-05 01:22:35,730 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: OMP_NUM_THREADS=4
2023-08-05 01:22:35,730 - intel_extension_for_pytorch.cpu.launch.launch - INFO - cmd: numactl -C 0,2,4,6 -m 0 /home/arc/a/automatic/venv/bin/python3 -u launch.py
numactl: This system does not support NUMA policy
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/arc/a/automatic/venv/bin/ipexrun:8 in <module>                                             │
│                                                                                                  │
│   5 from intel_extension_for_pytorch.launcher import main                                        │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(main())                                                                         │
│   9                                                                                              │
│                                                                                                  │
│ /home/arc/a/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/launcher.py: │
│ 109 in main                                                                                      │
│                                                                                                  │
│   106 │   │   sys.argv.insert(1, "cpu")                                                          │
│   107 │   args = parser.parse_args()                                                             │
│   108 │   if args.backend == "cpu":                                                              │
│ ❱ 109 │   │   cpu_run_main_with_args(args)                                                       │
│   110 │   elif args.backend == "xpu":                                                            │
│   111 │   │   xpu_run_main_with_args(args)                                                       │
│   112 │   else:                                                                                  │
│                                                                                                  │
│ /home/arc/a/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/cpu/launch/l │
│ aunch.py:453 in run_main_with_args                                                               │
│                                                                                                  │
│   450 │   else:                                                                                  │
│   451 │   │   launcher = launcher_multi_instances                                                │
│   452 │                                                                                          │
│ ❱ 453 │   launcher.launch(args)                                                                  │
│   454 │   for x in sorted(set(os.environ.keys()) - env_before):                                  │
│   455 │   │   logger.debug(f"{x}={os.environ[x]}")                                               │
│   456                                                                                            │
│                                                                                                  │
│ /home/arc/a/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/cpu/launch/l │
│ auncher_multi_instances.py:316 in launch                                                         │
│                                                                                                  │
│   313 │   │   │   │   p = process["process"]                                                     │
│   314 │   │   │   │   p.wait()                                                                   │
│   315 │   │   │   │   if p.returncode != 0:                                                      │
│ ❱ 316 │   │   │   │   │   raise subprocess.CalledProcessError(                                   │
│   317 │   │   │   │   │   │   returncode=p.returncode, cmd=process["cmd"]                        │
│   318 │   │   │   │   │   )                                                                      │
│   319 │   │   finally:                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
CalledProcessError: Command 'numactl -C 0,2,4,6 -m 0 /home/arc/a/automatic/venv/bin/python3 -u launch.py' returned non-zero exit status 1.

Acknowledgements

Disty0 commented 1 year ago

Disabled ipexrun on WSL2: https://github.com/vladmandic/automatic/commit/e925394b99ba4c4e6531a1997ecaeab589a4986a

cyatarow commented 1 year ago

Thank you! I also confirmed this issue fixed.