mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-11 05:14:40 +00:00
Merge branch 'dev'
This commit is contained in:
commit
cbd0c45c2b
14 changed files with 81 additions and 40 deletions
|
@ -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`.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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<HttpListener>(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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <thread>
|
||||
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,6 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &benchmark, I
|
|||
m_listener(listener),
|
||||
m_benchmark(benchmark)
|
||||
{
|
||||
m_httpListener = std::make_shared<HttpListener>(this, Tags::bench());
|
||||
|
||||
std::vector<char> blob(112 * 2 + 1, '0');
|
||||
blob.back() = '\0';
|
||||
|
||||
|
@ -47,6 +45,7 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &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<BenchConfig> &benchmark, I
|
|||
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
|
||||
m_job.setId("00000000");
|
||||
|
||||
|
@ -74,7 +74,8 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &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<HttpListener>(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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
//#include <iostream>
|
||||
|
||||
#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 <algorithm>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -68,7 +68,7 @@ constexpr size_t kMsrArraySize = 4;
|
|||
|
||||
static const std::array<MsrItems, kMsrArraySize> 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()
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue