Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/cpp_server_build_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,11 @@ jobs:
test_type: sd
backend: rocm
runner: [stx-halo, Windows]
# Stable Diffusion (Vulkan)
- name: stable-diffusion (vulkan)
test_type: sd
backend: vulkan
runner: [rai300_400, Windows]
# Text to speech
- name: text-to-speech
test_type: tts
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/resources/backend_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"sd-cpp": {
"cpu": "master-471-7010bb4",
"rocm": "master-487-43e829f"
"rocm": "master-487-43e829f",
"vulkan": "master-487-43e829f"
},
"ryzenai-server": "v1.7.0",
"flm": {
Expand Down
8 changes: 8 additions & 0 deletions src/cpp/server/backends/sd_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ void SDServer::install(const std::string& backend) {
throw std::runtime_error("ROCm sd.cpp only supported on Windows and Linux");
#endif
std::cout << "[SDServer] Using ROCm GPU backend" << std::endl;
} else if (backend_ == "vulkan") {
// Vulkan backend for cross-platform GPU support
#ifdef _WIN32
filename = "sd-" + short_version + "-bin-win-vulkan-x64.zip";
std::cout << "[SDServer] Using Vulkan GPU backend" << std::endl;
#else
throw std::runtime_error("Vulkan sd.cpp backend is only supported on Windows");
#endif
} else {
// CPU build (default)
#ifdef _WIN32
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/server/recipe_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ static const json CLI_OPTIONS = {
{"--sdcpp", {
{"option_name", "sd-cpp_backend"},
{"type_name", "BACKEND"},
{"allowed_values", {"cpu", "rocm"}},
{"allowed_values", {"cpu", "rocm", "vulkan"}},
{"envname", "LEMONADE_SDCPP"},
{"help", "SD.cpp backend to use (cpu for CPU, rocm for AMD GPU)"}
{"help", "SD.cpp backend to use (cpu for CPU, rocm for AMD GPU, vulkan for cross-platform GPU)"}
}},
// ASR options
{"--whispercpp", {
Expand Down
9 changes: 9 additions & 0 deletions src/cpp/server/system_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ static const std::vector<RecipeBackendDef> RECIPE_DEFS = {
{"amd_dgpu", {"gfx110X", "gfx120X"}},
}},

// stable-diffusion.cpp - Vulkan backend (cross-platform GPU)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should vulkan be the default over ROCm if its required for complex models to work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That makes sense.

{"sd-cpp", "vulkan", {"windows"}, {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add Linux Vulkan: sd-master-636d3cb-bin-Linux-Ubuntu-24.04-x86_64-vulkan.zip

{"cpu", {"x86_64"}},
{"amd_igpu", {}},
{"amd_dgpu", {}},
{"nvidia_dgpu", {}},
{"intel_igpu", {}},
}},

// stable-diffusion.cpp - CPU backend (Windows/Linux x86_64)
{"sd-cpp", "cpu", {"windows", "linux"}, {
{"cpu", {"x86_64"}},
Expand Down
13 changes: 7 additions & 6 deletions test/server_system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def get_server_version(server_binary: str) -> str:
"expected_supported": {
"llamacpp": ["vulkan", "rocm", "cpu"],
"whispercpp": ["cpu"], # cpu backend available on x86_64
"sd-cpp": ["cpu", "rocm"],
"sd-cpp": ["cpu", "rocm", "vulkan"],
},
"expected_unsupported": {
"llamacpp": ["metal"],
Expand Down Expand Up @@ -184,7 +184,7 @@ def get_server_version(server_binary: str) -> str:
"expected_supported": {
"llamacpp": ["vulkan", "rocm", "cpu"],
"whispercpp": ["npu", "cpu"], # npu supported on XDNA2, cpu on x86_64
"sd-cpp": ["cpu", "rocm"],
"sd-cpp": ["cpu", "rocm", "vulkan"],
"flm": ["default"],
"ryzenai-llm": ["default"],
},
Expand Down Expand Up @@ -227,7 +227,7 @@ def get_server_version(server_binary: str) -> str:
"expected_supported": {
"llamacpp": ["vulkan", "cpu"],
"whispercpp": ["cpu"], # cpu backend available on x86_64
"sd-cpp": ["cpu"],
"sd-cpp": ["cpu", "vulkan"],
},
"expected_unsupported": {
"llamacpp": ["metal", "rocm"],
Expand Down Expand Up @@ -271,7 +271,7 @@ def get_server_version(server_binary: str) -> str:
"expected_supported": {
"llamacpp": ["vulkan", "cpu"],
"whispercpp": ["cpu"], # cpu backend available on x86_64
"sd-cpp": ["cpu"],
"sd-cpp": ["cpu", "vulkan"],
},
"expected_unsupported": {
"llamacpp": ["metal", "rocm"], # rocm not supported on RDNA2
Expand Down Expand Up @@ -342,7 +342,7 @@ def get_server_version(server_binary: str) -> str:
"expected_unsupported": {
"llamacpp": ["metal", "rocm"],
"whispercpp": ["npu", "cpu"], # whispercpp is Windows-only
"sd-cpp": ["rocm"],
"sd-cpp": ["rocm","vulkan"],
"flm": ["default"],
"ryzenai-llm": ["default"],
},
Expand Down Expand Up @@ -384,6 +384,7 @@ def get_server_version(server_binary: str) -> str:
"whispercpp": ["npu", "cpu"], # whispercpp is Windows-only
"flm": ["default"], # Windows NPU only
"ryzenai-llm": ["default"],
"sd-cpp": ["vulkan"]
},
},
# Linux x86_64 with AMD GPU that doesn't support ROCm (RDNA2) - ONLY RUN ON LINUX
Expand Down Expand Up @@ -421,7 +422,7 @@ def get_server_version(server_binary: str) -> str:
"expected_unsupported": {
"llamacpp": ["metal", "rocm"], # rocm not supported on RDNA2
"whispercpp": ["npu", "cpu"], # whispercpp is Windows-only
"sd-cpp": ["rocm"],
"sd-cpp": ["rocm","vulkan"],
"flm": ["default"],
"ryzenai-llm": ["default"],
},
Expand Down