diff --git a/CHANGELOG.md b/CHANGELOG.md index 2edca7013..38bd55f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v6.5.1 +- [#1932](https://github.com/xmrig/xmrig/pull/1932) New MSR mod for Ryzen, up to +3.5% on Zen2 and +1-2% on Zen3. +- [#1918](https://github.com/xmrig/xmrig/issues/1918) Fixed 1GB huge pages support on ARMv8. +- [#1926](https://github.com/xmrig/xmrig/pull/1926) Fixed compilation on ARMv8 with GCC 9.3.0. +- [#1929](https://github.com/xmrig/xmrig/issues/1929) Fixed build without HTTP. + # v6.5.0 - **Added [online benchmark](https://xmrig.com/benchmark) mode for sharing results.** - Added new command line options: `--submit`, ` --verify=ID`, ` --seed=SEED`, `--hash=HASH`. diff --git a/README.md b/README.md index 1077b7c88..6596983e5 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 is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner. Official binaries are available for Windows, Linux, macOS and FreeBSD. +XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner and [RandomX benchmark](https://xmrig.com/benchmark). Official binaries are available for Windows, Linux, macOS and FreeBSD. ## Mining backends - **CPU** (x64/ARMv8) diff --git a/src/backend/common/Benchmark.cpp b/src/backend/common/Benchmark.cpp index dbb45c591..869afb05b 100644 --- a/src/backend/common/Benchmark.cpp +++ b/src/backend/common/Benchmark.cpp @@ -55,9 +55,11 @@ xmrig::Benchmark::Benchmark(const Job &job, size_t workers, const IBackend *back m_end(job.benchSize()), m_hash(job.benchHash()) { +# ifdef XMRIG_FEATURE_HTTP if (!m_token.isEmpty()) { m_httpListener = std::make_shared(this, Tags::bench()); } +# endif } @@ -76,6 +78,7 @@ bool xmrig::Benchmark::finish(uint64_t totalHashCount) LOG_NOTICE("%s " WHITE_BOLD("benchmark finished in ") CYAN_BOLD("%.3f seconds") WHITE_BOLD_S " hash sum = " CLEAR "%s%016" PRIX64 CLEAR, Tags::bench(), dt, color, m_data); +# ifdef XMRIG_FEATURE_HTTP if (!m_token.isEmpty()) { using namespace rapidjson; @@ -84,11 +87,13 @@ bool xmrig::Benchmark::finish(uint64_t totalHashCount) doc.AddMember("steady_done_ts", m_doneTime, allocator); doc.AddMember(StringRef(BenchConfig::kHash), Value(fmt::format("{:016X}", m_data).c_str(), allocator), allocator); - doc.AddMember("backend", m_backend->toJSON(doc), allocator); + doc.AddMember("backend", m_backend->toJSON(doc), allocator); // FIXME send(doc); } - else { + else +# endif + { printExit(); } @@ -100,6 +105,7 @@ void xmrig::Benchmark::start() { m_startTime = Chrono::steadyMSecs(); +# ifdef XMRIG_FEATURE_HTTP if (!m_token.isEmpty()) { using namespace rapidjson; @@ -108,6 +114,7 @@ void xmrig::Benchmark::start() send(doc); } +# endif } @@ -145,6 +152,7 @@ void xmrig::Benchmark::tick(IWorker *worker) void xmrig::Benchmark::onHttpData(const HttpData &data) { +# ifdef XMRIG_FEATURE_HTTP rapidjson::Document doc; try { @@ -161,6 +169,7 @@ void xmrig::Benchmark::onHttpData(const HttpData &data) LOG_NOTICE("%s " WHITE_BOLD("benchmark submitted ") CYAN_BOLD("https://xmrig.com/benchmark/%s"), Tags::bench(), m_id.data()); printExit(); } +# endif } @@ -170,9 +179,11 @@ uint64_t xmrig::Benchmark::referenceHash() const return m_hash; } +# ifdef XMRIG_FEATURE_HTTP if (!m_token.isEmpty()) { return 0; } +# endif const uint32_t N = (m_end / 1000000) - 1; if (((m_algo == Algorithm::RX_0) || (m_algo == Algorithm::RX_WOW)) && ((m_end % 1000000) == 0) && (N < 10)) { @@ -189,6 +200,7 @@ void xmrig::Benchmark::printExit() } +#ifdef XMRIG_FEATURE_HTTP void xmrig::Benchmark::send(const rapidjson::Value &body) { FetchRequest req(HTTP_PATCH, BenchConfig::kApiHost, BenchConfig::kApiPort, fmt::format("/1/benchmark/{}", m_id).c_str(), body, BenchConfig::kApiTLS, true); @@ -202,3 +214,4 @@ void xmrig::Benchmark::setError(const char *message) { LOG_ERR("%s " RED("benchmark failed ") RED_BOLD("\"%s\""), Tags::bench(), message); } +#endif diff --git a/src/backend/common/Benchmark.h b/src/backend/common/Benchmark.h index 0e3881814..b13748b46 100644 --- a/src/backend/common/Benchmark.h +++ b/src/backend/common/Benchmark.h @@ -56,8 +56,11 @@ protected: private: uint64_t referenceHash() const; void printExit(); + +# ifdef XMRIG_FEATURE_HTTP void send(const rapidjson::Value &body); void setError(const char *message); +# endif bool m_reset = false; const Algorithm m_algo; diff --git a/src/backend/cpu/platform/BasicCpuInfo_arm.cpp b/src/backend/cpu/platform/BasicCpuInfo_arm.cpp index 41e8d2f47..a2b336a5d 100644 --- a/src/backend/cpu/platform/BasicCpuInfo_arm.cpp +++ b/src/backend/cpu/platform/BasicCpuInfo_arm.cpp @@ -22,6 +22,7 @@ #include #include +#include #include @@ -66,6 +67,8 @@ xmrig::BasicCpuInfo::BasicCpuInfo() : if (!name.isNull()) { strncpy(m_brand, name, sizeof(m_brand) - 1); } + + m_flags.set(FLAG_PDPE1GB, std::ifstream("/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages").good()); # endif } diff --git a/src/base/net/stratum/benchmark/BenchClient.cpp b/src/base/net/stratum/benchmark/BenchClient.cpp index be16e3fed..51181cf8d 100644 --- a/src/base/net/stratum/benchmark/BenchClient.cpp +++ b/src/base/net/stratum/benchmark/BenchClient.cpp @@ -35,8 +35,6 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr &benchmark, I m_listener(listener), m_benchmark(benchmark) { - m_httpListener = std::make_shared(this, Tags::bench()); - std::vector blob(112 * 2 + 1, '0'); blob.back() = '\0'; @@ -47,6 +45,7 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr &benchmark, I m_job.setBenchSize(m_benchmark->size()); m_job.setBenchHash(m_benchmark->hash()); +# ifdef XMRIG_FEATURE_HTTP if (m_benchmark->isSubmit()) { m_mode = ONLINE_BENCH; @@ -59,6 +58,7 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr &benchmark, I return; } +# endif m_job.setId("00000000"); @@ -74,7 +74,8 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr &benchmark, I void xmrig::BenchClient::connect() -{ +{ +# ifdef XMRIG_FEATURE_HTTP switch (m_mode) { case STATIC_BENCH: case STATIC_VERIFY: @@ -86,6 +87,9 @@ void xmrig::BenchClient::connect() case ONLINE_VERIFY: return getBench(); } +# else + start(); +# endif } @@ -97,6 +101,7 @@ void xmrig::BenchClient::setPool(const Pool &pool) void xmrig::BenchClient::onHttpData(const HttpData &data) { +# ifdef XMRIG_FEATURE_HTTP rapidjson::Document doc; try { @@ -115,11 +120,23 @@ void xmrig::BenchClient::onHttpData(const HttpData &data) else { startVerify(doc); } +# endif } +void xmrig::BenchClient::start() +{ + m_listener->onLoginSuccess(this); + m_listener->onJobReceived(this, m_job, rapidjson::Value()); +} + + + +#ifdef XMRIG_FEATURE_HTTP void xmrig::BenchClient::createBench() { + createHttpListener(); + using namespace rapidjson; Document doc(kObjectType); @@ -135,8 +152,18 @@ void xmrig::BenchClient::createBench() } +void xmrig::BenchClient::createHttpListener() +{ + if (!m_httpListener) { + m_httpListener = std::make_shared(this, Tags::bench()); + } +} + + void xmrig::BenchClient::getBench() { + createHttpListener(); + FetchRequest req(HTTP_GET, BenchConfig::kApiHost, BenchConfig::kApiPort, fmt::format("/1/benchmark/{}", m_job.id()).c_str(), BenchConfig::kApiTLS, true); fetch(std::move(req), m_httpListener); } @@ -148,13 +175,6 @@ void xmrig::BenchClient::setError(const char *message) } -void xmrig::BenchClient::start() -{ - m_listener->onLoginSuccess(this); - m_listener->onJobReceived(this, m_job, rapidjson::Value()); -} - - void xmrig::BenchClient::startBench(const rapidjson::Value &value) { m_job.setId(Json::getString(value, BenchConfig::kId)); @@ -178,3 +198,4 @@ void xmrig::BenchClient::startVerify(const rapidjson::Value &value) start(); } +#endif diff --git a/src/base/net/stratum/benchmark/BenchClient.h b/src/base/net/stratum/benchmark/BenchClient.h index f9070b346..64bb481b8 100644 --- a/src/base/net/stratum/benchmark/BenchClient.h +++ b/src/base/net/stratum/benchmark/BenchClient.h @@ -75,12 +75,16 @@ private: ONLINE_VERIFY }; + void start(); + +# ifdef XMRIG_FEATURE_HTTP void createBench(); + void createHttpListener(); void getBench(); void setError(const char *message); - void start(); void startBench(const rapidjson::Value &value); void startVerify(const rapidjson::Value &value); +# endif IClientListener* m_listener; Job m_job; diff --git a/src/core/config/Config_platform.h b/src/core/config/Config_platform.h index fddf28a45..452bdd453 100644 --- a/src/core/config/Config_platform.h +++ b/src/core/config/Config_platform.h @@ -100,8 +100,10 @@ static const option options[] = { { "stress", 0, nullptr, IConfig::StressKey }, { "bench", 1, nullptr, IConfig::BenchKey }, { "benchmark", 1, nullptr, IConfig::BenchKey }, +# ifdef XMRIG_FEATURE_HTTP { "submit", 0, nullptr, IConfig::BenchSubmitKey }, { "verify", 1, nullptr, IConfig::BenchVerifyKey }, +# endif { "seed", 1, nullptr, IConfig::BenchSeedKey }, { "hash", 1, nullptr, IConfig::BenchHashKey }, # endif diff --git a/src/core/config/usage.h b/src/core/config/usage.h index 58cb09370..54e629ecb 100644 --- a/src/core/config/usage.h +++ b/src/core/config/usage.h @@ -182,8 +182,10 @@ static inline const std::string &usage() # ifdef XMRIG_FEATURE_BENCHMARK u += " --stress run continuous stress test to check system stability\n"; u += " --bench=N run benchmark, N can be between 1M and 10M\n"; +# ifdef XMRIG_FEATURE_HTTP u += " --submit perform an online benchmark and submit result for sharing\n"; u += " --verify=ID verify submitted benchmark by ID\n"; +# endif u += " --seed=SEED custom RandomX seed for benchmark\n"; u += " --hash=HASH compare benchmark result with specified hash\n"; # endif diff --git a/src/crypto/common/LinuxMemory.cpp b/src/crypto/common/LinuxMemory.cpp index b7c2000f9..297992a27 100644 --- a/src/crypto/common/LinuxMemory.cpp +++ b/src/crypto/common/LinuxMemory.cpp @@ -1,12 +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-2018 XMR-Stak , - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright (c) 2018-2020 SChernykh + * Copyright (c) 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 @@ -22,19 +16,17 @@ * along with this program. If not, see . */ - -//#include - #include "crypto/common/LinuxMemory.h" +#include "3rdparty/fmt/core.h" +#include "backend/cpu/Cpu.h" #include "base/io/log/Log.h" #include "crypto/common/VirtualMemory.h" -#include "backend/cpu/Cpu.h" #include #include -#include #include +#include namespace xmrig { @@ -47,7 +39,7 @@ constexpr size_t oneGiB = 1024U * 1024U * 1024U; static inline std::string sysfs_path(uint32_t node, bool oneGbPages, bool nr) { - return "/sys/devices/system/node/node" + std::to_string(node) + "/hugepages/hugepages-" + (oneGbPages ? "1048576" : "2048") + "kB/" + (nr ? "nr" : "free") + "_hugepages"; + return fmt::format("/sys/devices/system/node/node{}/hugepages/hugepages-{}kB/{}_hugepages", node, oneGbPages ? "1048576" : "2048", nr ? "nr" : "free"); } diff --git a/src/crypto/common/LinuxMemory.h b/src/crypto/common/LinuxMemory.h index aa46a6fcd..8f75f00ea 100644 --- a/src/crypto/common/LinuxMemory.h +++ b/src/crypto/common/LinuxMemory.h @@ -1,12 +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-2018 XMR-Stak , - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright (c) 2018-2020 SChernykh + * Copyright (c) 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 diff --git a/src/crypto/rx/RxConfig.cpp b/src/crypto/rx/RxConfig.cpp index cb90892fa..d35be18d1 100644 --- a/src/crypto/rx/RxConfig.cpp +++ b/src/crypto/rx/RxConfig.cpp @@ -68,7 +68,7 @@ constexpr size_t kMsrArraySize = 4; static const std::array msrPresets = { MsrItems(), - MsrItems{{ 0xC0011020, 0x0 }, { 0xC0011021, 0x40, ~0x20ULL }, { 0xC0011022, 0x510000 }, { 0xC001102b, 0x1808cc16 }}, + MsrItems{{ 0xC0011020, 0x0004480000000000ULL }, { 0xC0011021, 0x001c000200000040ULL, ~0x20ULL }, { 0xC0011022, 0xc000000401500000ULL }, { 0xC001102b, 0x2000cc14ULL }}, MsrItems{{ 0x1a4, 0xf }}, MsrItems() }; diff --git a/src/crypto/rx/RxDataset.cpp b/src/crypto/rx/RxDataset.cpp index 03b0f1559..c207d6f47 100644 --- a/src/crypto/rx/RxDataset.cpp +++ b/src/crypto/rx/RxDataset.cpp @@ -174,7 +174,8 @@ void xmrig::RxDataset::setRaw(const void *raw) return; } - memcpy(randomx_get_dataset_memory(m_dataset), raw, maxSize()); + volatile size_t N = maxSize(); + memcpy(randomx_get_dataset_memory(m_dataset), raw, N); } diff --git a/src/version.h b/src/version.h index 9d993a9a2..2ad698d69 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.5.0" +#define APP_VERSION "6.5.1-dev" #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 5 -#define APP_VER_PATCH 0 +#define APP_VER_PATCH 1 #ifdef _MSC_VER # if (_MSC_VER >= 1920)