mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-24 13:32:46 -05:00
Compare commits
17 Commits
v6.22.0
...
c0d96215f6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0d96215f6 | ||
|
|
e1ae367084 | ||
|
|
bc1c8358c4 | ||
|
|
e0af8f0c6b | ||
|
|
29f9c8cf4c | ||
|
|
26f4936f6f | ||
|
|
a411ee3565 | ||
|
|
01bd0d48a1 | ||
|
|
20d555668b | ||
|
|
56baec762f | ||
|
|
17a52fb418 | ||
|
|
7e4caa8929 | ||
|
|
ef14d55aa5 | ||
|
|
5776fdcc20 | ||
|
|
fe0f69031b | ||
|
|
e682f89298 | ||
|
|
14128cbdb4 |
@@ -8,7 +8,7 @@ else
|
||||
modprobe msr allow_writes=on
|
||||
fi
|
||||
|
||||
if grep -E 'AMD Ryzen|AMD EPYC' /proc/cpuinfo > /dev/null;
|
||||
if grep -E 'AMD Ryzen|AMD EPYC|AuthenticAMD' /proc/cpuinfo > /dev/null;
|
||||
then
|
||||
if grep "cpu family[[:space:]]\{1,\}:[[:space:]]25" /proc/cpuinfo > /dev/null;
|
||||
then
|
||||
@@ -28,6 +28,14 @@ if grep -E 'AMD Ryzen|AMD EPYC' /proc/cpuinfo > /dev/null;
|
||||
wrmsr -a 0xc001102b 0x2000cc10
|
||||
echo "MSR register values for Zen3 applied"
|
||||
fi
|
||||
elif grep "cpu family[[:space:]]\{1,\}:[[:space:]]26" /proc/cpuinfo > /dev/null;
|
||||
then
|
||||
echo "Detected Zen5 CPU"
|
||||
wrmsr -a 0xc0011020 0x4400000000000
|
||||
wrmsr -a 0xc0011021 0x4000000000040
|
||||
wrmsr -a 0xc0011022 0x8680000401570000
|
||||
wrmsr -a 0xc001102b 0x2040cc10
|
||||
echo "MSR register values for Zen5 applied"
|
||||
else
|
||||
echo "Detected Zen1/Zen2 CPU"
|
||||
wrmsr -a 0xc0011020 0
|
||||
|
||||
@@ -359,7 +359,9 @@ void xmrig::CpuWorker<N>::start()
|
||||
}
|
||||
}
|
||||
|
||||
consumeJob();
|
||||
if (!Nonce::isPaused()) {
|
||||
consumeJob();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
#ifdef XMRIG_FEATURE_HWLOC
|
||||
using hwloc_const_bitmap_t = const struct hwloc_bitmap_s *;
|
||||
using hwloc_topology_t = struct hwloc_topology *;
|
||||
#define MEMBIND_SUCCESS 1
|
||||
#define MEMBIND_FAIL_SUPP -1
|
||||
#define MEMBIND_FAIL_NODE -2
|
||||
#define MEMBIND_FAIL_BIND -3
|
||||
#endif
|
||||
|
||||
|
||||
@@ -126,7 +130,7 @@ public:
|
||||
virtual uint32_t model() const = 0;
|
||||
|
||||
# ifdef XMRIG_FEATURE_HWLOC
|
||||
virtual bool membind(hwloc_const_bitmap_t nodeset) = 0;
|
||||
virtual int8_t membind(hwloc_const_bitmap_t nodeset) = 0;
|
||||
virtual const std::vector<uint32_t> &nodeset() const = 0;
|
||||
virtual hwloc_topology_t topology() const = 0;
|
||||
# endif
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <errno.h>
|
||||
#include <hwloc.h>
|
||||
|
||||
|
||||
@@ -191,16 +192,25 @@ xmrig::HwlocCpuInfo::~HwlocCpuInfo()
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::HwlocCpuInfo::membind(hwloc_const_bitmap_t nodeset)
|
||||
int8_t xmrig::HwlocCpuInfo::membind(hwloc_const_bitmap_t nodeset)
|
||||
{
|
||||
if (!hwloc_topology_get_support(m_topology)->membind->set_thisthread_membind) {
|
||||
return false;
|
||||
return MEMBIND_FAIL_SUPP;
|
||||
}
|
||||
|
||||
# if HWLOC_API_VERSION >= 0x20000
|
||||
return hwloc_set_membind(m_topology, nodeset, HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_THREAD | HWLOC_MEMBIND_BYNODESET) >= 0;
|
||||
int rv = hwloc_set_membind(m_topology, nodeset, HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_THREAD | HWLOC_MEMBIND_BYNODESET);
|
||||
int error = errno;
|
||||
|
||||
if (rv < 0) {
|
||||
LOG_WARN("hwloc_set_membind() error: \"%s\"\n", strerror(error));
|
||||
return MEMBIND_FAIL_BIND;
|
||||
}
|
||||
|
||||
return MEMBIND_SUCCESS;
|
||||
# else
|
||||
return hwloc_set_membind_nodeset(m_topology, nodeset, HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_THREAD) >= 0;
|
||||
return (hwloc_set_membind_nodeset(m_topology, nodeset, HWLOC_MEMBIND_BIND, HWLOC_MEMBIND_THREAD) >= 0)
|
||||
? MEMBIND_SUCCESS : MEMBIND_FAIL_BIND;
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -326,7 +336,8 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
|
||||
}
|
||||
}
|
||||
|
||||
if (scratchpad == 2 * oneMiB) {
|
||||
// This code is supposed to run only on Intel CPUs
|
||||
if ((vendor() == VENDOR_INTEL) && (scratchpad == 2 * oneMiB)) {
|
||||
if (L2 && (cores.size() * oneMiB) == L2 && L2_associativity == 16 && L3 >= L2) {
|
||||
L3 = L2;
|
||||
extra = L2;
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
~HwlocCpuInfo() override;
|
||||
|
||||
protected:
|
||||
bool membind(hwloc_const_bitmap_t nodeset) override;
|
||||
int8_t membind(hwloc_const_bitmap_t nodeset) override;
|
||||
CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const override;
|
||||
|
||||
inline const char *backend() const override { return m_backend; }
|
||||
|
||||
@@ -158,7 +158,7 @@ void xmrig::CudaWorker::start()
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
if (!consumeJob()) {
|
||||
if (isReady() && !consumeJob()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ void xmrig::OclWorker::start()
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
if (!consumeJob()) {
|
||||
if (isReady() && !consumeJob()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,6 +576,11 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
const bool ready = d_ptr->initRX();
|
||||
|
||||
// Always reset nonce on RandomX dataset change
|
||||
if (!ready) {
|
||||
d_ptr->reset = true;
|
||||
}
|
||||
# else
|
||||
constexpr const bool ready = true;
|
||||
# endif
|
||||
|
||||
@@ -34,8 +34,13 @@ uint32_t xmrig::VirtualMemory::bindToNUMANode(int64_t affinity)
|
||||
|
||||
auto pu = hwloc_get_pu_obj_by_os_index(Cpu::info()->topology(), static_cast<unsigned>(affinity));
|
||||
|
||||
if (pu == nullptr || !Cpu::info()->membind(pu->nodeset)) {
|
||||
LOG_WARN("CPU #%02" PRId64 " warning: \"can't bind memory\"", affinity);
|
||||
if (pu == nullptr) {
|
||||
LOG_WARN("CPU #%02" PRId64 " warning: \"can't bind memory: hwloc_get_pu_obj_by_os_index() failed\"", affinity);
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (Cpu::info()->membind(pu->nodeset) < 0) {
|
||||
LOG_WARN("CPU #%02" PRId64 " warning: \"can't bind memory: Cpu::info()->membind() failed\"", affinity);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ xmrig -a gr -o rtm.suprnova.cc:4273 --tls -u WALLET_ADDRESS -p x
|
||||
|
||||
You can use **rtm_ghostrider_example.cmd** as a template and put pool URL and your wallet address there. The general XMRig documentation is available [here](https://xmrig.com/docs/miner).
|
||||
|
||||
**Using `--threads` or `-t` option is NOT recommended because it turns off advanced built-in config.** If you want to tweak the nubmer of threads used for GhostRider, it's recommended to start using config.json instead of command line. The best suitable command line option for this is `--cpu-max-threads-hint=N` where N can be between 0 and 100.
|
||||
**Using `--threads` or `-t` option is NOT recommended because it turns off advanced built-in config.** If you want to tweak the number of threads used for GhostRider, it's recommended to start using config.json instead of command line. The best suitable command line option for this is `--cpu-max-threads-hint=N` where N can be between 0 and 100.
|
||||
|
||||
## Performance
|
||||
|
||||
|
||||
@@ -267,8 +267,8 @@ namespace randomx {
|
||||
initDatasetAVX2 = false;
|
||||
break;
|
||||
case xmrig::ICpuInfo::ARCH_ZEN5:
|
||||
// TODO: test it
|
||||
initDatasetAVX2 = false;
|
||||
// AVX2 init is 49% faster on Zen5
|
||||
initDatasetAVX2 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +60,6 @@ static const std::array<MsrItems, kMsrArraySize> msrPresets = {
|
||||
MsrItems{{ 0xC0011020, 0ULL }, { 0xC0011021, 0x40ULL, ~0x20ULL }, { 0xC0011022, 0x1510000ULL }, { 0xC001102b, 0x2000cc16ULL }},
|
||||
MsrItems{{ 0xC0011020, 0x0004480000000000ULL }, { 0xC0011021, 0x001c000200000040ULL, ~0x20ULL }, { 0xC0011022, 0xc000000401570000ULL }, { 0xC001102b, 0x2000cc10ULL }},
|
||||
MsrItems{{ 0xC0011020, 0x0004400000000000ULL }, { 0xC0011021, 0x0004000000000040ULL, ~0x20ULL }, { 0xC0011022, 0x8680000401570000ULL }, { 0xC001102b, 0x2040cc10ULL }},
|
||||
|
||||
// TODO: Tune it for Zen5 when it's available
|
||||
MsrItems{{ 0xC0011020, 0x0004400000000000ULL }, { 0xC0011021, 0x0004000000000040ULL, ~0x20ULL }, { 0xC0011022, 0x8680000401570000ULL }, { 0xC001102b, 0x2040cc10ULL }},
|
||||
|
||||
MsrItems{{ 0x1a4, 0xf }},
|
||||
|
||||
@@ -42,20 +42,20 @@ constexpr size_t oneMiB = 1024 * 1024;
|
||||
static std::mutex mutex;
|
||||
|
||||
|
||||
static bool bindToNUMANode(uint32_t nodeId)
|
||||
static int8_t bindToNUMANode(uint32_t nodeId)
|
||||
{
|
||||
auto node = hwloc_get_numanode_obj_by_os_index(Cpu::info()->topology(), nodeId);
|
||||
if (!node) {
|
||||
return false;
|
||||
return MEMBIND_FAIL_NODE;
|
||||
}
|
||||
|
||||
if (Cpu::info()->membind(node->nodeset)) {
|
||||
if (Cpu::info()->membind(node->nodeset) > 0) {
|
||||
Platform::setThreadAffinity(static_cast<uint64_t>(hwloc_bitmap_first(node->cpuset)));
|
||||
|
||||
return true;
|
||||
return MEMBIND_SUCCESS;
|
||||
}
|
||||
|
||||
return false;
|
||||
return MEMBIND_FAIL_BIND;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,10 +210,20 @@ private:
|
||||
static void allocate(RxNUMAStoragePrivate *d_ptr, uint32_t nodeId, bool hugePages, bool oneGbPages)
|
||||
{
|
||||
const uint64_t ts = Chrono::steadyMSecs();
|
||||
const int8_t br = bindToNUMANode(nodeId);
|
||||
|
||||
if (!bindToNUMANode(nodeId)) {
|
||||
printSkipped(nodeId, "can't bind memory");
|
||||
|
||||
if (br < 0) {
|
||||
switch (br) {
|
||||
case MEMBIND_FAIL_SUPP:
|
||||
printSkipped(nodeId, "can't bind memory: hwloc_topology_get_support() failed");
|
||||
break;
|
||||
case MEMBIND_FAIL_NODE:
|
||||
printSkipped(nodeId, "can't bind memory: hwloc_get_numanode_obj_by_os_index() failed");
|
||||
break;
|
||||
case MEMBIND_FAIL_BIND:
|
||||
printSkipped(nodeId, "can't bind memory: Cpu::info()->membind() failed");
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define APP_ID "xmrig"
|
||||
#define APP_NAME "XMRig"
|
||||
#define APP_DESC "XMRig miner"
|
||||
#define APP_VERSION "6.22.0"
|
||||
#define APP_VERSION "6.22.1-dev"
|
||||
#define APP_DOMAIN "xmrig.com"
|
||||
#define APP_SITE "www.xmrig.com"
|
||||
#define APP_COPYRIGHT "Copyright (C) 2016-2024 xmrig.com"
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#define APP_VER_MAJOR 6
|
||||
#define APP_VER_MINOR 22
|
||||
#define APP_VER_PATCH 0
|
||||
#define APP_VER_PATCH 1
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# if (_MSC_VER >= 1930)
|
||||
|
||||
Reference in New Issue
Block a user