Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Hardware Monitoring for NVML, ADL and AMDGPU SysFS #319

Merged
merged 8 commits into from
Nov 27, 2017
11 changes: 10 additions & 1 deletion ethminer/MinerAux.h
Original file line number Diff line number Diff line change
@@ -244,6 +244,10 @@ class MinerCLI
{
m_report_stratum_hashrate = true;
}
else if ((arg == "-HWMON") && i + 1 < argc)
{
m_show_hwmonitors = true;
}

#endif
#if API_CORE
@@ -572,6 +576,7 @@ class MinerCLI
<< " 1: eth-proxy compatible: dwarfpool, f2pool, nanopool (required for hashrate reporting to work with nanopool)" << endl
<< " 2: EthereumStratum/1.0.0: nicehash" << endl
<< " -RH, --report-hashrate Report current hashrate to pool (please only enable on pools supporting this)" << endl
<< " -HWMON Displays gpu temp and fan percent." << endl
<< " -SE, --stratum-email <s> Email address used in eth-proxy (optional)" << endl
<< " --farm-recheck <n> Leave n ms between checks for changed work (default: 500). When using stratum, use a high value (i.e. 2000) to get more stable hashrate output" << endl
#endif
@@ -817,6 +822,8 @@ class MinerCLI
if (current)
{
minelog << mp << f.getSolutionStats() << f.farmLaunchedFormatted();
if (m_show_hwmonitors)
minelog << f.hwmonitors();
#if ETH_DBUS
dbusint.send(toString(mp).data());
#endif
@@ -968,7 +975,8 @@ class MinerCLI
if (client.current())
{
minelog << mp << f.getSolutionStats() << f.farmLaunchedFormatted();
minelog << f.hwmonitors();
if (m_show_hwmonitors)
minelog << f.hwmonitors();
#if ETH_DBUS
dbusint.send(toString(mp).data());
#endif
@@ -1085,6 +1093,7 @@ class MinerCLI
unsigned m_defaultStratumFarmRecheckPeriod = 2000;
bool m_farmRecheckSet = false;
int m_worktimeout = 180;
bool m_show_hwmonitors = false;
#if API_CORE
int m_api_port = 0;
#endif
10 changes: 9 additions & 1 deletion libapicore/ApiServer.cpp
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ void ApiServer::getMinerStat1(const Json::Value& request, Json::Value& response)

SolutionStats s = this->m_farm.getSolutionStats();
WorkingProgress p = this->m_farm.miningProgress();
HwMonitors h = this->m_farm.hwmonitors();

ostringstream totalMhEth;
ostringstream totalMhDcr;
@@ -37,7 +38,14 @@ void ApiServer::getMinerStat1(const Json::Value& request, Json::Value& response)
{
detailedMhEth << std::fixed << std::setprecision(0) << (p.minerRate(i) / 1000.0f) << (((numGpus -1) > gpuIndex) ? ";" : "");
detailedMhDcr << "off" << (((numGpus -1) > gpuIndex) ? ";" : ""); // DualMining not supported
tempAndFans << "50;50" <<(((numGpus -1) > gpuIndex) ? ";" : ""); // Fetching Temp and Fans not supported
gpuIndex++;
}

gpuIndex = 0;
numGpus = h.minerMonitors.size();
for (auto const& i : h.minerMonitors)
{
tempAndFans << i.tempC << ";" << i.fanP << (((numGpus - 1) > gpuIndex) ? "; " : ""); // Fetching Temp and Fans
gpuIndex++;
}