mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 03:59:41 +00:00
Added config option "dmi" and command line option "--no-dmi".
This commit is contained in:
parent
efc5e5d811
commit
9a02007900
11 changed files with 121 additions and 56 deletions
|
@ -26,7 +26,7 @@ option(WITH_PROFILING "Enable profiling for developers" OFF)
|
||||||
option(WITH_SSE4_1 "Enable SSE 4.1 for Blake2" ON)
|
option(WITH_SSE4_1 "Enable SSE 4.1 for Blake2" ON)
|
||||||
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON)
|
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON)
|
||||||
option(WITH_SECURE_JIT "Enable secure access to JIT memory" OFF)
|
option(WITH_SECURE_JIT "Enable secure access to JIT memory" OFF)
|
||||||
option(WITH_DMI "Enable DMI reader" OFF)
|
option(WITH_DMI "Enable DMI/SMBIOS reader" OFF)
|
||||||
|
|
||||||
option(BUILD_STATIC "Build static binary" OFF)
|
option(BUILD_STATIC "Build static binary" OFF)
|
||||||
option(ARM_TARGET "Force use specific ARM target 8 or 7" 0)
|
option(ARM_TARGET "Force use specific ARM target 8 or 7" 0)
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
* Copyright 2016-2021 XMRig <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -76,7 +76,7 @@ inline static const char *asmName(Assembly::Id assembly)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static void print_memory(Config *config)
|
static void print_pages(const Config *config)
|
||||||
{
|
{
|
||||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s",
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s",
|
||||||
"HUGE PAGES", config->cpu().isHugePages() ? (VirtualMemory::isHugepagesAvailable() ? kHugepagesSupported : RED_BOLD("unavailable")) : RED_BOLD("disabled"));
|
"HUGE PAGES", config->cpu().isHugePages() ? (VirtualMemory::isHugepagesAvailable() ? kHugepagesSupported : RED_BOLD("unavailable")) : RED_BOLD("disabled"));
|
||||||
|
@ -92,7 +92,7 @@ static void print_memory(Config *config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void print_cpu(Config *)
|
static void print_cpu(const Config *)
|
||||||
{
|
{
|
||||||
const auto info = Cpu::info();
|
const auto info = Cpu::info();
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ static void print_cpu(Config *)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void print_memory()
|
static void print_memory(const Config *config)
|
||||||
{
|
{
|
||||||
constexpr size_t oneGiB = 1024U * 1024U * 1024U;
|
constexpr size_t oneGiB = 1024U * 1024U * 1024U;
|
||||||
const auto freeMem = static_cast<double>(uv_get_free_memory());
|
const auto freeMem = static_cast<double>(uv_get_free_memory());
|
||||||
|
@ -137,6 +137,10 @@ static void print_memory()
|
||||||
);
|
);
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_DMI
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
if (!config->isDMI()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DmiReader reader;
|
DmiReader reader;
|
||||||
if (!reader.read()) {
|
if (!reader.read()) {
|
||||||
return;
|
return;
|
||||||
|
@ -167,7 +171,7 @@ static void print_memory()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void print_threads(Config *config)
|
static void print_threads(const Config *config)
|
||||||
{
|
{
|
||||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") WHITE_BOLD("%s%d%%"),
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") WHITE_BOLD("%s%d%%"),
|
||||||
"DONATE",
|
"DONATE",
|
||||||
|
@ -209,14 +213,16 @@ static void print_commands(Config *)
|
||||||
|
|
||||||
void xmrig::Summary::print(Controller *controller)
|
void xmrig::Summary::print(Controller *controller)
|
||||||
{
|
{
|
||||||
controller->config()->printVersions();
|
const auto config = controller->config();
|
||||||
print_memory(controller->config());
|
|
||||||
print_cpu(controller->config());
|
|
||||||
print_memory();
|
|
||||||
print_threads(controller->config());
|
|
||||||
controller->config()->pools().print();
|
|
||||||
|
|
||||||
print_commands(controller->config());
|
config->printVersions();
|
||||||
|
print_pages(config);
|
||||||
|
print_cpu(config);
|
||||||
|
print_memory(config);
|
||||||
|
print_threads(config);
|
||||||
|
config->pools().print();
|
||||||
|
|
||||||
|
print_commands(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -84,6 +84,7 @@ public:
|
||||||
BenchSeedKey = 1046,
|
BenchSeedKey = 1046,
|
||||||
BenchHashKey = 1047,
|
BenchHashKey = 1047,
|
||||||
BenchTokenKey = 1048,
|
BenchTokenKey = 1048,
|
||||||
|
DmiKey = 1049,
|
||||||
|
|
||||||
// xmrig common
|
// xmrig common
|
||||||
CPUPriorityKey = 1021,
|
CPUPriorityKey = 1021,
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -23,9 +23,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cinttypes>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <cinttypes>
|
|
||||||
|
|
||||||
|
|
||||||
#include "core/config/Config.h"
|
#include "core/config/Config.h"
|
||||||
|
@ -55,16 +55,19 @@ namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_OPENCL
|
#ifdef XMRIG_FEATURE_OPENCL
|
||||||
static const char *kOcl = "opencl";
|
const char *Config::kOcl = "opencl";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_CUDA
|
#ifdef XMRIG_FEATURE_CUDA
|
||||||
static const char *kCuda = "cuda";
|
const char *Config::kCuda = "cuda";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
#if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
||||||
static const char *kHealthPrintTime = "health-print-time";
|
const char *Config::kHealthPrintTime = "health-print-time";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XMRIG_FEATURE_DMI
|
||||||
|
const char *Config::kDMI = "dmi";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,6 +91,10 @@ public:
|
||||||
# if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
# if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
||||||
uint32_t healthPrintTime = 60;
|
uint32_t healthPrintTime = 60;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
bool dmi = true;
|
||||||
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -143,6 +150,14 @@ uint32_t xmrig::Config::healthPrintTime() const
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_FEATURE_DMI
|
||||||
|
bool xmrig::Config::isDMI() const
|
||||||
|
{
|
||||||
|
return d_ptr->dmi;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::Config::isShouldSave() const
|
bool xmrig::Config::isShouldSave() const
|
||||||
{
|
{
|
||||||
if (!isAutoSave()) {
|
if (!isAutoSave()) {
|
||||||
|
@ -191,6 +206,10 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
|
||||||
d_ptr->healthPrintTime = reader.getUint(kHealthPrintTime, d_ptr->healthPrintTime);
|
d_ptr->healthPrintTime = reader.getUint(kHealthPrintTime, d_ptr->healthPrintTime);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
d_ptr->dmi = reader.getBool(kDMI, d_ptr->dmi);
|
||||||
|
# endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,6 +255,11 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
||||||
# if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
# if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
||||||
doc.AddMember(StringRef(kHealthPrintTime), healthPrintTime(), allocator);
|
doc.AddMember(StringRef(kHealthPrintTime), healthPrintTime(), allocator);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
doc.AddMember(StringRef(kDMI), isDMI(), allocator);
|
||||||
|
# endif
|
||||||
|
|
||||||
doc.AddMember(StringRef(kSyslog), isSyslog(), allocator);
|
doc.AddMember(StringRef(kSyslog), isSyslog(), allocator);
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_TLS
|
# ifdef XMRIG_FEATURE_TLS
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -50,6 +50,22 @@ class Config : public BaseConfig
|
||||||
public:
|
public:
|
||||||
XMRIG_DISABLE_COPY_MOVE(Config);
|
XMRIG_DISABLE_COPY_MOVE(Config);
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_OPENCL
|
||||||
|
static const char *kOcl;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_CUDA
|
||||||
|
static const char *kCuda;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
||||||
|
static const char *kHealthPrintTime;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
static const char *kDMI;
|
||||||
|
# endif
|
||||||
|
|
||||||
Config();
|
Config();
|
||||||
~Config() override;
|
~Config() override;
|
||||||
|
|
||||||
|
@ -73,6 +89,12 @@ public:
|
||||||
uint32_t healthPrintTime() const { return 0; }
|
uint32_t healthPrintTime() const { return 0; }
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
bool isDMI() const;
|
||||||
|
# else
|
||||||
|
static constexpr inline bool isDMI() { return false; }
|
||||||
|
# endif
|
||||||
|
|
||||||
bool isShouldSave() const;
|
bool isShouldSave() const;
|
||||||
bool read(const IJsonReader &reader, const char *fileName) override;
|
bool read(const IJsonReader &reader, const char *fileName) override;
|
||||||
void getJSON(rapidjson::Document &doc) const override;
|
void getJSON(rapidjson::Document &doc) const override;
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -23,11 +23,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "core/config/ConfigTransform.h"
|
||||||
#include "base/kernel/interfaces/IConfig.h"
|
#include "base/kernel/interfaces/IConfig.h"
|
||||||
#include "backend/cpu/CpuConfig.h"
|
|
||||||
#include "base/net/stratum/Pool.h"
|
#include "base/net/stratum/Pool.h"
|
||||||
#include "base/net/stratum/Pools.h"
|
#include "base/net/stratum/Pools.h"
|
||||||
#include "core/config/ConfigTransform.h"
|
#include "core/config/Config.h"
|
||||||
#include "crypto/cn/CnHash.h"
|
#include "crypto/cn/CnHash.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,14 +51,6 @@ static const char *kEnabled = "enabled";
|
||||||
static const char *kIntensity = "intensity";
|
static const char *kIntensity = "intensity";
|
||||||
static const char *kThreads = "threads";
|
static const char *kThreads = "threads";
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_OPENCL
|
|
||||||
static const char *kOcl = "opencl";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_CUDA
|
|
||||||
static const char *kCuda = "cuda";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static inline uint64_t intensity(uint64_t av)
|
static inline uint64_t intensity(uint64_t av)
|
||||||
{
|
{
|
||||||
|
@ -122,7 +114,7 @@ void xmrig::ConfigTransform::finalize(rapidjson::Document &doc)
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_OPENCL
|
# ifdef XMRIG_FEATURE_OPENCL
|
||||||
if (m_opencl) {
|
if (m_opencl) {
|
||||||
set(doc, kOcl, kEnabled, true);
|
set(doc, Config::kOcl, kEnabled, true);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
@ -208,47 +200,54 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IConfig::OclCacheKey: /* --opencl-no-cache */
|
case IConfig::OclCacheKey: /* --opencl-no-cache */
|
||||||
return set(doc, kOcl, "cache", false);
|
return set(doc, Config::kOcl, "cache", false);
|
||||||
|
|
||||||
case IConfig::OclLoaderKey: /* --opencl-loader */
|
case IConfig::OclLoaderKey: /* --opencl-loader */
|
||||||
return set(doc, kOcl, "loader", arg);
|
return set(doc, Config::kOcl, "loader", arg);
|
||||||
|
|
||||||
case IConfig::OclDevicesKey: /* --opencl-devices */
|
case IConfig::OclDevicesKey: /* --opencl-devices */
|
||||||
m_opencl = true;
|
m_opencl = true;
|
||||||
return set(doc, kOcl, "devices-hint", arg);
|
return set(doc, Config::kOcl, "devices-hint", arg);
|
||||||
|
|
||||||
case IConfig::OclPlatformKey: /* --opencl-platform */
|
case IConfig::OclPlatformKey: /* --opencl-platform */
|
||||||
if (strlen(arg) < 3) {
|
if (strlen(arg) < 3) {
|
||||||
return set(doc, kOcl, "platform", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
return set(doc, Config::kOcl, "platform", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return set(doc, kOcl, "platform", arg);
|
return set(doc, Config::kOcl, "platform", arg);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_CUDA
|
# ifdef XMRIG_FEATURE_CUDA
|
||||||
case IConfig::CudaKey: /* --cuda */
|
case IConfig::CudaKey: /* --cuda */
|
||||||
return set(doc, kCuda, kEnabled, true);
|
return set(doc, Config::kCuda, kEnabled, true);
|
||||||
|
|
||||||
case IConfig::CudaLoaderKey: /* --cuda-loader */
|
case IConfig::CudaLoaderKey: /* --cuda-loader */
|
||||||
return set(doc, kCuda, "loader", arg);
|
return set(doc, Config::kCuda, "loader", arg);
|
||||||
|
|
||||||
case IConfig::CudaDevicesKey: /* --cuda-devices */
|
case IConfig::CudaDevicesKey: /* --cuda-devices */
|
||||||
set(doc, kCuda, kEnabled, true);
|
set(doc, Config::kCuda, kEnabled, true);
|
||||||
return set(doc, kCuda, "devices-hint", arg);
|
return set(doc, Config::kCuda, "devices-hint", arg);
|
||||||
|
|
||||||
case IConfig::CudaBFactorKey: /* --cuda-bfactor-hint */
|
case IConfig::CudaBFactorKey: /* --cuda-bfactor-hint */
|
||||||
return set(doc, kCuda, "bfactor-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
return set(doc, Config::kCuda, "bfactor-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||||
|
|
||||||
case IConfig::CudaBSleepKey: /* --cuda-bsleep-hint */
|
case IConfig::CudaBSleepKey: /* --cuda-bsleep-hint */
|
||||||
return set(doc, kCuda, "bsleep-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
return set(doc, Config::kCuda, "bsleep-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_NVML
|
# ifdef XMRIG_FEATURE_NVML
|
||||||
case IConfig::NvmlKey: /* --no-nvml */
|
case IConfig::NvmlKey: /* --no-nvml */
|
||||||
return set(doc, kCuda, "nvml", false);
|
return set(doc, Config::kCuda, "nvml", false);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
||||||
case IConfig::HealthPrintTimeKey: /* --health-print-time */
|
case IConfig::HealthPrintTimeKey: /* --health-print-time */
|
||||||
return set(doc, "health-print-time", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
return set(doc, Config::kHealthPrintTime, static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
case IConfig::DmiKey: /* --no-dmi */
|
||||||
|
return set(doc, Config::kDMI, false);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -155,7 +155,12 @@ static const option options[] = {
|
||||||
# endif
|
# endif
|
||||||
# ifdef XMRIG_FEATURE_NVML
|
# ifdef XMRIG_FEATURE_NVML
|
||||||
{ "no-nvml", 0, nullptr, IConfig::NvmlKey },
|
{ "no-nvml", 0, nullptr, IConfig::NvmlKey },
|
||||||
|
# endif
|
||||||
|
# if defined(XMRIG_FEATURE_NVML) || defined (XMRIG_FEATURE_ADL)
|
||||||
{ "health-print-time", 1, nullptr, IConfig::HealthPrintTimeKey },
|
{ "health-print-time", 1, nullptr, IConfig::HealthPrintTimeKey },
|
||||||
|
# endif
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
{ "no-dmi", 0, nullptr, IConfig::DmiKey },
|
||||||
# endif
|
# endif
|
||||||
{ nullptr, 0, nullptr, 0 }
|
{ nullptr, 0, nullptr, 0 }
|
||||||
};
|
};
|
||||||
|
|
|
@ -190,6 +190,10 @@ static inline const std::string &usage()
|
||||||
u += " --hash=HASH compare benchmark result with specified hash\n";
|
u += " --hash=HASH compare benchmark result with specified hash\n";
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_DMI
|
||||||
|
u += " --no-dmi disable DMI/SMBIOS reader\n";
|
||||||
|
# endif
|
||||||
|
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
if (WITH_DMI)
|
||||||
|
set(WITH_DMI XMRIG_OS_WIN OR XMRIG_OS_LINUX OR XMRIG_OS_FREEBSD OR (XMRIG_OS_MACOS AND NOT XMRIG_ARM))
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WITH_DMI)
|
if (WITH_DMI)
|
||||||
add_definitions(/DXMRIG_FEATURE_DMI)
|
add_definitions(/DXMRIG_FEATURE_DMI)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue