Merge xmrig v6.18.0 into master

This commit is contained in:
MoneroOcean 2022-06-23 17:43:36 +00:00
commit 4b6759adf9
144 changed files with 6006 additions and 15104 deletions

View file

@ -436,10 +436,6 @@ rapidjson::Value xmrig::CpuBackend::toJSON(rapidjson::Document &doc) const
out.AddMember("argon2-impl", argon2::Impl::name().toJSON(), allocator);
# endif
# ifdef XMRIG_ALGO_ASTROBWT
out.AddMember("astrobwt-max-size", cpu.astrobwtMaxSize(), allocator);
# endif
out.AddMember("hugepages", d_ptr->hugePages(2, doc), allocator);
out.AddMember("memory", static_cast<uint64_t>(d_ptr->algo.isValid() ? (d_ptr->ways() * d_ptr->algo.l3()) : 0), allocator);

View file

@ -45,11 +45,6 @@ const char *CpuConfig::kAsm = "asm";
const char *CpuConfig::kArgon2Impl = "argon2-impl";
#endif
#ifdef XMRIG_ALGO_ASTROBWT
const char *CpuConfig::kAstroBWTMaxSize = "astrobwt-max-size";
const char *CpuConfig::kAstroBWTAVX2 = "astrobwt-avx2";
#endif
extern template class Threads<CpuThreads>;
@ -89,11 +84,6 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
obj.AddMember(StringRef(kArgon2Impl), m_argon2Impl.toJSON(), allocator);
# endif
# ifdef XMRIG_ALGO_ASTROBWT
obj.AddMember(StringRef(kAstroBWTMaxSize), m_astrobwtMaxSize, allocator);
obj.AddMember(StringRef(kAstroBWTAVX2), m_astrobwtAVX2, allocator);
# endif
m_threads.toJSON(obj, doc);
return obj;
@ -158,24 +148,6 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
m_argon2Impl = Json::getString(value, kArgon2Impl);
# endif
# ifdef XMRIG_ALGO_ASTROBWT
const auto& astroBWTMaxSize = Json::getValue(value, kAstroBWTMaxSize);
if (astroBWTMaxSize.IsNull() || !astroBWTMaxSize.IsInt()) {
m_shouldSave = true;
}
else {
m_astrobwtMaxSize = std::min(std::max(astroBWTMaxSize.GetInt(), 400), 1200);
}
const auto& astroBWTAVX2 = Json::getValue(value, kAstroBWTAVX2);
if (astroBWTAVX2.IsNull() || !astroBWTAVX2.IsBool()) {
m_shouldSave = true;
}
else {
m_astrobwtAVX2 = astroBWTAVX2.GetBool();
}
# endif
m_threads.read(value);
generate();
@ -206,7 +178,6 @@ void xmrig::CpuConfig::generate()
count += xmrig::generate<Algorithm::CN_FEMTO>(m_threads, m_limit);
count += xmrig::generate<Algorithm::RANDOM_X>(m_threads, m_limit);
count += xmrig::generate<Algorithm::ARGON2>(m_threads, m_limit);
count += xmrig::generate<Algorithm::ASTROBWT>(m_threads, m_limit);
count += xmrig::generate<Algorithm::GHOSTRIDER>(m_threads, m_limit);
m_shouldSave |= count > 0;

View file

@ -56,11 +56,6 @@ public:
static const char *kArgon2Impl;
# endif
# ifdef XMRIG_ALGO_ASTROBWT
static const char *kAstroBWTMaxSize;
static const char *kAstroBWTAVX2;
# endif
CpuConfig() = default;
bool isHwAES() const;
@ -69,7 +64,6 @@ public:
std::vector<CpuLaunchData> get(const Miner *miner, const Algorithm &algorithm) const;
void read(const rapidjson::Value &value);
inline bool astrobwtAVX2() const { return m_astrobwtAVX2; }
inline bool isEnabled() const { return m_enabled; }
inline bool isHugePages() const { return m_hugePageSize > 0; }
inline bool isHugePagesJit() const { return m_hugePagesJit; }
@ -78,7 +72,6 @@ public:
inline const Assembly &assembly() const { return m_assembly; }
inline const String &argon2Impl() const { return m_argon2Impl; }
inline const Threads<CpuThreads> &threads() const { return m_threads; }
inline int astrobwtMaxSize() const { return m_astrobwtMaxSize; }
inline int priority() const { return m_priority; }
inline size_t hugePageSize() const { return m_hugePageSize * 1024U; }
inline uint32_t limit() const { return m_limit; }
@ -96,12 +89,10 @@ private:
AesMode m_aes = AES_AUTO;
Assembly m_assembly;
bool m_astrobwtAVX2 = false;
bool m_enabled = true;
bool m_hugePagesJit = false;
bool m_shouldSave = false;
bool m_yield = true;
int m_astrobwtMaxSize = 550;
int m_memoryPool = 0;
int m_priority = -1;
size_t m_hugePageSize = kDefaultHugePageSizeKb;

View file

