Merge branch 'evo' of https://github.com/xmrig/xmrig
This commit is contained in:
commit
61e8eb5ada
5 changed files with 62 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
# v2.99.3-beta
|
||||||
|
- [#1082](https://github.com/xmrig/xmrig/issues/1082) Fixed hwloc auto configuration on AMD FX CPUs.
|
||||||
|
- Added command line option `--export-topology` for export hwloc topology to a XML file.
|
||||||
|
|
||||||
# v2.99.2-beta
|
# v2.99.2-beta
|
||||||
- [#1077](https://github.com/xmrig/xmrig/issues/1077) Added NUMA support via **hwloc**.
|
- [#1077](https://github.com/xmrig/xmrig/issues/1077) Added NUMA support via **hwloc**.
|
||||||
- Fixed miner freeze when switch between RandomX variants.
|
- Fixed miner freeze when switch between RandomX variants.
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cpu/platform/HwlocCpuInfo.h"
|
#include "backend/cpu/platform/HwlocCpuInfo.h"
|
||||||
|
#include "base/io/log/Log.h"
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
@ -201,6 +202,12 @@ xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm) const
|
||||||
processTopLevelCache(cache, algorithm, threads);
|
processTopLevelCache(cache, algorithm, threads);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (threads.empty()) {
|
||||||
|
LOG_WARN("hwloc auto configuration for algorithm \"%s\" failed.", algorithm.shortName());
|
||||||
|
|
||||||
|
return BasicCpuInfo::threads(algorithm);
|
||||||
|
}
|
||||||
|
|
||||||
return threads;
|
return threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,9 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
static int showVersion()
|
static int showVersion()
|
||||||
{
|
{
|
||||||
printf(APP_NAME " " APP_VERSION "\n built on " __DATE__
|
printf(APP_NAME " " APP_VERSION "\n built on " __DATE__
|
||||||
|
@ -92,6 +95,36 @@ static int showVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_FEATURE_HWLOC
|
||||||
|
static int exportTopology(const Process &process)
|
||||||
|
{
|
||||||
|
const String path = process.location(Process::ExeLocation, "topology.xml");
|
||||||
|
|
||||||
|
hwloc_topology_t topology;
|
||||||
|
hwloc_topology_init(&topology);
|
||||||
|
hwloc_topology_load(topology);
|
||||||
|
|
||||||
|
# if HWLOC_API_VERSION >= 0x20000
|
||||||
|
if (hwloc_topology_export_xml(topology, path, 0) == -1) {
|
||||||
|
# else
|
||||||
|
if (hwloc_topology_export_xml(topology, path) == -1) {
|
||||||
|
# endif
|
||||||
|
printf("failed to export hwloc topology.\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("hwloc topology successfully exported to \"%s\"\n", path.data());
|
||||||
|
}
|
||||||
|
|
||||||
|
hwloc_topology_destroy(topology);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
xmrig::Entry::Id xmrig::Entry::get(const Process &process)
|
xmrig::Entry::Id xmrig::Entry::get(const Process &process)
|
||||||
{
|
{
|
||||||
const Arguments &args = process.arguments();
|
const Arguments &args = process.arguments();
|
||||||
|
@ -103,11 +136,17 @@ xmrig::Entry::Id xmrig::Entry::get(const Process &process)
|
||||||
return Version;
|
return Version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_HWLOC
|
||||||
|
if (args.hasArg("--export-topology")) {
|
||||||
|
return Topo;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
return Default;
|
return Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int xmrig::Entry::exec(const Process &, Id id)
|
int xmrig::Entry::exec(const Process &process, Id id)
|
||||||
{
|
{
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case Usage:
|
case Usage:
|
||||||
|
@ -117,6 +156,11 @@ int xmrig::Entry::exec(const Process &, Id id)
|
||||||
case Version:
|
case Version:
|
||||||
return showVersion();
|
return showVersion();
|
||||||
|
|
||||||
|
# ifdef XMRIG_FEATURE_HWLOC
|
||||||
|
case Topo:
|
||||||
|
return exportTopology(process);
|
||||||
|
# endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,8 @@ public:
|
||||||
enum Id {
|
enum Id {
|
||||||
Default,
|
Default,
|
||||||
Usage,
|
Usage,
|
||||||
Version
|
Version,
|
||||||
|
Topo
|
||||||
};
|
};
|
||||||
|
|
||||||
static Id get(const Process &process);
|
static Id get(const Process &process);
|
||||||
|
|
|
@ -113,6 +113,10 @@ Options:\n\
|
||||||
--randomx-init=N threads count to initialize RandomX dataset\n\
|
--randomx-init=N threads count to initialize RandomX dataset\n\
|
||||||
--randomx-no-numa disable NUMA support for RandomX\n"
|
--randomx-no-numa disable NUMA support for RandomX\n"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef XMRIG_FEATURE_HWLOC
|
||||||
|
"\
|
||||||
|
--export-topology export hwloc topology to a XML file and exit\n"
|
||||||
|
#endif
|
||||||
"\
|
"\
|
||||||
--dry-run test configuration and exit\n\
|
--dry-run test configuration and exit\n\
|
||||||
-h, --help display this help and exit\n\
|
-h, --help display this help and exit\n\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue