Added command line options --cuda and --cuda-loader.

This commit is contained in:
XMRig
2019-10-29 00:42:49 +07:00
parent 80fd0f9fab
commit 9dfa38f1e7
7 changed files with 40 additions and 3 deletions

View File

@ -77,11 +77,16 @@ OpenCL backend:
--opencl enable OpenCL mining backend
--opencl-devices=N list of OpenCL devices to use
--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
--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:
-S, --syslog use system log for output messages
-l, --log-file=FILE log all output to a file
--print-time=N print hashrate report every N seconds
--no-color disable colored output

View File

@ -134,6 +134,8 @@ public:
CudaLaunchKey = 1204,
CudaAffinityKey = 1205,
CudaMaxUsageKey = 1206,
CudaKey = 1207,
CudaLoaderKey = 1208
};
virtual ~IConfig() = default;

View File

@ -38,6 +38,10 @@
"cn/0": false,
"cn-lite/0": false
},
"cuda": {
"enabled": false,
"loader": null,
},
"donate-level": 5,
"donate-over-proxy": 1,
"log-file": null,
@ -64,4 +68,4 @@
"syslog": false,
"user-agent": null,
"watch": true
}
}

View File

@ -47,6 +47,10 @@ static const char *kRandomX = "randomx";
static const char *kOcl = "opencl";
#endif
#ifdef XMRIG_FEATURE_CUDA
static const char *kCuda = "cuda";
#endif
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);
# 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:
break;
}

View File

@ -72,6 +72,10 @@ R"===(
"cn/0": false,
"cn-lite/0": false
},
"cuda": {
"enabled": false,
"loader": null,
},
"donate-level": 5,
"donate-over-proxy": 1,
"log-file": null,

View File

@ -103,6 +103,10 @@ static const option options[] = {
{ "opencl-platform", 1, nullptr, IConfig::OclPlatformKey },
{ "opencl-loader", 1, nullptr, IConfig::OclLoaderKey },
{ "opencl-no-cache", 0, nullptr, IConfig::OclCacheKey },
# endif
# ifdef XMRIG_FEATURE_CUDA
{ "cuda", 0, nullptr, IConfig::CudaKey },
{ "cuda-loader", 1, nullptr, IConfig::CudaLoaderKey },
# endif
{ nullptr, 0, nullptr, 0 }
};

View File

@ -103,11 +103,17 @@ static inline const std::string &usage()
u += " --opencl enable OpenCL mining backend\n";
u += " --opencl-devices=N list of OpenCL devices to use\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 += " --print-platforms print available OpenCL platforms and exit\n";
# 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";
# ifdef HAVE_SYSLOG_H