@ -161,22 +161,6 @@ size_t inline generate<Algorithm::ARGON2>(Threads<CpuThreads> &threads, uint32_t
#endif
#ifdef XMRIG_ALGO_ASTROBWT
template<>
size_t inline generate<Algorithm::ASTROBWT>(Threads<CpuThreads>& threads, uint32_t limit)
{
size_t count = 0;
if (!threads.isExist(Algorithm::ASTROBWT_DERO_2)) {
auto v2 = Cpu::info()->threads(Algorithm::ASTROBWT_DERO_2, limit);
count += threads.move(Algorithm::kASTROBWT_DERO_2, std::move(v2));
}
count += generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, limit);
return count;
}
#endif
#ifdef XMRIG_ALGO_GHOSTRIDER
template<>
size_t inline generate<Algorithm::GHOSTRIDER>(Threads<CpuThreads>& threads, uint32_t limit)

View file

@ -35,11 +35,9 @@
xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread, size_t threads, const std::vector<int64_t>& affinities) :
algorithm(algorithm),
assembly(config.assembly()),
astrobwtAVX2(config.astrobwtAVX2()),
hugePages(config.isHugePages()),
hwAES(config.isHwAES()),
yield(config.isYield()),
astrobwtMaxSize(config.astrobwtMaxSize()),
priority(config.priority()),
affinity(thread.affinity()),
miner(miner),

View file

@ -58,11 +58,9 @@ public:
const Algorithm algorithm;
const Assembly assembly;
const bool astrobwtAVX2;
const bool hugePages;
const bool hwAES;
const bool yield;
const int astrobwtMaxSize;
const int priority;
const int64_t affinity;
const Miner *miner;

View file

@ -44,11 +44,6 @@
#endif
#ifdef XMRIG_ALGO_ASTROBWT
# include "crypto/astrobwt/AstroBWT.h"
#endif
#ifdef XMRIG_FEATURE_BENCHMARK
# include "backend/common/benchmark/BenchState.h"
#endif
@ -73,11 +68,9 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
Worker(id, data.affinity, data.priority),
m_algorithm(data.algorithm),
m_assembly(data.assembly),
m_astrobwtAVX2(data.astrobwtAVX2),
m_hwAES(data.hwAES),
m_yield(data.yield),
m_av(data.av()),
m_astrobwtMaxSize(data.astrobwtMaxSize * 1000),
m_miner(data.miner),
m_threads(data.threads),
m_ctx()
@ -233,11 +226,6 @@ bool xmrig::CpuWorker<N>::selfTest()
}
# endif
# ifdef XMRIG_ALGO_ASTROBWT
if (m_algorithm.id() == Algorithm::ASTROBWT_DERO) return verify(Algorithm::ASTROBWT_DERO, astrobwt_dero_test_out);
if (m_algorithm.id() == Algorithm::ASTROBWT_DERO_2) return verify(Algorithm::ASTROBWT_DERO_2, astrobwt_dero_2_test_out);
# endif
return false;
}
@ -328,21 +316,6 @@ void xmrig::CpuWorker<N>::start()
{
switch (job.algorithm().family()) {
# ifdef XMRIG_ALGO_ASTROBWT
case Algorithm::ASTROBWT:
if (job.algorithm().id() == Algorithm::ASTROBWT_DERO) {
if (!astrobwt::astrobwt_dero(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash, m_astrobwtMaxSize, m_astrobwtAVX2)) {
valid = false;
}
}
else {
if (!astrobwt::astrobwt_dero_v2(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash)) {
valid = false;
}
}
break;
# endif
# ifdef XMRIG_ALGO_GHOSTRIDER
case Algorithm::GHOSTRIDER:
if (N == 8) {

View file

@ -83,14 +83,12 @@ private:
void allocateCnCtx();
void consumeJob();
alignas(16) uint8_t m_hash[N * 32]{ 0 };
alignas(8) uint8_t m_hash[N * 32]{ 0 };
const Algorithm m_algorithm;
const Assembly m_assembly;
const bool m_astrobwtAVX2;
const bool m_hwAES;
const bool m_yield;
const CnHash::AlgoVariant m_av;
const int m_astrobwtMaxSize;
const Miner *m_miner;
const size_t m_threads;
cryptonight_ctx *m_ctx[N];

View file

@ -379,16 +379,6 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
}
# endif
# ifdef XMRIG_ALGO_ASTROBWT
if (f == Algorithm::ASTROBWT) {
CpuThreads threads;
for (size_t i = 0; i < count_limit; ++i) {
threads.add(i, 0);
}
return threads;
}
# endif
# ifdef XMRIG_ALGO_GHOSTRIDER
if (f == Algorithm::GHOSTRIDER) {
return CpuThreads(std::max<size_t>(count / 2, 1), 8);

View file

@ -318,13 +318,6 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
size_t scratchpad = algorithm.l3();
uint32_t intensity = algorithm.maxIntensity() == 1 ? 0 : 1;
# ifdef XMRIG_ALGO_ASTROBWT
if (algorithm == Algorithm::ASTROBWT_DERO) {
// Use fake low value to force usage of all available cores for AstroBWT (taking 'limit' into account)
scratchpad = 16 * 1024;
}
# endif
if (cache->attr->cache.depth == 3) {
for (size_t i = 0; i < cache->arity; ++i) {
hwloc_obj_t l2 = cache->children[i];