From ae3ff0f57057c2b4b30e790f71e67ffd8c297103 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 1 Aug 2020 12:30:02 +0700 Subject: [PATCH] Fixed RandomX cache initialization if 1GB pages fails to allocate on a first NUMA node. --- src/crypto/rx/RxNUMAStorage.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/crypto/rx/RxNUMAStorage.cpp b/src/crypto/rx/RxNUMAStorage.cpp index 01164f64..09a0fd37 100644 --- a/src/crypto/rx/RxNUMAStorage.cpp +++ b/src/crypto/rx/RxNUMAStorage.cpp @@ -176,10 +176,16 @@ public: inline void initDatasets(uint32_t threads, int priority) { - uint64_t ts = Chrono::steadyMSecs(); - auto id = m_nodeset.front(); - auto primary = dataset(id); + uint64_t ts = Chrono::steadyMSecs(); + uint32_t id = 0; + for (const auto &kv : m_datasets) { + if (kv.second->cache()) { + id = kv.first; + } + } + + auto primary = dataset(id); primary->init(m_seed.data(), threads, priority); printDatasetReady(id, ts);