mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 12:09:22 +00:00
Merge branch 'dev'
This commit is contained in:
commit
70dbe8562c
36 changed files with 306 additions and 151 deletions
|
@ -1,3 +1,7 @@
|
|||
# v6.3.1
|
||||
- [#1786](https://github.com/xmrig/xmrig/pull/1786) Added `pause-on-battery` option, supported on Windows and Linux.
|
||||
- Added command line options `--randomx-cache-qos` and `--argon2-impl`.
|
||||
|
||||
# v6.3.0
|
||||
- [#1771](https://github.com/xmrig/xmrig/pull/1771) Adopted new SSE2NEON and reduced ARM-specific changes.
|
||||
- [#1774](https://github.com/xmrig/xmrig/pull/1774) RandomX: Added new option `cache_qos` in `randomx` object for cache QoS support.
|
||||
|
|
|
@ -60,6 +60,9 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
|||
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Ob1 /GL")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Ob1 /GL")
|
||||
|
||||
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(/D_CRT_NONSTDC_NO_WARNINGS)
|
||||
add_definitions(/DNOMINMAX)
|
||||
|
|
|
@ -47,11 +47,6 @@ const char *cuda_tag();
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
const char *rx_tag();
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "backend/cpu/CpuThreads.h"
|
||||
#include "base/crypto/Algorithm.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "crypto/common/Assembly.h"
|
||||
|
||||
|
||||
|
@ -37,6 +38,8 @@ namespace xmrig {
|
|||
class ICpuInfo
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE(ICpuInfo)
|
||||
|
||||
enum Vendor : uint32_t {
|
||||
VENDOR_UNKNOWN,
|
||||
VENDOR_INTEL,
|
||||
|
@ -66,6 +69,7 @@ public:
|
|||
FLAG_MAX
|
||||
};
|
||||
|
||||
ICpuInfo() = default;
|
||||
virtual ~ICpuInfo() = default;
|
||||
|
||||
# if defined(__x86_64__) || defined(_M_AMD64) || defined (__arm64__) || defined (__aarch64__)
|
||||
|
|
|
@ -135,6 +135,12 @@ static AlgoName const algorithm_names[] = {
|
|||
} /* namespace xmrig */
|
||||
|
||||
|
||||
xmrig::Algorithm::Algorithm(const rapidjson::Value &value) :
|
||||
m_id(parse(value.GetString()))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::Algorithm::toJSON() const
|
||||
{
|
||||
using namespace rapidjson;
|
||||
|
@ -143,6 +149,12 @@ rapidjson::Value xmrig::Algorithm::toJSON() const
|
|||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::Algorithm::toJSON(rapidjson::Document &) const
|
||||
{
|
||||
return toJSON();
|
||||
}
|
||||
|
||||
|
||||
size_t xmrig::Algorithm::l2() const
|
||||
{
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
|
|
|
@ -92,6 +92,7 @@ public:
|
|||
inline Algorithm() = default;
|
||||
inline Algorithm(const char *algo) : m_id(parse(algo)) {}
|
||||
inline Algorithm(Id id) : m_id(id) {}
|
||||
Algorithm(const rapidjson::Value &value);
|
||||
|
||||
inline bool isCN() const { auto f = family(); return f == CN || f == CN_LITE || f == CN_HEAVY || f == CN_PICO; }
|
||||
inline bool isEqual(const Algorithm &other) const { return m_id == other.m_id; }
|
||||
|
@ -108,6 +109,7 @@ public:
|
|||
inline operator Algorithm::Id() const { return m_id; }
|
||||
|
||||
rapidjson::Value toJSON() const;
|
||||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||
size_t l2() const;
|
||||
size_t l3() const;
|
||||
uint32_t maxIntensity() const;
|
||||
|
|
|
@ -54,6 +54,8 @@ public:
|
|||
|
||||
static inline const char *userAgent() { return m_userAgent; }
|
||||
|
||||
static bool isOnBatteryPower();
|
||||
|
||||
private:
|
||||
static char *createUserAgent();
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <sys/resource.h>
|
||||
#include <uv.h>
|
||||
#include <thread>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
#include "base/kernel/Platform.h"
|
||||
|
@ -107,3 +108,18 @@ void xmrig::Platform::setThreadPriority(int priority)
|
|||
setpriority(PRIO_PROCESS, 0, prio);
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Platform::isOnBatteryPower()
|
||||
{
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
char buf[64];
|
||||
snprintf(buf, 64, "/sys/class/power_supply/BAT%d/status", i);
|
||||
std::ifstream f(buf);
|
||||
if (f.is_open()) {
|
||||
std::string status;
|
||||
f >> status;
|
||||
return (status == "Discharging");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <unistd.h>
|
||||
#include <uv.h>
|
||||
#include <thread>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
#include "base/kernel/Platform.h"
|
||||
|
@ -146,3 +147,19 @@ void xmrig::Platform::setThreadPriority(int priority)
|
|||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Platform::isOnBatteryPower()
|
||||
{
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
char buf[64];
|
||||
snprintf(buf, 64, "/sys/class/power_supply/BAT%d/status", i);
|
||||
std::ifstream f(buf);
|
||||
if (f.is_open()) {
|
||||
std::string status;
|
||||
f >> status;
|
||||
return (status == "Discharging");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -157,3 +157,12 @@ void xmrig::Platform::setThreadPriority(int priority)
|
|||
SetThreadPriority(GetCurrentThread(), prio);
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Platform::isOnBatteryPower()
|
||||
{
|
||||
SYSTEM_POWER_STATUS st;
|
||||
if (GetSystemPowerStatus(&st)) {
|
||||
return (st.ACLineStatus == 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ const char *BaseConfig::kColors = "colors";
|
|||
const char *BaseConfig::kDryRun = "dry-run";
|
||||
const char *BaseConfig::kHttp = "http";
|
||||
const char *BaseConfig::kLogFile = "log-file";
|
||||
const char *BaseConfig::kPauseOnBattery = "pause-on-battery";
|
||||
const char *BaseConfig::kPrintTime = "print-time";
|
||||
const char *BaseConfig::kSyslog = "syslog";
|
||||
const char *BaseConfig::kTitle = "title";
|
||||
|
@ -85,15 +86,16 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName)
|
|||
return false;
|
||||
}
|
||||
|
||||
m_autoSave = reader.getBool(kAutosave, m_autoSave);
|
||||
m_background = reader.getBool(kBackground, m_background);
|
||||
m_dryRun = reader.getBool(kDryRun, m_dryRun);
|
||||
m_syslog = reader.getBool(kSyslog, m_syslog);
|
||||
m_watch = reader.getBool(kWatch, m_watch);
|
||||
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);
|
||||
m_autoSave = reader.getBool(kAutosave, m_autoSave);
|
||||
m_background = reader.getBool(kBackground, m_background);
|
||||
m_dryRun = reader.getBool(kDryRun, m_dryRun);
|
||||
m_syslog = reader.getBool(kSyslog, m_syslog);
|
||||
m_watch = reader.getBool(kWatch, m_watch);
|
||||
m_pauseOnBattery = reader.getBool(kPauseOnBattery, m_pauseOnBattery);
|
||||
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);
|
||||
|
|
|
@ -55,6 +55,7 @@ public:
|
|||
static const char *kDryRun;
|
||||
static const char *kHttp;
|
||||
static const char *kLogFile;
|
||||
static const char *kPauseOnBattery;
|
||||
static const char *kPrintTime;
|
||||
static const char *kSyslog;
|
||||
static const char *kTitle;
|
||||
|
@ -71,6 +72,7 @@ public:
|
|||
inline bool isAutoSave() const { return m_autoSave; }
|
||||
inline bool isBackground() const { return m_background; }
|
||||
inline bool isDryRun() const { return m_dryRun; }
|
||||
inline bool isPauseOnBattery() const { return m_pauseOnBattery; }
|
||||
inline bool isSyslog() const { return m_syslog; }
|
||||
inline const char *logFile() const { return m_logFile.data(); }
|
||||
inline const char *userAgent() const { return m_userAgent.data(); }
|
||||
|
@ -95,12 +97,13 @@ public:
|
|||
void printVersions();
|
||||
|
||||
protected:
|
||||
bool m_autoSave = true;
|
||||
bool m_background = false;
|
||||
bool m_dryRun = false;
|
||||
bool m_syslog = false;
|
||||
bool m_upgrade = false;
|
||||
bool m_watch = true;
|
||||
bool m_autoSave = true;
|
||||
bool m_background = false;
|
||||
bool m_dryRun = false;
|
||||
bool m_pauseOnBattery = false;
|
||||
bool m_syslog = false;
|
||||
bool m_upgrade = false;
|
||||
bool m_watch = true;
|
||||
Http m_http;
|
||||
Pools m_pools;
|
||||
String m_apiId;
|
||||
|
|
|
@ -247,6 +247,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
|||
case IConfig::HttpEnabledKey: /* --http-enabled */
|
||||
case IConfig::DaemonKey: /* --daemon */
|
||||
case IConfig::VerboseKey: /* --verbose */
|
||||
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
|
||||
return transformBoolean(doc, key, true);
|
||||
|
||||
case IConfig::ColorKey: /* --no-color */
|
||||
|
@ -305,6 +306,9 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
|
|||
case IConfig::NoTitleKey: /* --no-title */
|
||||
return set(doc, BaseConfig::kTitle, enable);
|
||||
|
||||
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
|
||||
return set(doc, BaseConfig::kPauseOnBattery, enable);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
DataDirKey = 1035,
|
||||
TitleKey = 1037,
|
||||
NoTitleKey = 1038,
|
||||
PauseOnBatteryKey = 1041,
|
||||
|
||||
// xmrig common
|
||||
CPUPriorityKey = 1021,
|
||||
|
@ -101,6 +102,8 @@ public:
|
|||
YieldKey = 1030,
|
||||
AstroBWTMaxSizeKey = 1034,
|
||||
AstroBWTAVX2Key = 1036,
|
||||
Argon2ImplKey = 1039,
|
||||
RandomXCacheQoSKey = 1040,
|
||||
|
||||
// xmrig amd
|
||||
OclPlatformKey = 1400,
|
||||
|
|
|
@ -91,5 +91,6 @@
|
|||
},
|
||||
"user-agent": null,
|
||||
"verbose": 0,
|
||||
"watch": true
|
||||
"watch": true,
|
||||
"pause-on-battery": false
|
||||
}
|
||||
|
|
|
@ -287,6 +287,7 @@ public:
|
|||
bool active = false;
|
||||
bool enabled = true;
|
||||
bool reset = true;
|
||||
bool battery_power = false;
|
||||
Controller *controller;
|
||||
Job job;
|
||||
mutable std::map<Algorithm::Id, double> maxHashrate;
|
||||
|
@ -429,13 +430,24 @@ void xmrig::Miner::setEnabled(bool enabled)
|
|||
return;
|
||||
}
|
||||
|
||||
if (d_ptr->battery_power && enabled) {
|
||||
LOG_INFO("%s " YELLOW_BOLD("can't resume while on battery power"), Tags::miner());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
d_ptr->enabled = enabled;
|
||||
|
||||
if (enabled) {
|
||||
LOG_INFO(GREEN_BOLD("resumed"));
|
||||
LOG_INFO("%s " GREEN_BOLD("resumed"), Tags::miner());
|
||||
}
|
||||
else {
|
||||
LOG_INFO(YELLOW_BOLD("paused") ", press " MAGENTA_BG_BOLD(" r ") " to resume");
|
||||
if (d_ptr->battery_power) {
|
||||
LOG_INFO("%s " YELLOW_BOLD("paused"), Tags::miner());
|
||||
}
|
||||
else {
|
||||
LOG_INFO("%s " YELLOW_BOLD("paused") ", press " MAGENTA_BG_BOLD(" r ") " to resume", Tags::miner());
|
||||
}
|
||||
}
|
||||
|
||||
if (!d_ptr->active) {
|
||||
|
@ -538,6 +550,20 @@ void xmrig::Miner::onTimer(const Timer *)
|
|||
}
|
||||
|
||||
d_ptr->ticks++;
|
||||
|
||||
if (d_ptr->controller->config()->isPauseOnBattery()) {
|
||||
const bool battery_power = Platform::isOnBatteryPower();
|
||||
if (battery_power && d_ptr->enabled) {
|
||||
LOG_INFO("%s " YELLOW_BOLD("on battery power"), Tags::miner());
|
||||
d_ptr->battery_power = true;
|
||||
setEnabled(false);
|
||||
}
|
||||
else if (!battery_power && !d_ptr->enabled && d_ptr->battery_power) {
|
||||
LOG_INFO("%s " GREEN_BOLD("on AC power"), Tags::miner());
|
||||
d_ptr->battery_power = false;
|
||||
setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -252,4 +252,5 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
|||
doc.AddMember(StringRef(kUserAgent), m_userAgent.toJSON(), allocator);
|
||||
doc.AddMember(StringRef(kVerbose), Log::verbose(), allocator);
|
||||
doc.AddMember(StringRef(kWatch), m_watch, allocator);
|
||||
doc.AddMember(StringRef(kPauseOnBattery), isPauseOnBattery(), allocator);
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* 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 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
@ -151,6 +151,9 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||
case IConfig::YieldKey: /* --cpu-no-yield */
|
||||
return set(doc, kCpu, "yield", false);
|
||||
|
||||
case IConfig::Argon2ImplKey: /* --argon2-impl */
|
||||
return set(doc, kCpu, "argon2-impl", arg);
|
||||
|
||||
# ifdef XMRIG_FEATURE_ASM
|
||||
case IConfig::AssemblyKey: /* --asm */
|
||||
return set(doc, kCpu, "asm", arg);
|
||||
|
@ -186,6 +189,9 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||
|
||||
case IConfig::RandomXRdmsrKey: /* --randomx-no-rdmsr */
|
||||
return set(doc, kRandomX, "rdmsr", false);
|
||||
|
||||
case IConfig::RandomXCacheQoSKey: /* --cache-qos */
|
||||
return set(doc, kRandomX, "cache_qos", true);
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* 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 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
|
|
@ -109,7 +109,8 @@ R"===(
|
|||
"retry-pause": 5,
|
||||
"syslog": false,
|
||||
"user-agent": null,
|
||||
"watch": true
|
||||
"watch": true,
|
||||
"pause-on-battery": false
|
||||
}
|
||||
)===";
|
||||
#endif
|
||||
|
|
|
@ -87,11 +87,15 @@ static const option options[] = {
|
|||
{ "cpu-max-threads-hint", 1, nullptr, IConfig::CPUMaxThreadsKey },
|
||||
{ "cpu-memory-pool", 1, nullptr, IConfig::MemoryPoolKey },
|
||||
{ "cpu-no-yield", 0, nullptr, IConfig::YieldKey },
|
||||
{ "no-yield", 0, nullptr, IConfig::YieldKey },
|
||||
{ "cpu-argon2-impl", 1, nullptr, IConfig::Argon2ImplKey },
|
||||
{ "argon2-impl", 1, nullptr, IConfig::Argon2ImplKey },
|
||||
{ "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 },
|
||||
{ "pause-on-battery", 0, nullptr, IConfig::PauseOnBatteryKey },
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
{ "tls", 0, nullptr, IConfig::TlsKey },
|
||||
{ "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey },
|
||||
|
@ -116,6 +120,8 @@ static const option options[] = {
|
|||
{ "wrmsr", 2, nullptr, IConfig::RandomXWrmsrKey },
|
||||
{ "randomx-no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
||||
{ "no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
||||
{ "randomx-cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey },
|
||||
{ "cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey },
|
||||
# endif
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
{ "astrobwt-max-size", 1, nullptr, IConfig::AstroBWTMaxSizeKey },
|
||||
|
|
|
@ -69,7 +69,7 @@ static inline const std::string &usage()
|
|||
u += " -r, --retries=N number of times to retry before switch to backup server (default: 5)\n";
|
||||
u += " -R, --retry-pause=N time to pause between retries (default: 5)\n";
|
||||
u += " --user-agent set custom user-agent string for pool\n";
|
||||
u += " --donate-level=N donate level, default 5%% (5 minutes in 100 minutes)\n";
|
||||
u += " --donate-level=N donate level, default 1%% (1 minute in 100 minutes)\n";
|
||||
u += " --donate-over-proxy=N control donate over xmrig-proxy feature\n";
|
||||
|
||||
u += "\nCPU backend:\n";
|
||||
|
@ -85,13 +85,18 @@ static inline const std::string &usage()
|
|||
u += " --no-huge-pages disable huge pages support\n";
|
||||
u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n";
|
||||
|
||||
# if defined(__x86_64__) || defined(_M_AMD64)
|
||||
u += " --argon2-impl=IMPL argon2 implementation: x86_64, SSE2, SSSE3, XOP, AVX2, AVX-512F\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
u += " --randomx-init=N threads count to initialize RandomX dataset\n";
|
||||
u += " --randomx-no-numa disable NUMA support for RandomX\n";
|
||||
u += " --randomx-mode=MODE RandomX mode: auto, fast, light\n";
|
||||
u += " --randomx-1gb-pages use 1GB hugepages for dataset (Linux only)\n";
|
||||
u += " --randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)\n";
|
||||
u += " --randomx-1gb-pages use 1GB hugepages for RandomX dataset (Linux only)\n";
|
||||
u += " --randomx-wrmsr=N write custom value(s) to MSR registers or disable MSR mod (-1)\n";
|
||||
u += " --randomx-no-rdmsr disable reverting initial MSR values on exit\n";
|
||||
u += " --randomx-cache-qos enable Cache QoS\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
|
@ -99,16 +104,6 @@ static inline const std::string &usage()
|
|||
u += " --astrobwt-avx2 enable AVX2 optimizations for AstroBWT algorithm";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
u += "\nAPI:\n";
|
||||
u += " --api-worker-id=ID custom worker-id for API\n";
|
||||
u += " --api-id=ID custom instance ID for API\n";
|
||||
u += " --http-host=HOST bind host for HTTP API (default: 127.0.0.1)\n";
|
||||
u += " --http-port=N bind port for HTTP API\n";
|
||||
u += " --http-access-token=T access token for HTTP API\n";
|
||||
u += " --http-no-restricted enable full remote access to HTTP API (only if access token set)\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
u += "\nOpenCL backend:\n";
|
||||
u += " --opencl enable OpenCL mining backend\n";
|
||||
|
@ -131,6 +126,16 @@ static inline const std::string &usage()
|
|||
u += " --no-nvml disable NVML (NVIDIA Management Library) support\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
u += "\nAPI:\n";
|
||||
u += " --api-worker-id=ID custom worker-id for API\n";
|
||||
u += " --api-id=ID custom instance ID for API\n";
|
||||
u += " --http-host=HOST bind host for HTTP API (default: 127.0.0.1)\n";
|
||||
u += " --http-port=N bind port for HTTP API\n";
|
||||
u += " --http-access-token=T access token for HTTP API\n";
|
||||
u += " --http-no-restricted enable full remote access to HTTP API (only if access token set)\n";
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
u += "\nTLS:\n";
|
||||
u += " --tls-gen=HOSTNAME generate TLS certificate for specific hostname\n";
|
||||
|
@ -172,6 +177,7 @@ static inline const std::string &usage()
|
|||
u += " --title set custom console window title\n";
|
||||
u += " --no-title disable setting console window title\n";
|
||||
# endif
|
||||
u += " --pause-on-battery pause mine on battery power\n";
|
||||
|
||||
return u;
|
||||
}
|
||||
|
|
|
@ -72,8 +72,8 @@ bool xmrig::argon2::Impl::select(const String &nameHint, bool benchmark)
|
|||
}
|
||||
}
|
||||
|
||||
if (hint.isEmpty() || argon2_select_impl_by_name(hint) == 0) {
|
||||
argon2_select_impl();
|
||||
if (!hint.isEmpty()) {
|
||||
argon2_select_impl_by_name(hint);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
|
|
@ -165,32 +165,43 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
|||
fillAes4Rx4_Key[6] = rx_set_int_vec_i128(0xf63befa7, 0x2ba9660a, 0xf765a38b, 0xf273c9e7);
|
||||
fillAes4Rx4_Key[7] = rx_set_int_vec_i128(0xc0b0762d, 0x0c06d1fd, 0x915839de, 0x7a7cd609);
|
||||
|
||||
// Workaround for Visual Studio placing trampoline in debug builds.
|
||||
auto addr = [](void (*func)()) {
|
||||
const uint8_t* p = reinterpret_cast<const uint8_t*>(func);
|
||||
# if defined(_MSC_VER)
|
||||
if (p[0] == 0xE9) {
|
||||
p += *(const int32_t*)(p + 1) + 5;
|
||||
}
|
||||
# endif
|
||||
return p;
|
||||
};
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
{
|
||||
const uint8_t* a = (const uint8_t*)&randomx_sshash_prefetch;
|
||||
const uint8_t* b = (const uint8_t*)&randomx_sshash_end;
|
||||
const uint8_t* a = addr(randomx_sshash_prefetch);
|
||||
const uint8_t* b = addr(randomx_sshash_end);
|
||||
memcpy(codeShhPrefetchTweaked, a, b - a);
|
||||
}
|
||||
{
|
||||
const uint8_t* a = (const uint8_t*)&randomx_program_read_dataset;
|
||||
const uint8_t* b = (const uint8_t*)&randomx_program_read_dataset_ryzen;
|
||||
const uint8_t* a = addr(randomx_program_read_dataset);
|
||||
const uint8_t* b = addr(randomx_program_read_dataset_ryzen);
|
||||
memcpy(codeReadDatasetTweaked, a, b - a);
|
||||
codeReadDatasetTweakedSize = b - a;
|
||||
}
|
||||
{
|
||||
const uint8_t* a = (const uint8_t*)&randomx_program_read_dataset_ryzen;
|
||||
const uint8_t* b = (const uint8_t*)&randomx_program_read_dataset_sshash_init;
|
||||
const uint8_t* a = addr(randomx_program_read_dataset_ryzen);
|
||||
const uint8_t* b = addr(randomx_program_read_dataset_sshash_init);
|
||||
memcpy(codeReadDatasetRyzenTweaked, a, b - a);
|
||||
codeReadDatasetRyzenTweakedSize = b - a;
|
||||
}
|
||||
{
|
||||
const uint8_t* a = (const uint8_t*)&randomx_program_read_dataset_sshash_init;
|
||||
const uint8_t* b = (const uint8_t*)&randomx_program_read_dataset_sshash_fin;
|
||||
const uint8_t* a = addr(randomx_program_read_dataset_sshash_init);
|
||||
const uint8_t* b = addr(randomx_program_read_dataset_sshash_fin);
|
||||
memcpy(codeReadDatasetLightSshInitTweaked, a, b - a);
|
||||
}
|
||||
{
|
||||
const uint8_t* a = (const uint8_t*)&randomx_prefetch_scratchpad;
|
||||
const uint8_t* b = (const uint8_t*)&randomx_prefetch_scratchpad_end;
|
||||
const uint8_t* a = addr(randomx_prefetch_scratchpad);
|
||||
const uint8_t* b = addr(randomx_prefetch_scratchpad_end);
|
||||
memcpy(codePrefetchScratchpadTweaked, a, b - a);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "backend/cpu/CpuConfig.h"
|
||||
#include "backend/cpu/CpuThreads.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/io/log/Tags.h"
|
||||
#include "crypto/rx/RxConfig.h"
|
||||
#include "crypto/rx/RxQueue.h"
|
||||
|
||||
|
@ -58,48 +57,6 @@ public:
|
|||
} // namespace xmrig
|
||||
|
||||
|
||||
const char *xmrig::rx_tag()
|
||||
{
|
||||
return Tags::randomx();
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Rx::init(const Job &job, const RxConfig &config, const CpuConfig &cpu)
|
||||
{
|
||||
if (job.algorithm().family() != Algorithm::RANDOM_X) {
|
||||
if (msrInitialized) {
|
||||
msrDestroy();
|
||||
msrInitialized = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isReady(job)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!msrInitialized) {
|
||||
msrInit(config, cpu.threads().get(job.algorithm()).data());
|
||||
msrInitialized = true;
|
||||
}
|
||||
|
||||
if (!osInitialized) {
|
||||
setupMainLoopExceptionFrame();
|
||||
osInitialized = true;
|
||||
}
|
||||
|
||||
d_ptr->queue.enqueue(job, config.nodeset(), config.threads(cpu.limit()), cpu.isHugePages(), config.isOneGbPages(), config.mode(), cpu.priority());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Rx::isReady(const Job &job)
|
||||
{
|
||||
return d_ptr->queue.isReady(job);
|
||||
}
|
||||
|
||||
|
||||
xmrig::HugePagesInfo xmrig::Rx::hugePages()
|
||||
{
|
||||
return d_ptr->queue.hugePages();
|
||||
|
@ -130,6 +87,45 @@ void xmrig::Rx::init(IRxListener *listener)
|
|||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
bool xmrig::Rx::init(const T &seed, const RxConfig &config, const CpuConfig &cpu)
|
||||
{
|
||||
if (seed.algorithm().family() != Algorithm::RANDOM_X) {
|
||||
if (msrInitialized) {
|
||||
msrDestroy();
|
||||
msrInitialized = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isReady(seed)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!msrInitialized) {
|
||||
msrInit(config, cpu.threads().get(seed.algorithm()).data());
|
||||
msrInitialized = true;
|
||||
}
|
||||
|
||||
if (!osInitialized) {
|
||||
setupMainLoopExceptionFrame();
|
||||
osInitialized = true;
|
||||
}
|
||||
|
||||
d_ptr->queue.enqueue(seed, config.nodeset(), config.threads(cpu.limit()), cpu.isHugePages(), config.isOneGbPages(), config.mode(), cpu.priority());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
bool xmrig::Rx::isReady(const T &seed)
|
||||
{
|
||||
return d_ptr->queue.isReady(seed);
|
||||
}
|
||||
|
||||
|
||||
#ifndef XMRIG_FEATURE_MSR
|
||||
void xmrig::Rx::msrInit(const RxConfig &, const std::vector<CpuThread> &)
|
||||
{
|
||||
|
@ -147,3 +143,15 @@ void xmrig::Rx::setupMainLoopExceptionFrame()
|
|||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
template bool Rx::init(const RxSeed &seed, const RxConfig &config, const CpuConfig &cpu);
|
||||
template bool Rx::isReady(const RxSeed &seed);
|
||||
template bool Rx::init(const Job &seed, const RxConfig &config, const CpuConfig &cpu);
|
||||
template bool Rx::isReady(const Job &seed);
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
@ -52,12 +52,12 @@ class RxDataset;
|
|||
class Rx
|
||||
{
|
||||
public:
|
||||
static bool init(const Job &job, const RxConfig &config, const CpuConfig &cpu);
|
||||
static bool isReady(const Job &job);
|
||||
static HugePagesInfo hugePages();
|
||||
static RxDataset *dataset(const Job &job, uint32_t nodeId);
|
||||
static void destroy();
|
||||
static void init(IRxListener *listener);
|
||||
template<typename T> static bool init(const T &seed, const RxConfig &config, const CpuConfig &cpu);
|
||||
template<typename T> static bool isReady(const T &seed);
|
||||
|
||||
# ifdef XMRIG_FIX_RYZEN
|
||||
static void setMainLoopBounds(const std::pair<const void*, const void*>& bounds);
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
@ -28,6 +28,7 @@
|
|||
#include "crypto/rx/RxBasicStorage.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/io/log/Tags.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "crypto/rx/RxAlgo.h"
|
||||
|
@ -75,7 +76,7 @@ public:
|
|||
if (!m_dataset->cache()->get()) {
|
||||
deleteDataset();
|
||||
|
||||
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
||||
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -93,7 +94,7 @@ public:
|
|||
m_ready = m_dataset->init(m_seed.data(), threads, priority);
|
||||
|
||||
if (m_ready) {
|
||||
LOG_INFO("%s" GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
||||
LOG_INFO("%s" GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +106,7 @@ private:
|
|||
const auto pages = m_dataset->hugePages();
|
||||
|
||||
LOG_INFO("%s" GREEN_BOLD("allocated") CYAN_BOLD(" %zu MB") BLACK_BOLD(" (%zu+%zu)") " huge pages %s%1.0f%% %u/%u" CLEAR " %sJIT" BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||
rx_tag(),
|
||||
Tags::randomx(),
|
||||
pages.size / oneMiB,
|
||||
RxDataset::maxSize() / oneMiB,
|
||||
RxCache::maxSize() / oneMiB,
|
||||
|
@ -118,7 +119,7 @@ private:
|
|||
);
|
||||
}
|
||||
else {
|
||||
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX dataset, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
||||
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX dataset, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
|
||||
#include "crypto/rx/RxDataset.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/io/log/Tags.h"
|
||||
#include "base/kernel/Platform.h"
|
||||
#include "crypto/common/VirtualMemory.h"
|
||||
#include "crypto/rx/RxAlgo.h"
|
||||
|
@ -181,13 +181,13 @@ void xmrig::RxDataset::setRaw(const void *raw)
|
|||
void xmrig::RxDataset::allocate(bool hugePages, bool oneGbPages)
|
||||
{
|
||||
if (m_mode == RxConfig::LightMode) {
|
||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "fast RandomX mode disabled by config", rx_tag());
|
||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "fast RandomX mode disabled by config", Tags::randomx());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_mode == RxConfig::AutoMode && uv_get_total_memory() < (maxSize() + RxCache::maxSize())) {
|
||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "not enough memory for RandomX dataset", rx_tag());
|
||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "not enough memory for RandomX dataset", Tags::randomx());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ void xmrig::RxDataset::allocate(bool hugePages, bool oneGbPages)
|
|||
|
||||
# ifdef XMRIG_OS_LINUX
|
||||
if (oneGbPages && !isOneGbPages()) {
|
||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "failed to allocate RandomX dataset using 1GB pages", rx_tag());
|
||||
LOG_ERR(CLEAR "%s" RED_BOLD_S "failed to allocate RandomX dataset using 1GB pages", Tags::randomx());
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
|
||||
#include "base/crypto/Algorithm.h"
|
||||
#include "base/tools/Buffer.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "crypto/common/HugePagesInfo.h"
|
||||
#include "crypto/randomx/configuration.h"
|
||||
|
@ -43,7 +44,6 @@ namespace xmrig
|
|||
{
|
||||
|
||||
|
||||
class Buffer;
|
||||
class RxCache;
|
||||
class VirtualMemory;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
@ -26,10 +26,10 @@
|
|||
|
||||
|
||||
#include "crypto/rx/RxNUMAStorage.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "backend/cpu/platform/HwlocCpuInfo.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/io/log/Tags.h"
|
||||
#include "base/kernel/Platform.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
@ -72,13 +72,13 @@ static bool bindToNUMANode(uint32_t nodeId)
|
|||
|
||||
static inline void printSkipped(uint32_t nodeId, const char *reason)
|
||||
{
|
||||
LOG_WARN("%s" CYAN_BOLD("#%u ") RED_BOLD("skipped") YELLOW(" (%s)"), rx_tag(), nodeId, reason);
|
||||
LOG_WARN("%s" CYAN_BOLD("#%u ") RED_BOLD("skipped") YELLOW(" (%s)"), Tags::randomx(), nodeId, reason);
|
||||
}
|
||||
|
||||
|
||||
static inline void printDatasetReady(uint32_t nodeId, uint64_t ts)
|
||||
{
|
||||
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), nodeId, Chrono::steadyMSecs() - ts);
|
||||
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("dataset ready") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), nodeId, Chrono::steadyMSecs() - ts);
|
||||
}
|
||||
|
||||
|
||||
|
@ -142,7 +142,7 @@ public:
|
|||
if (m_datasets.empty()) {
|
||||
m_datasets.insert({ m_nodeset.front(), new RxDataset(m_cache) });
|
||||
|
||||
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX datasets, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
||||
LOG_WARN(CLEAR "%s" YELLOW_BOLD_S "failed to allocate RandomX datasets, switching to slow mode" BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||
}
|
||||
else {
|
||||
if (m_cache) {
|
||||
|
@ -246,7 +246,7 @@ private:
|
|||
if (!cache->get()) {
|
||||
delete cache;
|
||||
|
||||
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), rx_tag(), Chrono::steadyMSecs() - ts);
|
||||
LOG_INFO("%s" RED_BOLD("failed to allocate RandomX memory") BLACK_BOLD(" (%" PRIu64 " ms)"), Tags::randomx(), Chrono::steadyMSecs() - ts);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ private:
|
|||
const auto pages = dataset->hugePages();
|
||||
|
||||
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("allocated") CYAN_BOLD(" %zu MB") " huge pages %s%3.0f%%" CLEAR BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||
rx_tag(),
|
||||
Tags::randomx(),
|
||||
nodeId,
|
||||
pages.size / oneMiB,
|
||||
(pages.isFullyAllocated() ? GREEN_BOLD_S : RED_BOLD_S),
|
||||
|
@ -287,7 +287,7 @@ private:
|
|||
const auto pages = cache->hugePages();
|
||||
|
||||
LOG_INFO("%s" CYAN_BOLD("#%u ") GREEN_BOLD("allocated") CYAN_BOLD(" %4zu MB") " huge pages %s%3.0f%%" CLEAR " %sJIT" BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||
rx_tag(),
|
||||
Tags::randomx(),
|
||||
nodeId,
|
||||
cache->size() / oneMiB,
|
||||
(pages.isFullyAllocated() ? GREEN_BOLD_S : RED_BOLD_S),
|
||||
|
@ -303,7 +303,7 @@ private:
|
|||
auto pages = hugePages();
|
||||
|
||||
LOG_INFO("%s" CYAN_BOLD("-- ") GREEN_BOLD("allocated") CYAN_BOLD(" %4zu MB") " huge pages %s%3.0f%% %u/%u" CLEAR BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||
rx_tag(),
|
||||
Tags::randomx(),
|
||||
pages.size / oneMiB,
|
||||
(pages.isFullyAllocated() ? GREEN_BOLD_S : (pages.allocated == 0 ? RED_BOLD_S : YELLOW_BOLD_S)),
|
||||
pages.percent(),
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
@ -26,11 +26,11 @@
|
|||
|
||||
|
||||
#include "crypto/rx/RxQueue.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "crypto/rx/RxBasicStorage.h"
|
||||
#include "base/tools/Handle.h"
|
||||
#include "backend/common/interfaces/IRxListener.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/io/log/Tags.h"
|
||||
#include "base/tools/Handle.h"
|
||||
#include "crypto/rx/RxBasicStorage.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_HWLOC
|
||||
|
@ -66,14 +66,6 @@ xmrig::RxQueue::~RxQueue()
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::RxQueue::isReady(const Job &job)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
return isReadyUnsafe(job);
|
||||
}
|
||||
|
||||
|
||||
xmrig::RxDataset *xmrig::RxQueue::dataset(const Job &job, uint32_t nodeId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
@ -94,6 +86,15 @@ xmrig::HugePagesInfo xmrig::RxQueue::hugePages()
|
|||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
bool xmrig::RxQueue::isReady(const T &seed)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
|
||||
return isReadyUnsafe(seed);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::RxQueue::enqueue(const RxSeed &seed, const std::vector<uint32_t> &nodeset, uint32_t threads, bool hugePages, bool oneGbPages, RxConfig::Mode mode, int priority)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
|
@ -124,9 +125,10 @@ void xmrig::RxQueue::enqueue(const RxSeed &seed, const std::vector<uint32_t> &no
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::RxQueue::isReadyUnsafe(const Job &job) const
|
||||
template<typename T>
|
||||
bool xmrig::RxQueue::isReadyUnsafe(const T &seed) const
|
||||
{
|
||||
return m_storage != nullptr && m_storage->isAllocated() && m_state == STATE_IDLE && m_seed == job;
|
||||
return m_storage != nullptr && m_storage->isAllocated() && m_state == STATE_IDLE && m_seed == seed;
|
||||
}
|
||||
|
||||
|
||||
|
@ -149,7 +151,7 @@ void xmrig::RxQueue::backgroundInit()
|
|||
lock.unlock();
|
||||
|
||||
LOG_INFO("%s" MAGENTA_BOLD("init dataset%s") " algo " WHITE_BOLD("%s (") CYAN_BOLD("%u") WHITE_BOLD(" threads)") BLACK_BOLD(" seed %s..."),
|
||||
rx_tag(),
|
||||
Tags::randomx(),
|
||||
item.nodeset.size() > 1 ? "s" : "",
|
||||
item.seed.algorithm().shortName(),
|
||||
item.threads,
|
||||
|
@ -180,3 +182,13 @@ void xmrig::RxQueue::onReady()
|
|||
m_listener->onDatasetReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
template bool RxQueue::isReady(const Job &);
|
||||
template bool RxQueue::isReady(const RxSeed &);
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
@ -82,9 +82,9 @@ public:
|
|||
RxQueue(IRxListener *listener);
|
||||
~RxQueue();
|
||||
|
||||
bool isReady(const Job &job);
|
||||
RxDataset *dataset(const Job &job, uint32_t nodeId);
|
||||
HugePagesInfo hugePages();
|
||||
RxDataset *dataset(const Job &job, uint32_t nodeId);
|
||||
template<typename T> bool isReady(const T &seed);
|
||||
void enqueue(const RxSeed &seed, const std::vector<uint32_t> &nodeset, uint32_t threads, bool hugePages, bool oneGbPages, RxConfig::Mode mode, int priority);
|
||||
|
||||
private:
|
||||
|
@ -94,7 +94,7 @@ private:
|
|||
STATE_SHUTDOWN
|
||||
};
|
||||
|
||||
bool isReadyUnsafe(const Job &job) const;
|
||||
template<typename T> bool isReadyUnsafe(const T &seed) const;
|
||||
void backgroundInit();
|
||||
void onReady();
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 tevador <tevador@gmail.com>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 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
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#define APP_ID "xmrig"
|
||||
#define APP_NAME "XMRig"
|
||||
#define APP_DESC "XMRig miner"
|
||||
#define APP_VERSION "6.3.0"
|
||||
#define APP_VERSION "6.3.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 3
|
||||
#define APP_VER_PATCH 0
|
||||
#define APP_VER_PATCH 1
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# if (_MSC_VER >= 1920)
|
||||
|
|
Loading…
Reference in a new issue