Skip to content

fix(cuda): add -DGGML_CUDA=ON to Windows CUDA build#12

Merged
kenvandine merged 1 commit into
lemonade-sdk:lemonadefrom
kenvandine:windows-cuda-fix
Jun 10, 2026
Merged

fix(cuda): add -DGGML_CUDA=ON to Windows CUDA build#12
kenvandine merged 1 commit into
lemonade-sdk:lemonadefrom
kenvandine:windows-cuda-fix

Conversation

@kenvandine

Copy link
Copy Markdown
Member

Problem

The Windows CUDA cmake invocation was missing -DGGML_CUDA=ON, which meant the ggml CUDA backend was never compiled in. Without it, the build silently falls back to CPU even when the CUDA toolkit is installed and the binary is labelled windows-cuda-sm_XX.

This is the same fix already applied to the Linux CUDA build in commit 6a68a98 (PR leejet#13).

Root Cause

SD_CUBLAS is not a valid CMake option in stable-diffusion.cpp (there is no option(SD_CUBLAS ...) in CMakeLists.txt). It is silently ignored. The correct flag is GGML_CUDA=ON (directly, or via SD_CUDA=ON which sets it). Without -DGGML_CUDA=ON, the CUDA ggml backend is never compiled, and stable-diffusion.cpp falls back to CPU computation at runtime.

Fix

Add -DGGML_CUDA=ON to the Windows CUDA cmake invocation (matching the Linux approach from PR leejet#13).

Closes

lemonade-sdk/lemonade#2171 (sdcpp:cuda falls back to CPU on Windows + RTX 4090)

The Windows CUDA cmake invocation was missing -DGGML_CUDA=ON, which
meant the ggml CUDA backend was never compiled in. Without it, the
build silently falls back to CPU even when the CUDA toolkit is
installed. This is the same fix already applied to the Linux CUDA
build in commit 6a68a98.

Fixes: lemonade-sdk/lemonade#2171 (sdcpp:cuda falls back to CPU on Windows + RTX 4090)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GitHub Actions Windows CUDA build configuration to explicitly enable the ggml CUDA backend during CMake configuration, aligning it with the existing Linux CUDA workflow behavior so Windows “cuda” artifacts don’t silently build CPU-only binaries.

Changes:

  • Add -DGGML_CUDA=ON to the Windows CUDA CMake invocation in the CI workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kenvandine kenvandine merged commit bf6b2ef into lemonade-sdk:lemonade Jun 10, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants