mirror of
https://github.com/xmrig/xmrig.git
synced 2024-10-30 13:07:46 +00:00
Fix crash in cn-heavy on Zen3 with manual thread count
This commit is contained in:
parent
1f9cdc0564
commit
70cddc06ba
1 changed files with 3 additions and 1 deletions
|
@ -86,7 +86,9 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
|
||||||
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm.family() == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3)) {
|
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm.family() == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3)) {
|
||||||
std::lock_guard<std::mutex> lock(cn_heavyZen3MemoryMutex);
|
std::lock_guard<std::mutex> lock(cn_heavyZen3MemoryMutex);
|
||||||
if (!cn_heavyZen3Memory) {
|
if (!cn_heavyZen3Memory) {
|
||||||
cn_heavyZen3Memory = new VirtualMemory(m_algorithm.l3() * m_threads, data.hugePages, false, false, node());
|
// Round up number of threads to the multiple of 8
|
||||||
|
const size_t N = ((m_threads + 7) / 8) * 8;
|
||||||
|
cn_heavyZen3Memory = new VirtualMemory(m_algorithm.l3() * N, data.hugePages, false, false, node());
|
||||||
}
|
}
|
||||||
m_memory = cn_heavyZen3Memory;
|
m_memory = cn_heavyZen3Memory;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue