Commit ddd6b3a for stable-diffusion.cpp
commit ddd6b3aa3574ecc9d1ebb7dd92e726a53ba3bb3b
Author: boriselec <boriselec@users.noreply.github.com>
Date: Thu Oct 22 17:53:18 2026 +0300
fix: correct Linux sysfs path for physical core detection (#2186)
diff --git a/src/core/util.cpp b/src/core/util.cpp
index 7bd5c0b..a691b42 100644
--- a/src/core/util.cpp
+++ b/src/core/util.cpp
@@ -343,7 +343,7 @@ int32_t sd_get_num_physical_cores() {
// enumerate the set of thread siblings, num entries is num cores
std::unordered_set<std::string> siblings;
for (uint32_t cpu = 0; cpu < UINT32_MAX; ++cpu) {
- std::ifstream thread_siblings("/sys/devices/system/cpu" + std::to_string(cpu) + "/topology/thread_siblings");
+ std::ifstream thread_siblings("/sys/devices/system/cpu/cpu" + std::to_string(cpu) + "/topology/thread_siblings");
if (!thread_siblings.is_open()) {
break; // no more cpus
}