From 78a982697745b341ffc1a803d97b12a36eec7caf Mon Sep 17 00:00:00 2001 From: Geri <42678694+GeriGeriGeriGeri@users.noreply.github.com> Date: Sat, 9 May 2020 22:46:53 +0200 Subject: [PATCH] Dual socket motherboard patch This patch allows the software to work with dual-socket and quad-socket Opteron based motherboards. --- amdctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/amdctl.c b/amdctl.c index 114dc95..4588db4 100644 --- a/amdctl.c +++ b/amdctl.c @@ -366,6 +366,14 @@ void getCpuInfo() { if (cpuModel == -1 || !cpuFamily || !cores) { error("Could not find CPU family or model!"); } + + // dual cpu or quad cpu motherboard patch. + int testcores=(int)sysconf(_SC_NPROCESSORS_CONF); + if(testcores>cores){ + printf("Multi-CPU motherboard detected: CPU has %d cores, but there is a total %d cores in %d CPU sockets\n", cores, testcores, testcores/cores); + cores=testcores; + } + } void checkFamily() {