#1285 Added command line options --cuda-bfactor-hint and --cuda-bsleep-hint.

This commit is contained in:
XMRig 2019-11-15 03:10:58 +07:00
parent 79f4685d9a
commit aeb2c6e8ec
5 changed files with 16 additions and 0 deletions

View file

@ -84,6 +84,8 @@ CUDA backend:
--cuda enable CUDA mining backend
--cuda-loader=PATH path to CUDA plugin (xmrig-cuda.dll or libxmrig-cuda.so)
--cuda-devices=N comma separated list of CUDA devices to use
--cuda-bfactor-hint=N bfactor hint for autoconfig (0-12)
--cuda-bsleep-hint=N bsleep hint for autoconfig
--no-nvml disable NVML (NVIDIA Management Library) support
Logging:

View file

@ -36,6 +36,8 @@ namespace xmrig {
static bool generated = false;
static const char *kBfactorHint = "bfactor-hint";
static const char *kBsleepHint = "bsleep-hint";
static const char *kDevicesHint = "devices-hint";
static const char *kEnabled = "enabled";
static const char *kLoader = "loader";
@ -116,6 +118,8 @@ void xmrig::CudaConfig::read(const rapidjson::Value &value)
if (value.IsObject()) {
m_enabled = Json::getBool(value, kEnabled, m_enabled);
m_loader = Json::getString(value, kLoader);
m_bfactor = std::min(Json::getUint(value, kBfactorHint, m_bfactor), 12u);
m_bsleep = Json::getUint(value, kBsleepHint, m_bsleep);
setDevicesHint(Json::getString(value, kDevicesHint));

View file

@ -195,6 +195,12 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
case IConfig::CudaDevicesKey: /* --cuda-devices */
set(doc, kCuda, kEnabled, true);
return set(doc, kCuda, "devices-hint", arg);
case IConfig::CudaBFactorKey: /* --cuda-bfactor-hint */
return set(doc, kCuda, "bfactor-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
case IConfig::CudaBSleepKey: /* --cuda-bsleep-hint */
return set(doc, kCuda, "bsleep-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
# endif
# ifdef XMRIG_FEATURE_NVML

View file

@ -108,6 +108,8 @@ static const option options[] = {
{ "cuda", 0, nullptr, IConfig::CudaKey },
{ "cuda-loader", 1, nullptr, IConfig::CudaLoaderKey },
{ "cuda-devices", 1, nullptr, IConfig::CudaDevicesKey },
{ "cuda-bfactor-hint", 1, nullptr, IConfig::CudaBFactorKey },
{ "cuda-bsleep-hint", 1, nullptr, IConfig::CudaBSleepKey },
# endif
# ifdef XMRIG_FEATURE_NVML
{ "no-nvml", 0, nullptr, IConfig::NvmlKey },

View file

@ -113,6 +113,8 @@ static inline const std::string &usage()
u += " --cuda enable CUDA mining backend\n";
u += " --cuda-loader=PATH path to CUDA plugin (xmrig-cuda.dll or libxmrig-cuda.so)\n";
u += " --cuda-devices=N comma separated list of CUDA devices to use\n";
u += " --cuda-bfactor-hint=N bfactor hint for autoconfig (0-12)\n";
u += " --cuda-bsleep-hint=N bsleep hint for autoconfig\n";
# endif
# ifdef XMRIG_FEATURE_NVML
u += " --no-nvml disable NVML (NVIDIA Management Library) support\n";