]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix Linux /sys cpu path to guess number of cores (#7064)
authorviric <redacted>
Sat, 4 May 2024 13:26:53 +0000 (15:26 +0200)
committerGitHub <redacted>
Sat, 4 May 2024 13:26:53 +0000 (15:26 +0200)
common/common.cpp

index 243b88abf1aab44dcce3be44b2e10322ceab4e61..467fb014eedb0bd7e6810549c00a05283aaa8145 100644 (file)
@@ -76,7 +76,7 @@ int32_t 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::ifstream thread_siblings("/sys/devices/system/cpu/cpu"
             + std::to_string(cpu) + "/topology/thread_siblings");
         if (!thread_siblings.is_open()) {
             break; // no more cpus