mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-25 05:40:39 -05:00
Compare commits
18 Commits
v6.22.0
...
b30f0122a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b30f0122a7 | ||
|
|
3bc2f27b97 | ||
|
|
e32731b60b | ||
|
|
e1ae367084 | ||
|
|
bc1c8358c4 | ||
|
|
e0af8f0c6b | ||
|
|
29f9c8cf4c | ||
|
|
26f4936f6f | ||
|
|
a411ee3565 | ||
|
|
01bd0d48a1 | ||
|
|
20d555668b | ||
|
|
56baec762f | ||
|
|
17a52fb418 | ||
|
|
7e4caa8929 | ||
|
|
ef14d55aa5 | ||
|
|
5776fdcc20 | ||
|
|
fe0f69031b | ||
|
|
e682f89298 |
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
HWLOC_VERSION_MAJOR="2"
|
||||
HWLOC_VERSION_MINOR="10"
|
||||
HWLOC_VERSION_PATCH="0"
|
||||
HWLOC_VERSION_MINOR="11"
|
||||
HWLOC_VERSION_PATCH="2"
|
||||
|
||||
HWLOC_VERSION="${HWLOC_VERSION_MAJOR}.${HWLOC_VERSION_MINOR}.${HWLOC_VERSION_PATCH}"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
OPENSSL_VERSION="3.0.14"
|
||||
OPENSSL_VERSION="3.0.15"
|
||||
|
||||
mkdir -p deps
|
||||
mkdir -p deps/include
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
UV_VERSION="1.48.0"
|
||||
UV_VERSION="1.49.2"
|
||||
|
||||
mkdir -p deps
|
||||
mkdir -p deps/include
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -67,7 +67,8 @@ VirtualMemory* cn_heavyZen3Memory = nullptr;
|
||||
template<size_t N>
|
||||
xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
|
||||
Worker(id, data.affinity, data.priority),
|
||||
m_algorithm(data.algorithm),
|
||||
m_algorithm_family(data.algorithm.family()),
|
||||
m_algorithm_l3(data.algorithm.l3()),
|
||||
m_assembly(data.assembly),
|
||||
m_hwAES(data.hwAES),
|
||||
m_yield(data.yield),
|
||||
@@ -82,24 +83,29 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
|
||||
const uint32_t model = Cpu::info()->model();
|
||||
const bool is_vermeer = (arch == ICpuInfo::ARCH_ZEN3) && (model == 0x21);
|
||||
const bool is_raphael = (arch == ICpuInfo::ARCH_ZEN4) && (model == 0x61);
|
||||
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm.family() == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && (is_vermeer || is_raphael)) {
|
||||
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm_family == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && (is_vermeer || is_raphael)) {
|
||||
std::lock_guard<std::mutex> lock(cn_heavyZen3MemoryMutex);
|
||||
if (!cn_heavyZen3Memory) {
|
||||
// Round up number of threads to the multiple of 8
|
||||
const size_t num_threads = ((m_threads + 7) / 8) * 8;
|
||||
cn_heavyZen3Memory = new VirtualMemory(m_algorithm.l3() * num_threads, data.hugePages, false, false, node());
|
||||
cn_heavyZen3Memory = new VirtualMemory(m_algorithm_l3 * num_threads, data.hugePages, false, false, node());
|
||||
}
|
||||
m_memory = cn_heavyZen3Memory;
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
m_memory = new VirtualMemory(m_algorithm.l3() * N, data.hugePages, false, true, node());
|
||||
m_memory = new VirtualMemory(m_algorithm_l3 * N, data.hugePages, false, true, node());
|
||||
}
|
||||
|
||||
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||
m_ghHelper = ghostrider::create_helper_thread(affinity(), data.priority, data.affinities);
|
||||
# endif
|
||||
|
||||
std::vector<Algorithm> family = Algorithm::all([this](const Algorithm &algo) -> bool { return m_algorithm_family == algo.family(); });
|
||||
for (auto& algorithm : family) {
|
||||
m_hash_fns.emplace(algorithm.id(), CnHash::fn(algorithm, m_av, m_assembly));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +130,23 @@ xmrig::CpuWorker<N>::~CpuWorker()
|
||||
# endif
|
||||
}
|
||||
|
||||
template<size_t N>
|
||||
xmrig::cn_hash_fun xmrig::CpuWorker<N>::fn(const Algorithm &algorithm) const {
|
||||
#if 1
|
||||
if (!algorithm.isValid()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const auto it = m_hash_fns.find(algorithm.id());
|
||||
if (it != m_hash_fns.end()) {
|
||||
return it->second;
|
||||
}
|
||||
return nullptr;
|
||||
#else
|
||||
return CnHash::fn(algorithm, m_av, m_assembly);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
template<size_t N>
|
||||
@@ -159,7 +182,7 @@ template<size_t N>
|
||||
bool xmrig::CpuWorker<N>::selfTest()
|
||||
{
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
if (m_algorithm.family() == Algorithm::RANDOM_X) {
|
||||
if (m_algorithm_family == Algorithm::RANDOM_X) {
|
||||
return N == 1;
|
||||
}
|
||||
# endif
|
||||
@@ -167,12 +190,12 @@ bool xmrig::CpuWorker<N>::selfTest()
|
||||
allocateCnCtx();
|
||||
|
||||
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||
if (m_algorithm.family() == Algorithm::GHOSTRIDER) {
|
||||
if (m_algorithm_family == Algorithm::GHOSTRIDER) {
|
||||
return (N == 8) && verify(Algorithm::GHOSTRIDER_RTM, test_output_gr);
|
||||
}
|
||||
# endif
|
||||
|
||||
if (m_algorithm.family() == Algorithm::CN) {
|
||||
if (m_algorithm_family == Algorithm::CN) {
|
||||
const bool rc = verify(Algorithm::CN_0, test_output_v0) &&
|
||||
verify(Algorithm::CN_1, test_output_v1) &&
|
||||
verify(Algorithm::CN_2, test_output_v2) &&
|
||||
@@ -190,14 +213,14 @@ bool xmrig::CpuWorker<N>::selfTest()
|
||||
}
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_LITE
|
||||
if (m_algorithm.family() == Algorithm::CN_LITE) {
|
||||
if (m_algorithm_family == Algorithm::CN_LITE) {
|
||||
return verify(Algorithm::CN_LITE_0, test_output_v0_lite) &&
|
||||
verify(Algorithm::CN_LITE_1, test_output_v1_lite);
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_HEAVY
|
||||
if (m_algorithm.family() == Algorithm::CN_HEAVY) {
|
||||
if (m_algorithm_family == Algorithm::CN_HEAVY) {
|
||||
return verify(Algorithm::CN_HEAVY_0, test_output_v0_heavy) &&
|
||||
verify(Algorithm::CN_HEAVY_XHV, test_output_xhv_heavy) &&
|
||||
verify(Algorithm::CN_HEAVY_TUBE, test_output_tube_heavy);
|
||||
@@ -205,20 +228,20 @@ bool xmrig::CpuWorker<N>::selfTest()
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_PICO
|
||||
if (m_algorithm.family() == Algorithm::CN_PICO) {
|
||||
if (m_algorithm_family == Algorithm::CN_PICO) {
|
||||
return verify(Algorithm::CN_PICO_0, test_output_pico_trtl) &&
|
||||
verify(Algorithm::CN_PICO_TLO, test_output_pico_tlo);
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_FEMTO
|
||||
if (m_algorithm.family() == Algorithm::CN_FEMTO) {
|
||||
if (m_algorithm_family == Algorithm::CN_FEMTO) {
|
||||
return verify(Algorithm::CN_UPX2, test_output_femto_upx2);
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ARGON2
|
||||
if (m_algorithm.family() == Algorithm::ARGON2) {
|
||||
if (m_algorithm_family == Algorithm::ARGON2) {
|
||||
return verify(Algorithm::AR2_CHUKWA, argon2_chukwa_test_out) &&
|
||||
verify(Algorithm::AR2_CHUKWA_V2, argon2_chukwa_v2_test_out) &&
|
||||
verify(Algorithm::AR2_WRKZ, argon2_wrkz_test_out);
|
||||
@@ -262,7 +285,7 @@ void xmrig::CpuWorker<N>::start()
|
||||
while (!Nonce::isOutdated(Nonce::CPU, m_job.sequence())) {
|
||||
const Job &job = m_job.currentJob();
|
||||
|
||||
if (job.algorithm().l3() != m_algorithm.l3()) {
|
||||
if (job.algorithm().l3() != m_algorithm_l3) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -359,7 +382,9 @@ void xmrig::CpuWorker<N>::start()
|
||||
}
|
||||
}
|
||||
|
||||
consumeJob();
|
||||
if (!Nonce::isPaused()) {
|
||||
consumeJob();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,11 +512,11 @@ void xmrig::CpuWorker<N>::allocateCnCtx()
|
||||
# ifdef XMRIG_ALGO_CN_HEAVY
|
||||
// cn-heavy optimization for Zen3 CPUs
|
||||
if (m_memory == cn_heavyZen3Memory) {
|
||||
shift = (id() / 8) * m_algorithm.l3() * 8 + (id() % 8) * 64;
|
||||
shift = (id() / 8) * m_algorithm_l3 * 8 + (id() % 8) * 64;
|
||||
}
|
||||
# endif
|
||||
|
||||
CnCtx::create(m_ctx, m_memory->scratchpad() + shift, m_algorithm.l3(), N);
|
||||
CnCtx::create(m_ctx, m_memory->scratchpad() + shift, m_algorithm_l3, N);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "base/tools/Object.h"
|
||||
#include "net/JobResult.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
class randomx_vm;
|
||||
@@ -55,7 +57,7 @@ public:
|
||||
size_t threads() const override
|
||||
{
|
||||
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||
return ((m_algorithm.family() == Algorithm::GHOSTRIDER) && m_ghHelper) ? 2 : 1;
|
||||
return ((m_algorithm_family == Algorithm::GHOSTRIDER) && m_ghHelper) ? 2 : 1;
|
||||
# else
|
||||
return 1;
|
||||
# endif
|
||||
@@ -71,7 +73,7 @@ protected:
|
||||
inline void jobEarlyNotification(const Job&) override {}
|
||||
|
||||
private:
|
||||
inline cn_hash_fun fn(const Algorithm &algorithm) const { return CnHash::fn(algorithm, m_av, m_assembly); }
|
||||
cn_hash_fun fn(const Algorithm &algorithm) const;
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
void allocateRandomX_VM();
|
||||
@@ -84,8 +86,10 @@ private:
|
||||
void consumeJob();
|
||||
|
||||
alignas(8) uint8_t m_hash[N * 32]{ 0 };
|
||||
const Algorithm m_algorithm;
|
||||
const uint32_t m_algorithm_family;
|
||||
const size_t m_algorithm_l3;
|
||||
const Assembly m_assembly;
|
||||
std::unordered_map<Algorithm::Id, cn_hash_fun> m_hash_fns;
|
||||
const bool m_hwAES;
|
||||
const bool m_yield;
|
||||
const CnHash::AlgoVariant m_av;
|
||||
|
||||
@@ -326,7 +326,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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }},
|
||||
|
||||
@@ -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