diff --git a/src/base/kernel/interfaces/IConfig.h b/src/base/kernel/interfaces/IConfig.h index 2697bf01..86b8067c 100644 --- a/src/base/kernel/interfaces/IConfig.h +++ b/src/base/kernel/interfaces/IConfig.h @@ -83,8 +83,9 @@ public: DryRunKey = 5000, HugePagesKey = 1009, ThreadsKey = 't', -// HardwareAESKey = 1011, AssemblyKey = 1015, + RandomXInitKey = 1022, + RandomXNumaKey = 1023, // xmrig amd OclPlatformKey = 1400, diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp index 34221e35..44aa6029 100644 --- a/src/core/config/Config.cpp +++ b/src/core/config/Config.cpp @@ -41,7 +41,10 @@ namespace xmrig { static const char *kCPU = "cpu"; + +#ifdef XMRIG_ALGO_RANDOMX static const char *kRandomX = "randomx"; +#endif } diff --git a/src/core/config/ConfigTransform.cpp b/src/core/config/ConfigTransform.cpp index 38bb42a1..6d420739 100644 --- a/src/core/config/ConfigTransform.cpp +++ b/src/core/config/ConfigTransform.cpp @@ -36,6 +36,7 @@ static const char *kAffinity = "affinity"; static const char *kAsterisk = "*"; static const char *kCpu = "cpu"; static const char *kIntensity = "intensity"; +static const char *kRandomX = "randomx"; static inline uint64_t intensity(uint64_t av) @@ -165,6 +166,14 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const return set(doc, kCpu, "asm", arg); # endif +# ifdef XMRIG_ALGO_RANDOMX + case IConfig::RandomXInitKey: /* --randomx-init */ + return set(doc, kRandomX, "init", static_cast(strtol(arg, nullptr, 10))); + + case IConfig::RandomXNumaKey: /* --randomx-no-numa */ + return set(doc, kRandomX, "numa", false); +# endif + default: break; } diff --git a/src/core/config/Config_platform.h b/src/core/config/Config_platform.h index fdd15c96..b7415f4d 100644 --- a/src/core/config/Config_platform.h +++ b/src/core/config/Config_platform.h @@ -81,6 +81,8 @@ static const option options[] = { { "asm", 1, nullptr, IConfig::AssemblyKey }, { "daemon", 0, nullptr, IConfig::DaemonKey }, { "daemon-poll-interval", 1, nullptr, IConfig::DaemonPollKey }, + { "randomx-init", 1, nullptr, IConfig::RandomXInitKey }, + { "randomx-no-numa", 0, nullptr, IConfig::RandomXNumaKey }, { nullptr, 0, nullptr, 0 } }; diff --git a/src/core/config/usage.h b/src/core/config/usage.h index 2d0d5623..275a58f9 100644 --- a/src/core/config/usage.h +++ b/src/core/config/usage.h @@ -108,6 +108,11 @@ Options:\n\ --http-access-token=T access token for HTTP API\n\ --http-no-restricted enable full remote access to HTTP API (only if access token set)\n" #endif +#ifdef XMRIG_ALGO_RANDOMX +"\ + --randomx-init=N threads count to initialize RandomX dataset\n\ + --randomx-no-numa disable NUMA support for RandomX\n" +#endif "\ --dry-run test configuration and exit\n\ -h, --help display this help and exit\n\