diff --git a/CHANGELOG.md b/CHANGELOG.md index 40873f11c..a43138e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v6.0.1-beta +- [#1708](https://github.com/xmrig/xmrig/issues/1708) Added `title` option. +- [#1711](https://github.com/xmrig/xmrig/pull/1711) [cuda] Print errors from KawPow DAG initialization. +- [#1713](https://github.com/xmrig/xmrig/pull/1713) [cuda] Reduced memory usage for KawPow, minimum CUDA plugin version now is 6.1.0. + # v6.0.0-beta - [#1694](https://github.com/xmrig/xmrig/pull/1694) Added support for KawPow algorithm (Ravencoin) on AMD/NVIDIA. - Removed previously deprecated `cn/gpu` algorithm. diff --git a/README.md b/README.md index 798dadcd9..e8d8ef07f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![GitHub stars](https://img.shields.io/github/stars/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/stargazers) [![GitHub forks](https://img.shields.io/github/forks/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/network) -XMRig High performance, open source, cross platform RandomX, CryptoNight, AstroBWT and Argon2 CPU/GPU miner, with official support for Windows. +XMRig High performance, open source, cross platform RandomX, KawPow, CryptoNight, AstroBWT and Argon2 CPU/GPU miner, with official support for Windows. ## Mining backends - **CPU** (x64/x86/ARM) @@ -118,6 +118,8 @@ Misc: -h, --help display this help and exit --dry-run test configuration and exit --export-topology export hwloc topology to a XML file and exit + --title set custom console window title + --no-title disable setting console window title ``` ## Donations diff --git a/src/backend/cuda/CudaBackend.cpp b/src/backend/cuda/CudaBackend.cpp index aa0c30a16..a15ba810a 100644 --- a/src/backend/cuda/CudaBackend.cpp +++ b/src/backend/cuda/CudaBackend.cpp @@ -238,7 +238,7 @@ public: # ifdef XMRIG_ALGO_KAWPOW if (algo.family() == Algorithm::KAWPOW) { const uint32_t epoch = job.height() / KPHash::EPOCH_LENGTH; - mem_used = (KPCache::cache_size(epoch) + KPCache::dag_size(epoch)) / oneMiB; + mem_used = (KPCache::dag_size(epoch) + oneMiB - 1) / oneMiB; } # endif diff --git a/src/backend/cuda/runners/CudaKawPowRunner.cpp b/src/backend/cuda/runners/CudaKawPowRunner.cpp index e1f28e5cc..a03dd8c8e 100644 --- a/src/backend/cuda/runners/CudaKawPowRunner.cpp +++ b/src/backend/cuda/runners/CudaKawPowRunner.cpp @@ -66,11 +66,15 @@ bool xmrig::CudaKawPowRunner::set(const Job &job, uint8_t *blob) const uint64_t start_ms = Chrono::steadyMSecs(); - const bool result = CudaLib::kawPowPrepare(m_ctx, cache.data(), cache.size(), cache.dag_size(epoch), height, dag_sizes); - - const int64_t dt = Chrono::steadyMSecs() - start_ms; - if (dt > 500) { - LOG_INFO("%s " YELLOW("KawPow") " DAG for epoch " WHITE_BOLD("%u") " calculated " BLACK_BOLD("(%" PRIu64 "ms)"), Tags::nvidia(), epoch, dt); + const bool result = CudaLib::kawPowPrepare(m_ctx, cache.data(), cache.size(), cache.l1_cache(), cache.dag_size(epoch), height, dag_sizes); + if (!result) { + LOG_ERR("%s " YELLOW("KawPow") RED(" failed to initialize DAG: ") RED_BOLD("%s"), Tags::nvidia(), CudaLib::lastError(m_ctx)); + } + else { + const int64_t dt = Chrono::steadyMSecs() - start_ms; + if (dt > 1000) { + LOG_INFO("%s " YELLOW("KawPow") " DAG for epoch " WHITE_BOLD("%u") " calculated " BLACK_BOLD("(%" PRIu64 "ms)"), Tags::nvidia(), epoch, dt); + } } return result; diff --git a/src/backend/cuda/wrappers/CudaLib.cpp b/src/backend/cuda/wrappers/CudaLib.cpp index 83625acc2..0829e0bb2 100644 --- a/src/backend/cuda/wrappers/CudaLib.cpp +++ b/src/backend/cuda/wrappers/CudaLib.cpp @@ -66,7 +66,7 @@ static const char *kRelease = "release"; static const char *kRxHash = "rxHash"; static const char *kRxPrepare = "rxPrepare"; static const char *kKawPowHash = "kawPowHash"; -static const char *kKawPowPrepare = "kawPowPrepare"; +static const char *kKawPowPrepare_v2 = "kawPowPrepare_v2"; static const char *kKawPowStopHash = "kawPowStopHash"; static const char *kSetJob = "setJob"; static const char *kSetJob_v2 = "setJob_v2"; @@ -92,7 +92,7 @@ using release_t = void (*)(nvid_ctx *); using rxHash_t = bool (*)(nvid_ctx *, uint32_t, uint64_t, uint32_t *, uint32_t *); using rxPrepare_t = bool (*)(nvid_ctx *, const void *, size_t, bool, uint32_t); using kawPowHash_t = bool (*)(nvid_ctx *, uint8_t*, uint64_t, uint32_t *, uint32_t *, uint32_t *); -using kawPowPrepare_t = bool (*)(nvid_ctx *, const void *, size_t, size_t, uint32_t, const uint64_t*); +using kawPowPrepare_v2_t = bool (*)(nvid_ctx *, const void *, size_t, const void *, size_t, uint32_t, const uint64_t*); using kawPowStopHash_t = bool (*)(nvid_ctx *); using setJob_t = bool (*)(nvid_ctx *, const void *, size_t, int32_t); using setJob_v2_t = bool (*)(nvid_ctx *, const void *, size_t, const char *); @@ -118,7 +118,7 @@ static release_t pRelease = nullptr; static rxHash_t pRxHash = nullptr; static rxPrepare_t pRxPrepare = nullptr; static kawPowHash_t pKawPowHash = nullptr; -static kawPowPrepare_t pKawPowPrepare = nullptr; +static kawPowPrepare_v2_t pKawPowPrepare_v2 = nullptr; static kawPowStopHash_t pKawPowStopHash = nullptr; static setJob_t pSetJob = nullptr; static setJob_v2_t pSetJob_v2 = nullptr; @@ -214,9 +214,9 @@ bool xmrig::CudaLib::kawPowHash(nvid_ctx *ctx, uint8_t* job_blob, uint64_t targe } -bool xmrig::CudaLib::kawPowPrepare(nvid_ctx *ctx, const void* cache, size_t cache_size, size_t dag_size, uint32_t height, const uint64_t* dag_sizes) noexcept +bool xmrig::CudaLib::kawPowPrepare(nvid_ctx *ctx, const void* cache, size_t cache_size, const void* dag_precalc, size_t dag_size, uint32_t height, const uint64_t* dag_sizes) noexcept { - return pKawPowPrepare(ctx, cache, cache_size, dag_size, height, dag_sizes); + return pKawPowPrepare_v2(ctx, cache, cache_size, dag_precalc, dag_size, height, dag_sizes); } @@ -375,7 +375,7 @@ bool xmrig::CudaLib::load() DLSYM(AstroBWTHash); DLSYM(AstroBWTPrepare); DLSYM(KawPowHash); - DLSYM(KawPowPrepare); + DLSYM(KawPowPrepare_v2); DLSYM(KawPowStopHash); DLSYM(Version); diff --git a/src/backend/cuda/wrappers/CudaLib.h b/src/backend/cuda/wrappers/CudaLib.h index f1cd460f8..c058ffd59 100644 --- a/src/backend/cuda/wrappers/CudaLib.h +++ b/src/backend/cuda/wrappers/CudaLib.h @@ -81,7 +81,7 @@ public: static bool rxHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t target, uint32_t *rescount, uint32_t *resnonce) noexcept; static bool rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept; static bool kawPowHash(nvid_ctx *ctx, uint8_t* job_blob, uint64_t target, uint32_t *rescount, uint32_t *resnonce, uint32_t *skipped_hashes) noexcept; - static bool kawPowPrepare(nvid_ctx *ctx, const void* cache, size_t cache_size, size_t dag_size, uint32_t height, const uint64_t* dag_sizes) noexcept; + static bool kawPowPrepare(nvid_ctx *ctx, const void* cache, size_t cache_size, const void* dag_precalc, size_t dag_size, uint32_t height, const uint64_t* dag_sizes) noexcept; static bool kawPowStopHash(nvid_ctx *ctx) noexcept; static bool setJob(nvid_ctx *ctx, const void *data, size_t size, const Algorithm &algorithm) noexcept; static const char *deviceName(nvid_ctx *ctx) noexcept; diff --git a/src/base/base.cmake b/src/base/base.cmake index c0f901d11..0c82201f2 100644 --- a/src/base/base.cmake +++ b/src/base/base.cmake @@ -19,6 +19,7 @@ set(HEADERS_BASE src/base/kernel/Base.h src/base/kernel/config/BaseConfig.h src/base/kernel/config/BaseTransform.h + src/base/kernel/config/Title.h src/base/kernel/Entry.h src/base/kernel/interfaces/IBaseListener.h src/base/kernel/interfaces/IClient.h @@ -87,6 +88,7 @@ set(SOURCES_BASE src/base/kernel/Base.cpp src/base/kernel/config/BaseConfig.cpp src/base/kernel/config/BaseTransform.cpp + src/base/kernel/config/Title.cpp src/base/kernel/Entry.cpp src/base/kernel/Platform.cpp src/base/kernel/Process.cpp diff --git a/src/base/io/log/backends/ConsoleLog.cpp b/src/base/io/log/backends/ConsoleLog.cpp index bf17deb7b..29103a547 100644 --- a/src/base/io/log/backends/ConsoleLog.cpp +++ b/src/base/io/log/backends/ConsoleLog.cpp @@ -6,8 +6,8 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2019 Spudz76 - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,12 +28,13 @@ #include "base/io/log/backends/ConsoleLog.h" -#include "base/tools/Handle.h" #include "base/io/log/Log.h" +#include "base/kernel/config/Title.h" +#include "base/tools/Handle.h" #include "version.h" -xmrig::ConsoleLog::ConsoleLog() +xmrig::ConsoleLog::ConsoleLog(const Title &title) { if (!isSupported()) { Log::setColors(false); @@ -61,7 +62,9 @@ xmrig::ConsoleLog::ConsoleLog() } } - SetConsoleTitleA(APP_NAME " " APP_VERSION); + if (title.isEnabled()) { + SetConsoleTitleA(title.value()); + } # endif } diff --git a/src/base/io/log/backends/ConsoleLog.h b/src/base/io/log/backends/ConsoleLog.h index 89ed36041..7f365a15e 100644 --- a/src/base/io/log/backends/ConsoleLog.h +++ b/src/base/io/log/backends/ConsoleLog.h @@ -6,8 +6,8 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2019 Spudz76 - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,12 +38,15 @@ using uv_tty_t = struct uv_tty_s; namespace xmrig { +class Title; + + class ConsoleLog : public ILogBackend { public: XMRIG_DISABLE_COPY_MOVE(ConsoleLog) - ConsoleLog(); + ConsoleLog(const Title &title); ~ConsoleLog() override; protected: diff --git a/src/base/kernel/Base.cpp b/src/base/kernel/Base.cpp index 62c56245b..b20349e3f 100644 --- a/src/base/kernel/Base.cpp +++ b/src/base/kernel/Base.cpp @@ -184,7 +184,7 @@ int xmrig::Base::init() Log::setBackground(true); } else { - Log::add(new ConsoleLog()); + Log::add(new ConsoleLog(config()->title())); } if (config()->logFile()) { diff --git a/src/base/kernel/config/BaseConfig.cpp b/src/base/kernel/config/BaseConfig.cpp index d5a078f3c..459055d79 100644 --- a/src/base/kernel/config/BaseConfig.cpp +++ b/src/base/kernel/config/BaseConfig.cpp @@ -63,6 +63,7 @@ const char *BaseConfig::kHttp = "http"; const char *BaseConfig::kLogFile = "log-file"; const char *BaseConfig::kPrintTime = "print-time"; const char *BaseConfig::kSyslog = "syslog"; +const char *BaseConfig::kTitle = "title"; const char *BaseConfig::kUserAgent = "user-agent"; const char *BaseConfig::kVerbose = "verbose"; const char *BaseConfig::kWatch = "watch"; @@ -92,6 +93,7 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName) m_logFile = reader.getString(kLogFile); m_userAgent = reader.getString(kUserAgent); m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U); + m_title = reader.getValue(kTitle); # ifdef XMRIG_FEATURE_TLS m_tls = reader.getValue(kTls); diff --git a/src/base/kernel/config/BaseConfig.h b/src/base/kernel/config/BaseConfig.h index 5335dd6c6..2367aa79c 100644 --- a/src/base/kernel/config/BaseConfig.h +++ b/src/base/kernel/config/BaseConfig.h @@ -26,6 +26,7 @@ #define XMRIG_BASECONFIG_H +#include "base/kernel/config/Title.h" #include "base/kernel/interfaces/IConfig.h" #include "base/net/http/Http.h" #include "base/net/stratum/Pools.h" @@ -56,6 +57,7 @@ public: static const char *kLogFile; static const char *kPrintTime; static const char *kSyslog; + static const char *kTitle; static const char *kUserAgent; static const char *kVerbose; static const char *kWatch; @@ -76,6 +78,7 @@ public: inline const Pools &pools() const { return m_pools; } inline const String &apiId() const { return m_apiId; } inline const String &apiWorkerId() const { return m_apiWorkerId; } + inline const Title &title() const { return m_title; } inline uint32_t printTime() const { return m_printTime; } # ifdef XMRIG_FEATURE_TLS @@ -105,6 +108,7 @@ protected: String m_fileName; String m_logFile; String m_userAgent; + Title m_title; uint32_t m_printTime = 60; # ifdef XMRIG_FEATURE_TLS diff --git a/src/base/kernel/config/BaseTransform.cpp b/src/base/kernel/config/BaseTransform.cpp index 8adebc23e..415262cf1 100644 --- a/src/base/kernel/config/BaseTransform.cpp +++ b/src/base/kernel/config/BaseTransform.cpp @@ -204,6 +204,9 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch case IConfig::UserAgentKey: /* --user-agent */ return set(doc, BaseConfig::kUserAgent, arg); + case IConfig::TitleKey: /* --title */ + return set(doc, BaseConfig::kTitle, arg); + # ifdef XMRIG_FEATURE_TLS case IConfig::TlsCertKey: /* --tls-cert */ return set(doc, BaseConfig::kTls, TlsConfig::kCert, arg); @@ -248,6 +251,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch case IConfig::ColorKey: /* --no-color */ case IConfig::HttpRestrictedKey: /* --http-no-restricted */ + case IConfig::NoTitleKey: /* --no-title */ return transformBoolean(doc, key, false); default: @@ -298,6 +302,9 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b case IConfig::VerboseKey: /* --verbose */ return set(doc, BaseConfig::kVerbose, enable); + case IConfig::NoTitleKey: /* --no-title */ + return set(doc, BaseConfig::kTitle, enable); + default: break; } diff --git a/src/base/kernel/config/Title.cpp b/src/base/kernel/config/Title.cpp new file mode 100644 index 000000000..1e9c3ce49 --- /dev/null +++ b/src/base/kernel/config/Title.cpp @@ -0,0 +1,58 @@ +/* XMRig + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include "base/kernel/config/Title.h" +#include "3rdparty/rapidjson/document.h" +#include "base/io/Env.h" +#include "version.h" + + +xmrig::Title::Title(const rapidjson::Value &value) +{ + if (value.IsBool()) { + m_enabled = value.GetBool(); + } + else if (value.IsString()) { + m_value = value.GetString(); + } +} + + +rapidjson::Value xmrig::Title::toJSON() const +{ + if (isEnabled() && !m_value.isNull()) { + return m_value.toJSON(); + } + + return rapidjson::Value(m_enabled); +} + + +xmrig::String xmrig::Title::value() const +{ + if (!isEnabled()) { + return {}; + } + + if (m_value.isNull()) { + return APP_NAME " " APP_VERSION; + } + + return Env::expand(m_value); +} diff --git a/src/base/kernel/config/Title.h b/src/base/kernel/config/Title.h new file mode 100644 index 000000000..8cf73f287 --- /dev/null +++ b/src/base/kernel/config/Title.h @@ -0,0 +1,50 @@ +/* XMRig + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef XMRIG_TITLE_H +#define XMRIG_TITLE_H + + +#include "3rdparty/rapidjson/fwd.h" +#include "base/tools/String.h" + + +namespace xmrig { + + +class Title +{ +public: + Title() = default; + Title(const rapidjson::Value &value); + + inline bool isEnabled() const { return m_enabled; } + + rapidjson::Value toJSON() const; + String value() const; + +private: + bool m_enabled = true; + String m_value; +}; + + +} // namespace xmrig + + +#endif /* XMRIG_TITLE_H */ diff --git a/src/base/kernel/interfaces/IConfig.h b/src/base/kernel/interfaces/IConfig.h index 7e5c255d5..0924f1e2a 100644 --- a/src/base/kernel/interfaces/IConfig.h +++ b/src/base/kernel/interfaces/IConfig.h @@ -74,6 +74,8 @@ public: DaemonPollKey = 1019, SelfSelectKey = 1028, DataDirKey = 1035, + TitleKey = 1037, + NoTitleKey = 1038, // xmrig common CPUPriorityKey = 1021, diff --git a/src/config.json b/src/config.json index 447dc87c6..2ab891615 100644 --- a/src/config.json +++ b/src/config.json @@ -13,6 +13,7 @@ "autosave": true, "background": false, "colors": true, + "title": true, "randomx": { "init": -1, "mode": "auto", diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp index 9fc6a830c..81eac42bb 100644 --- a/src/core/config/Config.cpp +++ b/src/core/config/Config.cpp @@ -217,6 +217,7 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const doc.AddMember(StringRef(kAutosave), isAutoSave(), allocator); doc.AddMember(StringRef(kBackground), isBackground(), allocator); doc.AddMember(StringRef(kColors), Log::isColors(), allocator); + doc.AddMember(StringRef(kTitle), title().toJSON(), allocator); # ifdef XMRIG_ALGO_RANDOMX doc.AddMember(StringRef(kRandomX), rx().toJSON(doc), allocator); diff --git a/src/core/config/Config_platform.h b/src/core/config/Config_platform.h index 633973c3d..6125fdd90 100644 --- a/src/core/config/Config_platform.h +++ b/src/core/config/Config_platform.h @@ -90,6 +90,8 @@ static const option options[] = { { "verbose", 0, nullptr, IConfig::VerboseKey }, { "proxy", 1, nullptr, IConfig::ProxyKey }, { "data-dir", 1, nullptr, IConfig::DataDirKey }, + { "title", 1, nullptr, IConfig::TitleKey }, + { "no-title", 0, nullptr, IConfig::NoTitleKey }, # ifdef XMRIG_FEATURE_TLS { "tls", 0, nullptr, IConfig::TlsKey }, { "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey }, diff --git a/src/core/config/usage.h b/src/core/config/usage.h index 8078a081d..e265559b3 100644 --- a/src/core/config/usage.h +++ b/src/core/config/usage.h @@ -168,6 +168,11 @@ static inline const std::string &usage() u += " --export-topology export hwloc topology to a XML file and exit\n"; # endif +# ifdef XMRIG_OS_WIN + u += " --title set custom console window title\n"; + u += " --no-title disable setting console window title\n"; +# endif + return u; } diff --git a/src/crypto/kawpow/KPCache.cpp b/src/crypto/kawpow/KPCache.cpp index 61e1f9cb7..b84f73fd6 100644 --- a/src/crypto/kawpow/KPCache.cpp +++ b/src/crypto/kawpow/KPCache.cpp @@ -1,14 +1,6 @@ /* XMRig - * Copyright 2010 Jeff Garzik - * Copyright 2012-2014 pooler - * Copyright 2014 Lucas Jones - * Copyright 2014-2016 Wolf9466 - * Copyright 2016 Jay D Dee - * Copyright 2017-2019 XMR-Stak , - * Copyright 2018 Lee Clagett - * Copyright 2018-2019 tevador - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +18,8 @@ #include +#include +#include #include "crypto/kawpow/KPCache.h" #include "3rdparty/libethash/data_sizes.h" @@ -83,8 +77,30 @@ bool KPCache::init(uint32_t epoch) cache.num_parent_nodes = cache.cache_size / sizeof(node); calculate_fast_mod_data(cache.num_parent_nodes, cache.reciprocal, cache.increment, cache.shift); - for (uint32_t i = 0; i < sizeof(m_l1Cache) / sizeof(node); ++i) { - ethash_calculate_dag_item_opt(((node*)m_l1Cache) + i, i, num_dataset_parents, &cache); + const uint64_t cache_nodes = (size + sizeof(node) * 4 - 1) / sizeof(node); + m_DAGCache.resize(cache_nodes * (sizeof(node) / sizeof(uint32_t))); + + // Init DAG cache + { + const uint64_t n = std::max(std::thread::hardware_concurrency(), 1U); + + std::vector threads; + threads.reserve(n); + + for (uint64_t i = 0; i < n; ++i) { + const uint32_t a = (cache_nodes * i) / n; + const uint32_t b = (cache_nodes * (i + 1)) / n; + + threads.emplace_back([this, a, b, cache_nodes, &cache]() { + for (uint32_t j = a; j < b; ++j) { + ethash_calculate_dag_item_opt(((node*)m_DAGCache.data()) + j, j, num_dataset_parents, &cache); + } + }); + } + + for (auto& t : threads) { + t.join(); + } } m_size = size; diff --git a/src/crypto/kawpow/KPCache.h b/src/crypto/kawpow/KPCache.h index 3f18b0f50..6f998af3b 100644 --- a/src/crypto/kawpow/KPCache.h +++ b/src/crypto/kawpow/KPCache.h @@ -1,14 +1,6 @@ /* XMRig - * Copyright 2010 Jeff Garzik - * Copyright 2012-2014 pooler - * Copyright 2014 Lucas Jones - * Copyright 2014-2016 Wolf9466 - * Copyright 2016 Jay D Dee - * Copyright 2017-2019 XMR-Stak , - * Copyright 2018 Lee Clagett - * Copyright 2018-2019 tevador * Copyright 2018-2020 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +22,7 @@ #include "base/tools/Object.h" #include +#include namespace xmrig @@ -57,7 +50,7 @@ public: size_t size() const { return m_size; } uint32_t epoch() const { return m_epoch; } - const uint32_t* l1_cache() const { return m_l1Cache; } + const uint32_t* l1_cache() const { return m_DAGCache.data(); } static uint64_t cache_size(uint32_t epoch); static uint64_t dag_size(uint32_t epoch); @@ -71,7 +64,7 @@ private: VirtualMemory* m_memory = nullptr; size_t m_size = 0; uint32_t m_epoch = 0xFFFFFFFFUL; - uint32_t m_l1Cache[l1_cache_num_items] = {}; + std::vector m_DAGCache; }; diff --git a/src/version.h b/src/version.h index 1464c82ac..66a945e56 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig miner" -#define APP_VERSION "6.0.0-beta" +#define APP_VERSION "6.0.1-evo" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 6 #define APP_VER_MINOR 0 -#define APP_VER_PATCH 0 +#define APP_VER_PATCH 1 #ifdef _MSC_VER # if (_MSC_VER >= 1920)