Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
12bedc4f
Commit
12bedc4f
authored
Mar 14, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use GGML_VULKAN_DEVICE for image model GPU selection
parent
c019c1d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
coderai
coderai
+18
-8
No files found.
coderai
View file @
12bedc4f
...
@@ -4819,10 +4819,15 @@ def main():
...
@@ -4819,10 +4819,15 @@ def main():
#
Build
kwargs
based
on
available
files
#
Build
kwargs
based
on
available
files
sd_kwargs
=
{
'diffusion_model_path'
:
model_path
}
sd_kwargs
=
{
'diffusion_model_path'
:
model_path
}
#
Set
Vulkan
device
for
image
models
#
Set
Vulkan
device
for
image
models
via
GGML_VULKAN_DEVICE
environment
variable
image_vulkan_device
=
args
.
image_vulkan_device
if
args
.
image_vulkan_device
is
not
None
else
args
.
vulkan_device
if
args
.
image_vulkan_device
is
not
None
:
sd_kwargs
[
'main_gpu'
]
=
image_vulkan_device
import
os
print
(
f
"Using Vulkan device {image_vulkan_device} for image model"
)
#
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
:
if
clip_l_path
:
sd_kwargs
[
'llm_path'
]
=
clip_l_path
sd_kwargs
[
'llm_path'
]
=
clip_l_path
...
@@ -5325,10 +5330,15 @@ def main():
...
@@ -5325,10 +5330,15 @@ def main():
# Build kwargs based on available files
# Build kwargs based on available files
sd_kwargs = {'
diffusion_model_path
': model_path}
sd_kwargs = {'
diffusion_model_path
': model_path}
# Set Vulkan device for image models
# Set Vulkan device for image models via GGML_VULKAN_DEVICE environment variable
image_vulkan_device = args.image_vulkan_device if args.image_vulkan_device is not None else args.vulkan_device
if args.image_vulkan_device is not None:
sd_kwargs['
main_gpu
'] = image_vulkan_device
import os
print(f"Using Vulkan device {image_vulkan_device} for image model")
# 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:
if clip_l_path:
sd_kwargs['
llm_path
'] = clip_l_path
sd_kwargs['
llm_path
'] = clip_l_path
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment