1
0
mirror of https://github.com/xmrig/xmrig.git synced 2026-06-29 06:01:37 -04:00

Compare commits

...

15 Commits

Author SHA1 Message Date
MoneroOcean 5e90875050 Fixed compilation error with MSVC 2022 2024-05-29 19:32:51 +03:00
MoneroOcean 68c41aa45b Merge pull request #137 from Spudz76/pr-mo-flex-msvc-error
flex: fix compilation error with MSVC 2022
2024-05-29 09:31:28 -07:00
MoneroOcean 2a90c51f69 Merge branch 'master' into pr-mo-flex-msvc-error 2024-05-29 09:31:00 -07:00
MoneroOcean 4499c943be Flex algo ARM fix 2024-05-29 19:17:58 +03:00
MoneroOcean 92f27606df Flex algo ARM fix 2024-05-29 19:13:43 +03:00
Tony Butler 60b8d904c2 flex: fix compilation error with MSVC 2022 2024-05-29 10:10:24 -06:00
MoneroOcean 525530b012 Fixed issue with mining not working after brnchmark 2024-05-29 18:51:21 +03:00
MoneroOcean 0079b3c160 Merge pull request #133 from Spudz76/pr-mo-fix-disabled-algos
MoBenchmark: use ifdefs to avoid bugs when algos are compiled out
2024-05-29 08:49:19 -07:00
MoneroOcean dcf20f5f82 Merge pull request #135 from Spudz76/pr-mo-flex-warnings
flex: fix various warnings
2024-05-29 08:48:18 -07:00
MoneroOcean 700ba19244 Merge pull request #136 from Spudz76/pr-mo-algo_perf-zeros
MoBenchmark: don't write algo_perf==0.0 items to config
2024-05-29 08:46:27 -07:00
MoneroOcean 7e9881bbe6 Merge pull request #134 from Spudz76/pr-mo-fix-no-results
MoBenchmark: restore listener at the end of finish()
2024-05-29 08:45:14 -07:00
Tony Butler 7a34e3f901 MoBenchmark: don't write algo_perf==0.0 items to config 2024-05-29 09:01:24 -06:00
Tony Butler 85aca86d79 flex: fix various warnings 2024-05-29 08:16:23 -06:00
Tony Butler 976c3c2e76 MoBenchmark: restore listener at the end of finish() 2024-05-29 08:05:09 -06:00
Tony Butler 8c88ada9ea MoBenchmark: use ifdefs to avoid bugs when algos are compiled out 2024-05-29 07:45:22 -06:00
5 changed files with 48 additions and 11 deletions
+18 -1
View File
@@ -56,6 +56,7 @@ void MoBenchmark::finish() {
LOG_INFO("%s " BRIGHT_BLACK_BG(CYAN_BOLD_S " ALGO PERFORMANCE CALIBRATION COMPLETE "), Tags::benchmark());
m_controller->miner()->pause(); // do not compute anything before job from the pool
JobResults::stop();
JobResults::setListener(m_controller->network(), m_controller->config()->cpu().isHwAES());
m_controller->start();
}
@@ -67,6 +68,7 @@ rapidjson::Value MoBenchmark::toJSON(rapidjson::Document &doc) const
Value obj(kObjectType);
for (const Algorithm a : Algorithm::all()) {
if (algo_perf[a.id()] == 0.0f) continue;
obj.AddMember(StringRef(a.name()), algo_perf[a.id()], allocator);
}
@@ -118,10 +120,16 @@ double MoBenchmark::get_algo_perf(Algorithm::Id algo) const {
case Algorithm::CN_RWZ: return algo_perf[Algorithm::CN_R] / 3 * 4;
case Algorithm::CN_ZLS: return algo_perf[Algorithm::CN_R] / 3 * 4;
case Algorithm::CN_DOUBLE: return algo_perf[Algorithm::CN_R] / 2;
# ifdef XMRIG_ALGO_CN_LITE
case Algorithm::CN_LITE_0: return algo_perf[Algorithm::CN_LITE_1];
# endif
# ifdef XMRIG_ALGO_CN_PICO
case Algorithm::CN_PICO_TLO: return algo_perf[Algorithm::CN_PICO_0];
# endif
# ifdef XMRIG_ALGO_RANDOMX
case Algorithm::RX_SFX: return algo_perf[Algorithm::RX_0];
case Algorithm::RX_XEQ: return algo_perf[Algorithm::RX_ARQ];
# endif
default: return algo_perf[algo];
}
}
@@ -147,17 +155,21 @@ void MoBenchmark::start() {
m_bench_job = Job(false, Algorithm(bench_algos[m_bench_algo]), "benchmark");
m_bench_job.setId(algo.name()); // need to set different id so that workers will see job change
switch (algo.id()) {
# ifdef XMRIG_ALGO_KAWPOW
case Algorithm::KAWPOW_RVN:
m_bench_job.setBlob("4c38e8a5f7b2944d1e4274635d828519b97bc64a1f1c7896ecdbb139989aa0e80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
m_bench_job.setDiff(Job::toDiff(strtoull("000000639c000000", nullptr, 16)));
m_bench_job.setHeight(1500000);
break;
# endif
# ifdef XMRIG_ALGO_GHOSTRIDER
case Algorithm::GHOSTRIDER_RTM:
case Algorithm::FLEX_KCN:
m_bench_job.setBlob("000000208c246d0b90c3b389c4086e8b672ee040d64db5b9648527133e217fbfa48da64c0f3c0a0b0e8350800568b40fbb323ac3ccdf2965de51b9aaeb939b4f11ff81c49b74a16156ff251c00000000");
m_bench_job.setDiff(1000);
break;
# endif
default:
// 99 here to trigger all future bench_algo versions for auto veriant detection based on block version
@@ -215,11 +227,15 @@ void MoBenchmark::onJobResult(const JobResult& result) {
if (!(hashrate = t[1]))
if (!(hashrate = t[0]))
hashrate = static_cast<double>(m_hash_count) * result.diff / (now - m_bench_start) * 1000.0f;
# ifdef XMRIG_ALGO_KAWPOW
if (algo.id() == Algorithm::KAWPOW_RVN) hashrate /= ((double)0xFFFFFFFFFFFFFFFF) / 0xFF000000;
# endif
algo_perf[algo.id()] = hashrate; // store hashrate result
LOG_INFO("%s " BRIGHT_BLACK_BG(WHITE_BOLD_S " Algo " MAGENTA_BOLD_S "%s" WHITE_BOLD_S " hashrate: " CYAN_BOLD_S "%f "), Tags::benchmark(), algo.name(), hashrate);
run_next_bench_algo();
} else switch (algo.id()) { // Update GhostRider algo job to produce more accurate perf results
}
# ifdef XMRIG_ALGO_GHOSTRIDER
else switch (algo.id()) { // Update GhostRider algo job to produce more accurate perf results
case Algorithm::GHOSTRIDER_RTM: {
uint8_t* blob = m_bench_job.blob();
++ *reinterpret_cast<uint32_t*>(blob+4);
@@ -228,6 +244,7 @@ void MoBenchmark::onJobResult(const JobResult& result) {
}
default:;
}
# endif
}
uint64_t MoBenchmark::get_now() const { // get current time in ms
+16
View File
@@ -35,20 +35,36 @@ class Job;
class MoBenchmark : public IJobResultListener {
const Algorithm::Id bench_algos[15] = {
# ifdef XMRIG_ALGO_GHOSTRIDER
Algorithm::FLEX_KCN,
Algorithm::GHOSTRIDER_RTM,
# endif
Algorithm::CN_R,
# ifdef XMRIG_ALGO_CN_LITE
Algorithm::CN_LITE_1,
# endif
# ifdef XMRIG_ALGO_CN_HEAVY
Algorithm::CN_HEAVY_XHV,
# endif
# ifdef XMRIG_ALGO_CN_PICO
Algorithm::CN_PICO_0,
# endif
Algorithm::CN_CCX,
# ifdef XMRIG_ALGO_CN_GPU
Algorithm::CN_GPU,
# endif
# ifdef XMRIG_ALGO_ARGON2
Algorithm::AR2_CHUKWA_V2,
# endif
# ifdef XMRIG_ALGO_KAWPOW
Algorithm::KAWPOW_RVN,
# endif
# ifdef XMRIG_ALGO_RANDOMX
Algorithm::RX_0,
Algorithm::RX_GRAFT,
Algorithm::RX_ARQ,
Algorithm::RX_XLA,
# endif
Algorithm::INVALID
};
+9 -1
View File
@@ -63,8 +63,13 @@ static inline void do_skein_hash(const uint8_t *input, size_t len, uint8_t *outp
xmr_skein(input, output);
}
static inline void do_flex_skein_hash(const uint8_t* input, size_t len, uint8_t* output) {
int r = skein_hash(512, input, 8 * len, (uint8_t*)output);
assert(SKEIN_SUCCESS == r);
}
void (* const extra_hashes[4])(const uint8_t *, size_t, uint8_t *) = {do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash};
void (* const extra_hashes_flex[3])(const uint8_t *, size_t, uint8_t *) = {do_blake_hash, do_groestl_hash, do_flex_skein_hash};
// This will shift and xor tmp1 into itself as 4 32-bit vals such as
@@ -543,7 +548,10 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si
cn_implode_scratchpad<ALGO, SOFT_AES>(reinterpret_cast<const __m128i *>(ctx[0]->memory), reinterpret_cast<__m128i *>(ctx[0]->state));
keccakf(h0, 24);
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
if (height == 101) // Flex algo ugly hack
extra_hashes_flex[ctx[0]->state[0] & 2](ctx[0]->state, 200, output);
else
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
}
+4 -8
View File
@@ -74,16 +74,14 @@ static void selectAlgo(unsigned char nibble, bool* selectedAlgos, uint8_t* selec
}
static void getAlgoString(void *mem, unsigned int size, uint8_t* selectedAlgoOutput, int algoCount) {
int i;
unsigned char *p = (unsigned char *)mem;
unsigned int len = size/2;
unsigned char j = 0;
bool selectedAlgo[algoCount];
bool* selectedAlgo = new bool[algoCount];
for(int z=0; z < algoCount; z++) {
selectedAlgo[z] = false;
}
int selectedCount = 0;
for (i=0;i<len; i++) {
for (unsigned int i=0;i<len; i++) {
selectAlgo(p[i], selectedAlgo, selectedAlgoOutput, algoCount, &selectedCount);
if(selectedCount == algoCount) {
break;
@@ -97,13 +95,13 @@ static void getAlgoString(void *mem, unsigned int size, uint8_t* selectedAlgoOut
}
}
}
delete [] selectedAlgo;
}
void print_hex_memory(void *mem, unsigned int size) {
int i;
unsigned char *p = (unsigned char *)mem;
unsigned int len = size/2;
for (i=0;i<len; i++) {
for (unsigned int i=0;i<len; i++) {
printf("%02x", p[(len - i - 1)]);
}
printf("\n");
@@ -126,7 +124,6 @@ void flex_hash(const char* input, char* output, cryptonight_ctx** ctx) {
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_skein512_context ctx_skein;
sph_luffa512_context ctx_luffa;
@@ -138,7 +135,6 @@ void flex_hash(const char* input, char* output, cryptonight_ctx** ctx) {
sph_fugue512_context ctx_fugue;
sph_shabal512_context ctx_shabal;
sph_whirlpool_context ctx_whirlpool;
sph_sha256_context ctx_sha;
void *in = (void*) input;
int size = 80;
sph_keccak512_init(&ctx_keccak);
+1 -1
View File
@@ -22,7 +22,7 @@
#define APP_ID "xmrig"
#define APP_NAME "XMRig"
#define APP_DESC "XMRig miner"
#define APP_VERSION "6.21.3-mo8"
#define APP_VERSION "6.21.3-mo11"
#define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2024 xmrig.com"