Fixed hashrate and diff display for KawPow
This commit is contained in:
parent
734f142b47
commit
6676126376
7 changed files with 127 additions and 41 deletions
|
@ -39,7 +39,7 @@
|
|||
inline static const char *format(double h, char *buf, size_t size)
|
||||
{
|
||||
if (std::isnormal(h)) {
|
||||
snprintf(buf, size, "%03.1f", h);
|
||||
snprintf(buf, size, (h < 100.0) ? "%04.2f" : "%03.1f", h);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
#include "base/tools/String.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "crypto/kawpow/KPCache.h"
|
||||
#include "crypto/kawpow/KPHash.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
|
@ -205,7 +207,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
inline void start(const Job &)
|
||||
inline void start(const Job &job)
|
||||
{
|
||||
LOG_INFO("%s use profile " BLUE_BG(WHITE_BOLD_S " %s ") WHITE_BOLD_S " (" CYAN_BOLD("%zu") WHITE_BOLD(" thread%s)") " scratchpad " CYAN_BOLD("%zu KB"),
|
||||
Tags::nvidia(),
|
||||
|
@ -215,7 +217,7 @@ public:
|
|||
algo.l3() / 1024
|
||||
);
|
||||
|
||||
Log::print(WHITE_BOLD("| # | GPU | BUS ID | I | T | B | BF | BS | MEM | NAME"));
|
||||
Log::print(WHITE_BOLD("| # | GPU | BUS ID | I | W | SI | MC | U | MEM | NAME"));
|
||||
|
||||
size_t algo_l3 = algo.l3();
|
||||
|
||||
|
@ -227,7 +229,16 @@ public:
|
|||
|
||||
size_t i = 0;
|
||||
for (const auto &data : threads) {
|
||||
Log::print("|" CYAN_BOLD("%3zu") " |" CYAN_BOLD("%4u") " |" YELLOW(" %7s") " |" CYAN_BOLD("%5d") " |" CYAN_BOLD("%4d") " |"
|
||||
size_t mem_used = (data.thread.threads() * data.thread.blocks()) * algo_l3 / oneMiB;
|
||||
|
||||
# ifdef XMRIG_ALGO_KAWPOW
|
||||
if (algo.family() == Algorithm::KAWPOW) {
|
||||
const uint32_t epoch = job.height() / KPHash::EPOCH_LENGTH;
|
||||
mem_used = (KPCache::cache_size(epoch) + KPCache::dag_size(epoch)) / oneMiB;
|
||||
}
|
||||
# endif
|
||||
|
||||
Log::print("|" CYAN_BOLD("%3zu") " |" CYAN_BOLD("%4u") " |" YELLOW(" %7s") " |" CYAN_BOLD("%9d") " |" CYAN_BOLD("%4d") " |"
|
||||
CYAN_BOLD("%4d") " |" CYAN_BOLD("%3d") " |" CYAN_BOLD("%4d") " |" CYAN("%5zu") " | " GREEN("%s"),
|
||||
i,
|
||||
data.thread.index(),
|
||||
|
@ -237,7 +248,7 @@ public:
|
|||
data.thread.blocks(),
|
||||
data.thread.bfactor(),
|
||||
data.thread.bsleep(),
|
||||
(data.thread.threads() * data.thread.blocks()) * algo_l3 / oneMiB,
|
||||
mem_used,
|
||||
data.device.name().data()
|
||||
);
|
||||
|
||||
|
@ -368,18 +379,30 @@ void xmrig::CudaBackend::printHashrate(bool details)
|
|||
return;
|
||||
}
|
||||
|
||||
char num[8 * 3] = { 0 };
|
||||
char num[16 * 3] = { 0 };
|
||||
|
||||
Log::print(WHITE_BOLD_S "| CUDA # | AFFINITY | 10s H/s | 60s H/s | 15m H/s |");
|
||||
const double hashrate_short = hashrate()->calc(Hashrate::ShortInterval);
|
||||
const double hashrate_medium = hashrate()->calc(Hashrate::MediumInterval);
|
||||
const double hashrate_large = hashrate()->calc(Hashrate::LargeInterval);
|
||||
|
||||
double scale = 1.0;
|
||||
const char* h = " H/s";
|
||||
|
||||
if ((hashrate_short >= 1e6) || (hashrate_medium >= 1e6) || (hashrate_large >= 1e6)) {
|
||||
scale = 1e-6;
|
||||
h = "MH/s";
|
||||
}
|
||||
|
||||
Log::print(WHITE_BOLD_S "| CUDA # | AFFINITY | 10s %s | 60s %s | 15m %s |", h, h, h);
|
||||
|
||||
size_t i = 0;
|
||||
for (const auto &data : d_ptr->threads) {
|
||||
Log::print("| %8zu | %8" PRId64 " | %7s | %7s | %7s |" CYAN_BOLD(" #%u") YELLOW(" %s") GREEN(" %s"),
|
||||
Log::print("| %8zu | %8" PRId64 " | %8s | %8s | %8s |" CYAN_BOLD(" #%u") YELLOW(" %s") GREEN(" %s"),
|
||||
i,
|
||||
data.thread.affinity(),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::ShortInterval), num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::MediumInterval), num + 8, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::LargeInterval), num + 8 * 2, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::ShortInterval) * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::MediumInterval) * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::LargeInterval) * scale, num + 16 * 2, sizeof num / 3),
|
||||
data.device.index(),
|
||||
data.device.topology().toString().data(),
|
||||
data.device.name().data()
|
||||
|
@ -388,10 +411,10 @@ void xmrig::CudaBackend::printHashrate(bool details)
|
|||
i++;
|
||||
}
|
||||
|
||||
Log::print(WHITE_BOLD_S "| - | - | %7s | %7s | %7s |",
|
||||
Hashrate::format(hashrate()->calc(Hashrate::ShortInterval), num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::MediumInterval), num + 8, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::LargeInterval), num + 8 * 2, sizeof num / 3)
|
||||
Log::print(WHITE_BOLD_S "| - | - | %8s | %8s | %8s |",
|
||||
Hashrate::format(hashrate()->calc(Hashrate::ShortInterval) * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::MediumInterval) * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::LargeInterval) * scale, num + 16 * 2, sizeof num / 3)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
#include "base/tools/String.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "crypto/kawpow/KPCache.h"
|
||||
#include "crypto/kawpow/KPHash.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_API
|
||||
|
@ -201,7 +203,7 @@ public:
|
|||
algo.l3() / 1024
|
||||
);
|
||||
|
||||
Log::print(WHITE_BOLD("| # | GPU | BUS ID | I | W | SI | MC | U | MEM | NAME"));
|
||||
Log::print(WHITE_BOLD("| # | GPU | BUS ID | I | W | SI | MC | U | MEM | NAME"));
|
||||
|
||||
size_t algo_l3 = algo.l3();
|
||||
|
||||
|
@ -213,7 +215,16 @@ public:
|
|||
|
||||
size_t i = 0;
|
||||
for (const auto &data : threads) {
|
||||
Log::print("|" CYAN_BOLD("%3zu") " |" CYAN_BOLD("%4u") " |" YELLOW(" %7s") " |" CYAN_BOLD("%5u") " |" CYAN_BOLD("%3u") " |"
|
||||
size_t mem_used = data.thread.intensity() * algo_l3 / oneMiB;
|
||||
|
||||
# ifdef XMRIG_ALGO_KAWPOW
|
||||
if (algo.family() == Algorithm::KAWPOW) {
|
||||
const uint32_t epoch = job.height() / KPHash::EPOCH_LENGTH;
|
||||
mem_used = (KPCache::cache_size(epoch) + KPCache::dag_size(epoch)) / oneMiB;
|
||||
}
|
||||
# endif
|
||||
|
||||
Log::print("|" CYAN_BOLD("%3zu") " |" CYAN_BOLD("%4u") " |" YELLOW(" %7s") " |" CYAN_BOLD("%9u") " |" CYAN_BOLD("%4u") " |"
|
||||
CYAN_BOLD("%3u") " |" CYAN_BOLD("%3s") " |" CYAN_BOLD("%3u") " |" CYAN("%5zu") " | %s",
|
||||
i,
|
||||
data.thread.index(),
|
||||
|
@ -223,7 +234,7 @@ public:
|
|||
data.thread.stridedIndex(),
|
||||
data.thread.stridedIndex() == 2 ? std::to_string(data.thread.memChunk()).c_str() : "-",
|
||||
data.thread.unrollFactor(),
|
||||
data.thread.intensity() * algo_l3 / oneMiB,
|
||||
mem_used,
|
||||
data.device.printableName().data()
|
||||
);
|
||||
|
||||
|
@ -349,18 +360,30 @@ void xmrig::OclBackend::printHashrate(bool details)
|
|||
return;
|
||||
}
|
||||
|
||||
char num[8 * 3] = { 0 };
|
||||
char num[16 * 3] = { 0 };
|
||||
|
||||
Log::print(WHITE_BOLD_S "| OPENCL # | AFFINITY | 10s H/s | 60s H/s | 15m H/s |");
|
||||
const double hashrate_short = hashrate()->calc(Hashrate::ShortInterval);
|
||||
const double hashrate_medium = hashrate()->calc(Hashrate::MediumInterval);
|
||||
const double hashrate_large = hashrate()->calc(Hashrate::LargeInterval);
|
||||
|
||||
double scale = 1.0;
|
||||
const char* h = " H/s";
|
||||
|
||||
if ((hashrate_short >= 1e6) || (hashrate_medium >= 1e6) || (hashrate_large >= 1e6)) {
|
||||
scale = 1e-6;
|
||||
h = "MH/s";
|
||||
}
|
||||
|
||||
Log::print(WHITE_BOLD_S "| OPENCL # | AFFINITY | 10s %s | 60s %s | 15m %s |", h, h, h);
|
||||
|
||||
size_t i = 0;
|
||||
for (const auto &data : d_ptr->threads) {
|
||||
Log::print("| %8zu | %8" PRId64 " | %7s | %7s | %7s |" CYAN_BOLD(" #%u") YELLOW(" %s") " %s",
|
||||
Log::print("| %8zu | %8" PRId64 " | %8s | %8s | %8s |" CYAN_BOLD(" #%u") YELLOW(" %s") " %s",
|
||||
i,
|
||||
data.affinity,
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::ShortInterval), num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::MediumInterval), num + 8, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::LargeInterval), num + 8 * 2, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::ShortInterval) * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::MediumInterval) * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::LargeInterval) * scale, num + 16 * 2, sizeof num / 3),
|
||||
data.device.index(),
|
||||
data.device.topology().toString().data(),
|
||||
data.device.printableName().data()
|
||||
|
@ -369,10 +392,10 @@ void xmrig::OclBackend::printHashrate(bool details)
|
|||
i++;
|
||||
}
|
||||
|
||||
Log::print(WHITE_BOLD_S "| - | - | %7s | %7s | %7s |",
|
||||
Hashrate::format(hashrate()->calc(Hashrate::ShortInterval), num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::MediumInterval), num + 8, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::LargeInterval), num + 8 * 2, sizeof num / 3)
|
||||
Log::print(WHITE_BOLD_S "| - | - | %8s | %8s | %8s |",
|
||||
Hashrate::format(hashrate()->calc(Hashrate::ShortInterval) * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::MediumInterval) * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::LargeInterval) * scale, num + 16 * 2, sizeof num / 3)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue