Commit 12bedc4f authored by Your Name's avatar Your Name

fix: use GGML_VULKAN_DEVICE for image model GPU selection

parent c019c1d9
......@@ -4819,10 +4819,15 @@ def main():
# Build kwargs based on available files
sd_kwargs = {'diffusion_model_path': model_path}
# Set Vulkan device for image models
image_vulkan_device = args.image_vulkan_device if args.image_vulkan_device is not None else args.vulkan_device
sd_kwargs['main_gpu'] = image_vulkan_device
print(f"Using Vulkan device {image_vulkan_device} for image model")
# Set Vulkan device for image models via GGML_VULKAN_DEVICE environment variable
if args.image_vulkan_device is not None:
import os
# Map Vulkan device index to GGML_VULKAN_DEVICE value
# Device 0 = first GPU, Device 1 = second GPU, etc.
# GGML_VULKAN_DEVICE=0 uses integrated GPU, GGML_VULKAN_DEVICE=1 uses discrete GPU
# For multiple GPUs, we need to use VK_ICD_FILENAMES or other methods
os.environ['GGML_VULKAN_DEVICE'] = str(args.image_vulkan_device)
print(f"Setting GGML_VULKAN_DEVICE={args.image_vulkan_device} for image model")
if clip_l_path:
sd_kwargs['llm_path'] = clip_l_path
......@@ -5325,10 +5330,15 @@ def main():
# Build kwargs based on available files
sd_kwargs = {'diffusion_model_path': model_path}
# Set Vulkan device for image models
image_vulkan_device = args.image_vulkan_device if args.image_vulkan_device is not None else args.vulkan_device
sd_kwargs['main_gpu'] = image_vulkan_device
print(f"Using Vulkan device {image_vulkan_device} for image model")
# Set Vulkan device for image models via GGML_VULKAN_DEVICE environment variable
if args.image_vulkan_device is not None:
import os
# Map Vulkan device index to GGML_VULKAN_DEVICE value
# Device 0 = first GPU, Device 1 = second GPU, etc.
# GGML_VULKAN_DEVICE=0 uses integrated GPU, GGML_VULKAN_DEVICE=1 uses discrete GPU
# For multiple GPUs, we need to use VK_ICD_FILENAMES or other methods
os.environ['GGML_VULKAN_DEVICE'] = str(args.image_vulkan_device)
print(f"Setting GGML_VULKAN_DEVICE={args.image_vulkan_device} for image model")
if clip_l_path:
sd_kwargs['llm_path'] = clip_l_path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment