Merged v4.3.0-beta
This commit is contained in:
commit
fe76800fc8
101 changed files with 10318 additions and 7615 deletions
|
@ -125,6 +125,7 @@ float Benchmark::get_algo_perf(Algorithm::Id algo) const {
|
|||
case Algorithm::RX_LOKI: return m_bench_algo_perf[BenchAlgo::RX_LOKI];
|
||||
case Algorithm::RX_WOW: return m_bench_algo_perf[BenchAlgo::RX_WOW];
|
||||
case Algorithm::DEFYX: return m_bench_algo_perf[BenchAlgo::DEFYX];
|
||||
case Algorithm::RX_ARQ: return m_bench_algo_perf[BenchAlgo::RX_ARQ];
|
||||
case Algorithm::AR2_CHUKWA: return m_bench_algo_perf[BenchAlgo::AR2_CHUKWA];
|
||||
case Algorithm::AR2_WRKZ: return m_bench_algo_perf[BenchAlgo::AR2_WRKZ];
|
||||
default: return 0.0f;
|
||||
|
|
|
@ -35,6 +35,7 @@ class Benchmark : public IJobResultListener {
|
|||
RX_LOKI, // "rx/loki" RandomXL (Loki).
|
||||
RX_WOW, // "rx/wow" RandomWOW (Wownero).
|
||||
DEFYX, // "defyx DefyX.
|
||||
RX_ARQ, // "rx/arq" RandomARQ (Arqma).
|
||||
CN_R, // "cn/r" CryptoNightR (Monero's variant 4).
|
||||
CN_GPU, // "cn/gpu" CryptoNight-GPU (Ryo).
|
||||
CN_LITE_1, // "cn-lite/1" CryptoNight-Lite variant 1.
|
||||
|
@ -51,6 +52,7 @@ class Benchmark : public IJobResultListener {
|
|||
Algorithm::RX_LOKI,
|
||||
Algorithm::RX_WOW,
|
||||
Algorithm::DEFYX,
|
||||
Algorithm::RX_ARQ,
|
||||
Algorithm::CN_R,
|
||||
Algorithm::CN_GPU,
|
||||
Algorithm::CN_LITE_1,
|
||||
|
|
|
@ -23,15 +23,17 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "core/Controller.h"
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Miner.h"
|
||||
#include "crypto/common/VirtualMemory.h"
|
||||
#include "net/Network.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
xmrig::Controller::Controller(Process *process) :
|
||||
Base(process)
|
||||
{
|
||||
|
@ -41,6 +43,8 @@ xmrig::Controller::Controller(Process *process) :
|
|||
xmrig::Controller::~Controller()
|
||||
{
|
||||
delete m_network;
|
||||
|
||||
VirtualMemory::destroy();
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,7 +52,10 @@ int xmrig::Controller::init()
|
|||
{
|
||||
Base::init();
|
||||
|
||||
VirtualMemory::init(config()->cpu().memPoolSize(), config()->cpu().isHugePages());
|
||||
|
||||
m_network = new Network(this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,12 +72,8 @@ class MinerPrivate
|
|||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(MinerPrivate)
|
||||
|
||||
inline MinerPrivate(Controller *controller) : controller(controller)
|
||||
{
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
Rx::init();
|
||||
# endif
|
||||
}
|
||||
|
||||
inline MinerPrivate(Controller *controller) : controller(controller) {}
|
||||
|
||||
|
||||
inline ~MinerPrivate()
|
||||
|
@ -232,9 +228,9 @@ public:
|
|||
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
bool initRX(IRxListener *listener)
|
||||
inline bool initRX()
|
||||
{
|
||||
return Rx::init(job, controller->config()->rx().threads(), controller->config()->cpu().isHugePages(), controller->config()->rx().isNUMA(), listener);
|
||||
return Rx::init(job, controller->config()->rx(), controller->config()->cpu().isHugePages());
|
||||
}
|
||||
# endif
|
||||
|
||||
|
@ -261,6 +257,10 @@ public:
|
|||
xmrig::Miner::Miner(Controller *controller)
|
||||
: d_ptr(new MinerPrivate(controller))
|
||||
{
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
Rx::init(this);
|
||||
# endif
|
||||
|
||||
controller->addListener(this);
|
||||
|
||||
# ifdef XMRIG_FEATURE_API
|
||||
|
@ -402,7 +402,7 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
|
|||
}
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
const bool ready = d_ptr->initRX(this);
|
||||
const bool ready = d_ptr->initRX();
|
||||
# else
|
||||
constexpr const bool ready = true;
|
||||
# endif
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "base/api/interfaces/IApiListener.h"
|
||||
#include "base/kernel/interfaces/IBaseListener.h"
|
||||
#include "base/kernel/interfaces/ITimerListener.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "crypto/common/Algorithm.h"
|
||||
|
||||
|
||||
|
@ -48,6 +49,8 @@ class IBackend;
|
|||
class Miner : public ITimerListener, public IBaseListener, public IApiListener, public IRxListener
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Miner)
|
||||
|
||||
Miner(Controller *controller);
|
||||
~Miner() override;
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <uv.h>
|
||||
#include <inttypes.h>
|
||||
#include <cinttypes>
|
||||
|
||||
|
||||
#include "backend/cpu/Cpu.h"
|
||||
|
@ -50,8 +50,7 @@
|
|||
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kCPU = "cpu";
|
||||
static constexpr const uint32_t kVersion = 1;
|
||||
static const char *kCPU = "cpu";
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
static const char *kRandomX = "randomx";
|
||||
|
@ -79,7 +78,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
xmrig::Config::Config() : BaseConfig(),
|
||||
xmrig::Config::Config() :
|
||||
d_ptr(new ConfigPrivate())
|
||||
{
|
||||
}
|
||||
|
@ -119,10 +118,6 @@ bool xmrig::Config::isShouldSave() const
|
|||
return false;
|
||||
}
|
||||
|
||||
if (version() < kVersion) {
|
||||
return true;
|
||||
}
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
if (cl().isShouldSave()) {
|
||||
return true;
|
||||
|
@ -139,7 +134,7 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
|
|||
return false;
|
||||
}
|
||||
|
||||
d_ptr->cpu.read(reader.getValue(kCPU), version());
|
||||
d_ptr->cpu.read(reader.getValue(kCPU));
|
||||
m_benchmark.read(reader.getValue("algo-perf"));
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
|
@ -171,7 +166,6 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
|||
doc.AddMember("api", api, allocator);
|
||||
doc.AddMember("http", m_http.toJSON(doc), allocator);
|
||||
doc.AddMember("autosave", isAutoSave(), allocator);
|
||||
doc.AddMember("version", kVersion, allocator);
|
||||
doc.AddMember("background", isBackground(), allocator);
|
||||
doc.AddMember("colors", Log::colors, allocator);
|
||||
|
||||
|
|
|
@ -26,11 +26,12 @@
|
|||
#define XMRIG_CONFIG_H
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
#include "backend/cpu/CpuConfig.h"
|
||||
#include "base/kernel/config/BaseConfig.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "core/Benchmark.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
@ -47,6 +48,8 @@ class OclConfig;
|
|||
class Config : public BaseConfig
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE(Config);
|
||||
|
||||
Config();
|
||||
~Config() override;
|
||||
|
||||
|
|
|
@ -141,6 +141,10 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||
case IConfig::CPUMaxThreadsKey: /* --cpu-max-threads-hint */
|
||||
return set(doc, kCpu, "max-threads-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||
|
||||
case IConfig::MemoryPoolKey: /* --cpu-memory-pool */
|
||||
return set(doc, kCpu, "memory-pool", static_cast<int64_t>(strtol(arg, nullptr, 10)));
|
||||
break;
|
||||
|
||||
# ifdef XMRIG_FEATURE_ASM
|
||||
case IConfig::AssemblyKey: /* --asm */
|
||||
return set(doc, kCpu, "asm", arg);
|
||||
|
|
|
@ -57,6 +57,7 @@ R"===(
|
|||
"huge-pages": true,
|
||||
"hw-aes": null,
|
||||
"priority": null,
|
||||
"memory-pool": false,
|
||||
"max-threads-hint": 100,
|
||||
"asm": true,
|
||||
"argon2-impl": null,
|
||||
|
|
|
@ -86,6 +86,7 @@ static const option options[] = {
|
|||
{ "no-cpu", 0, nullptr, IConfig::CPUKey },
|
||||
{ "max-cpu-usage", 1, nullptr, IConfig::CPUMaxThreadsKey },
|
||||
{ "cpu-max-threads-hint", 1, nullptr, IConfig::CPUMaxThreadsKey },
|
||||
{ "cpu-memory-pool", 1, nullptr, IConfig::MemoryPoolKey },
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
{ "tls", 0, nullptr, IConfig::TlsKey },
|
||||
{ "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey },
|
||||
|
|
|
@ -46,6 +46,7 @@ static inline const std::string &usage()
|
|||
u += "Usage: " APP_ID " [OPTIONS]\n\nNetwork:\n";
|
||||
u += " -o, --url=URL URL of mining server\n";
|
||||
u += " -a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms\n";
|
||||
u += " --coin=COIN specify coin instead of algorithm\n";
|
||||
u += " -u, --user=USERNAME username for mining server\n";
|
||||
u += " -p, --pass=PASSWORD password for mining server\n";
|
||||
u += " -O, --userpass=U:P username:password pair for mining server\n";
|
||||
|
@ -77,6 +78,7 @@ static inline const std::string &usage()
|
|||
u += " --cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1\n";
|
||||
u += " --cpu-priority set process priority (0 idle, 2 normal to 5 highest)\n";
|
||||
u += " --cpu-max-threads-hint=N maximum CPU threads count (in percentage) hint for autoconfig\n";
|
||||
u += " --cpu-memory-pool=N number of 2 MB pages for persistent memory pool, -1 (auto), 0 (disable)\n";
|
||||
u += " --no-huge-pages disable huge pages support\n";
|
||||
u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue