From 3badeb56a0c0b7e83bd1497d3979bf9b1c41af23 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 1 Oct 2019 07:19:13 +0700 Subject: [PATCH] Fixed support for systems where total count of NUMA nodes not equal usable count. --- src/backend/cpu/platform/HwlocCpuInfo.cpp | 2 +- src/crypto/rx/Rx.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/cpu/platform/HwlocCpuInfo.cpp b/src/backend/cpu/platform/HwlocCpuInfo.cpp index 9e503742..244e6cd3 100644 --- a/src/backend/cpu/platform/HwlocCpuInfo.cpp +++ b/src/backend/cpu/platform/HwlocCpuInfo.cpp @@ -178,7 +178,7 @@ xmrig::HwlocCpuInfo::HwlocCpuInfo() : BasicCpuInfo(), m_threads = countByType(m_topology, HWLOC_OBJ_PU); m_cores = countByType(m_topology, HWLOC_OBJ_CORE); - m_nodes = std::max(countByType(m_topology, HWLOC_OBJ_NUMANODE), 1); + m_nodes = std::max(hwloc_bitmap_weight(hwloc_topology_get_complete_nodeset(m_topology)), 1); m_packages = countByType(m_topology, HWLOC_OBJ_PACKAGE); if (m_nodes > 1) { diff --git a/src/crypto/rx/Rx.cpp b/src/crypto/rx/Rx.cpp index 8e757ddf..8e3730ad 100644 --- a/src/crypto/rx/Rx.cpp +++ b/src/crypto/rx/Rx.cpp @@ -246,7 +246,7 @@ xmrig::RxDataset *xmrig::Rx::dataset(const Job &job, uint32_t nodeId) return nullptr; } - return d_ptr->datasets.at(d_ptr->isNUMA() ? nodeId : 0); + return d_ptr->datasets.at(d_ptr->isNUMA() ? (d_ptr->datasets.count(nodeId) ? nodeId : HwlocCpuInfo::nodeIndexes().front()) : 0); }