mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
OpenVINO add Multi GPU option
This commit is contained in:
@@ -70,6 +70,15 @@ def get_device():
|
||||
core = Core()
|
||||
if os.getenv("OPENVINO_TORCH_BACKEND_DEVICE") is not None:
|
||||
device = os.getenv("OPENVINO_TORCH_BACKEND_DEVICE")
|
||||
elif shared.opts.openvino_multi_gpu:
|
||||
device = ""
|
||||
available_devices = core.available_devices
|
||||
available_devices.remove("CPU")
|
||||
if shared.opts.openvino_remove_igpu_from_multi and "GPU.0" in available_devices:
|
||||
available_devices.remove("GPU.0")
|
||||
for gpu in available_devices:
|
||||
device = f"{device},{gpu}"
|
||||
device = f"MULTI:{device[1:]}"
|
||||
elif any(openvino_cpu in cpu_module.lower() for cpu_module in shared.cmd_opts.use_cpu for openvino_cpu in ["openvino", "all"]):
|
||||
device = "CPU"
|
||||
elif shared.cmd_opts.device_id is not None:
|
||||
|
||||
@@ -426,6 +426,8 @@ options_templates.update(options_section(('cuda', "Compute Settings"), {
|
||||
"opt_channelslast": OptionInfo(False, "Use channels last as torch memory format "),
|
||||
"cudnn_benchmark": OptionInfo(False, "Enable full-depth cuDNN benchmark feature"),
|
||||
"ipex_optimize": OptionInfo(True if devices.backend == "ipex" else False, "Enable IPEX Optimize for Intel GPUs"),
|
||||
"openvino_multi_gpu": OptionInfo(False, "OpenVINO use Multi GPU"),
|
||||
"openvino_remove_igpu_from_multi": OptionInfo(False, "OpenVINO remove iGPU from Multi GPU"),
|
||||
"directml_memory_provider": OptionInfo(default_memory_provider, 'DirectML memory stats provider', gr.Radio, lambda: {"choices": memory_providers}),
|
||||
"torch_gc_threshold": OptionInfo(90, "VRAM usage threshold before running Torch GC to clear up VRAM", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}),
|
||||
"cuda_compile_sep": OptionInfo("<h2>Model Compile</h2>", "", gr.HTML),
|
||||
|
||||
Reference in New Issue
Block a user