Added command line options --cuda and --cuda-loader.
This commit is contained in:
parent
80fd0f9fab
commit
9dfa38f1e7
7 changed files with 40 additions and 3 deletions
|
@ -77,11 +77,16 @@ OpenCL backend:
|
||||||
--opencl enable OpenCL mining backend
|
--opencl enable OpenCL mining backend
|
||||||
--opencl-devices=N list of OpenCL devices to use
|
--opencl-devices=N list of OpenCL devices to use
|
||||||
--opencl-platform=N OpenCL platform index or name
|
--opencl-platform=N OpenCL platform index or name
|
||||||
--opencl-loader=N path to OpenCL-ICD-Loader (OpenCL.dll or libOpenCL.so)
|
--opencl-loader=PATH path to OpenCL-ICD-Loader (OpenCL.dll or libOpenCL.so)
|
||||||
--opencl-no-cache disable OpenCL cache
|
--opencl-no-cache disable OpenCL cache
|
||||||
--print-platforms print available OpenCL platforms and exit
|
--print-platforms print available OpenCL platforms and exit
|
||||||
|
|
||||||
|
CUDA backend:
|
||||||
|
--cuda enable CUDA mining backend
|
||||||
|
--cuda-loader=PATH path to CUDA plugin (xmrig-cuda.dll or libxmrig-cuda.so)
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
|
-S, --syslog use system log for output messages
|
||||||
-l, --log-file=FILE log all output to a file
|
-l, --log-file=FILE log all output to a file
|
||||||
--print-time=N print hashrate report every N seconds
|
--print-time=N print hashrate report every N seconds
|
||||||
--no-color disable colored output
|
--no-color disable colored output
|
||||||
|
|
|
@ -134,6 +134,8 @@ public:
|
||||||
CudaLaunchKey = 1204,
|
CudaLaunchKey = 1204,
|
||||||
CudaAffinityKey = 1205,
|
CudaAffinityKey = 1205,
|
||||||
CudaMaxUsageKey = 1206,
|
CudaMaxUsageKey = 1206,
|
||||||
|
CudaKey = 1207,
|
||||||
|
CudaLoaderKey = 1208
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual ~IConfig() = default;
|
virtual ~IConfig() = default;
|
||||||
|
|
|
@ -38,6 +38,10 @@
|
||||||
"cn/0": false,
|
"cn/0": false,
|
||||||
"cn-lite/0": false
|
"cn-lite/0": false
|
||||||
},
|
},
|
||||||
|
"cuda": {
|
||||||
|
"enabled": false,
|
||||||
|
"loader": null,
|
||||||
|
},
|
||||||
"donate-level": 5,
|
"donate-level": 5,
|
||||||
"donate-over-proxy": 1,
|
"donate-over-proxy": 1,
|
||||||
"log-file": null,
|
"log-file": null,
|
||||||
|
@ -64,4 +68,4 @@
|
||||||
"syslog": false,
|
"syslog": false,
|
||||||
"user-agent": null,
|
"user-agent": null,
|
||||||
"watch": true
|
"watch": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,10 @@ static const char *kRandomX = "randomx";
|
||||||
static const char *kOcl = "opencl";
|
static const char *kOcl = "opencl";
|
||||||
#endif
|
#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)
|
||||||
{
|
{
|
||||||
|
@ -181,6 +185,14 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
||||||
return set(doc, kOcl, "platform", arg);
|
return set(doc, kOcl, "platform", arg);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_CUDA
|
||||||
|
case IConfig::CudaKey: /* --cuda */
|
||||||
|
return set(doc, kCuda, "enabled", true);
|
||||||
|
|
||||||
|
case IConfig::CudaLoaderKey: /* --cuda-loader */
|
||||||
|
return set(doc, kCuda, "loader", arg);
|
||||||
|
# endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,10 @@ R"===(
|
||||||
"cn/0": false,
|
"cn/0": false,
|
||||||
"cn-lite/0": false
|
"cn-lite/0": false
|
||||||
},
|
},
|
||||||
|
"cuda": {
|
||||||
|
"enabled": false,
|
||||||
|
"loader": null,
|
||||||
|
},
|
||||||
"donate-level": 5,
|
"donate-level": 5,
|
||||||
"donate-over-proxy": 1,
|
"donate-over-proxy": 1,
|
||||||
"log-file": null,
|
"log-file": null,
|
||||||
|
|
|
@ -103,6 +103,10 @@ static const option options[] = {
|
||||||
{ "opencl-platform", 1, nullptr, IConfig::OclPlatformKey },
|
{ "opencl-platform", 1, nullptr, IConfig::OclPlatformKey },
|
||||||
{ "opencl-loader", 1, nullptr, IConfig::OclLoaderKey },
|
{ "opencl-loader", 1, nullptr, IConfig::OclLoaderKey },
|
||||||
{ "opencl-no-cache", 0, nullptr, IConfig::OclCacheKey },
|
{ "opencl-no-cache", 0, nullptr, IConfig::OclCacheKey },
|
||||||
|
# endif
|
||||||
|
# ifdef XMRIG_FEATURE_CUDA
|
||||||
|
{ "cuda", 0, nullptr, IConfig::CudaKey },
|
||||||
|
{ "cuda-loader", 1, nullptr, IConfig::CudaLoaderKey },
|
||||||
# endif
|
# endif
|
||||||
{ nullptr, 0, nullptr, 0 }
|
{ nullptr, 0, nullptr, 0 }
|
||||||
};
|
};
|
||||||
|
|
|
@ -103,11 +103,17 @@ static inline const std::string &usage()
|
||||||
u += " --opencl enable OpenCL mining backend\n";
|
u += " --opencl enable OpenCL mining backend\n";
|
||||||
u += " --opencl-devices=N list of OpenCL devices to use\n";
|
u += " --opencl-devices=N list of OpenCL devices to use\n";
|
||||||
u += " --opencl-platform=N OpenCL platform index or name\n";
|
u += " --opencl-platform=N OpenCL platform index or name\n";
|
||||||
u += " --opencl-loader=N path to OpenCL-ICD-Loader (OpenCL.dll or libOpenCL.so)\n";
|
u += " --opencl-loader=PATH path to OpenCL-ICD-Loader (OpenCL.dll or libOpenCL.so)\n";
|
||||||
u += " --opencl-no-cache disable OpenCL cache\n";
|
u += " --opencl-no-cache disable OpenCL cache\n";
|
||||||
u += " --print-platforms print available OpenCL platforms and exit\n";
|
u += " --print-platforms print available OpenCL platforms and exit\n";
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_CUDA
|
||||||
|
u += "\nCUDA backend:\n";
|
||||||
|
u += " --cuda enable CUDA mining backend\n";
|
||||||
|
u += " --cuda-loader=PATH path to CUDA plugin (xmrig-cuda.dll or libxmrig-cuda.so)\n";
|
||||||
|
# endif
|
||||||
|
|
||||||
u += "\nLogging:\n";
|
u += "\nLogging:\n";
|
||||||
|
|
||||||
# ifdef HAVE_SYSLOG_H
|
# ifdef HAVE_SYSLOG_H
|
||||||
|
|
Loading…
Reference in a new issue