Skip to content

Commit

Permalink
Bug fix for autoswitch
Browse files Browse the repository at this point in the history
  • Loading branch information
monkins1010 committed Jun 11, 2020
1 parent 1b9ccbb commit 690a003
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 50 deletions.
49 changes: 3 additions & 46 deletions api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,11 @@ static void gpustatus(int thr_id)
cgpu->gpu_plimit = gpu_plimit(cgpu); // mW or %
#endif
cgpu->khashes = stats_get_speed(thr_id, 0.0) / 1000.0;
if (cgpu->monitor.gpu_power) {
cgpu->gpu_power = cgpu->monitor.gpu_power;
khashes_per_watt = (double)cgpu->khashes / cgpu->monitor.gpu_power;
khashes_per_watt *= 1000; // power in mW
//gpulog(LOG_BLUE, thr_id, "KHW: %g", khashes_per_watt);
}


card = device_name[gpuid];

snprintf(buf, sizeof(buf), "GPU=%d;BUS=%hd;CARD=%s;TEMP=%.1f;"
"POWER=%u;FAN=%hu;RPM=%hu;"
"FREQ=%u;MEMFREQ=%u;GPUF=%u;MEMF=%u;"
"KHS=%.2f;KHW=%.5f;PLIM=%u;"
"ACC=%u;REJ=%u;HWF=%u;I=%.1f;THR=%u|",
gpuid, cgpu->gpu_bus, card, cgpu->gpu_temp,
cgpu->gpu_power, cgpu->gpu_fan, cgpu->gpu_fan_rpm,
cgpu->gpu_clock/1000, cgpu->gpu_memclock/1000, // base freqs in MHz
cgpu->monitor.gpu_clock, cgpu->monitor.gpu_memclock, // current
cgpu->khashes, khashes_per_watt, cgpu->gpu_plimit,
cgpu->accepted, (unsigned) cgpu->rejected, (unsigned) cgpu->hw_errors,
cgpu->intensity, cgpu->throughput);


// append to buffer for multi gpus
strcat(buffer, buf);
Expand Down Expand Up @@ -273,40 +257,13 @@ static void gpuhwinfos(int gpu_id)
return;


cgpu->gpu_plimit = 200;

#ifdef USE_WRAPNVML
cgpu->has_monitoring = true;
cgpu->gpu_bus = gpu_busid(cgpu);
cgpu->gpu_temp = gpu_temp(cgpu);
cgpu->gpu_fan = (uint16_t) gpu_fanpercent(cgpu);
cgpu->gpu_fan_rpm = (uint16_t) gpu_fanrpm(cgpu);
cgpu->gpu_pstate = (int16_t) gpu_pstate(cgpu);
cgpu->gpu_power = gpu_power(cgpu);
cgpu->gpu_plimit = gpu_plimit(cgpu);
gpu_info(cgpu);
#ifdef WIN32
if (opt_debug) nvapi_pstateinfo(cgpu->gpu_id);
#endif
#endif

memset(pstate, 0, sizeof(pstate));
if (cgpu->gpu_pstate != -1)
snprintf(pstate, sizeof(pstate), "P%d", (int) cgpu->gpu_pstate);

card = device_name[gpu_id];

snprintf(buf, sizeof(buf), "GPU=%d;BUS=%hd;CARD=%s;SM=%hu;MEM=%u;"
"TEMP=%.1f;FAN=%hu;RPM=%hu;FREQ=%u;MEMFREQ=%u;GPUF=%u;MEMF=%u;"
"PST=%s;POWER=%u;PLIM=%u;"
"VID=%hx;PID=%hx;NVML=%d;NVAPI=%d;SN=%s;BIOS=%s|",
gpu_id, cgpu->gpu_bus, card, cgpu->gpu_arch, (uint32_t) cgpu->gpu_mem,
cgpu->gpu_temp, cgpu->gpu_fan, cgpu->gpu_fan_rpm,
cgpu->gpu_clock/1000U, cgpu->gpu_memclock/1000U, // base clocks
cgpu->monitor.gpu_clock, cgpu->monitor.gpu_memclock, // current
pstate, cgpu->gpu_power, cgpu->gpu_plimit,
cgpu->gpu_vid, cgpu->gpu_pid, cgpu->nvml_id, cgpu->nvapi_id,
cgpu->gpu_sn, cgpu->gpu_desc);


strcat(buffer, buf);
}
Expand Down
3 changes: 1 addition & 2 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@

#include "miner.h"
#include "algos.h"
#include "sia/sia-rpc.h"
#include "crypto/xmr-rpc.h"

#include "equi/equihash.h"

//#include <cuda_runtime.h>
Expand Down
2 changes: 1 addition & 1 deletion verus/verus_clhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ __m128i __verusclmulwithoutreduction64alignedrepeatv2_2(__m128i *randomsource, c
const __m128i *pbuf;

// divide key mask by 16 from bytes to __m128i
keyMask >>= 4;
//keyMask >>= 4;

// the random buffer must have at least 32 16 byte dwords after the keymask to work with this
// algorithm. we take the value from the last element inside the keyMask + 2, as that will never
Expand Down
2 changes: 1 addition & 1 deletion verus/verusscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ extern "C" void Verus2hash(unsigned char *hash, unsigned char *curBuf, uint32_t
// FillExtra((u128 *)curBuf);
uint64_t intermediate;
((uint32_t*)&curBuf[0])[8] = nonce;
if(version = 3)
if(version == 3)
intermediate = verusclhashv2_1(data_key,curBuf, 511, fixrand, fixrandex, g_prand, g_prandex);
else
intermediate = verusclhashv2_2(data_key, curBuf, 511, fixrand, fixrandex, g_prand, g_prandex);
Expand Down

0 comments on commit 690a003

Please sign in to comment.