nvml: do average on milliwatts reading
and ignore nvapi percents in pool stats also allow decimals in intensity
This commit is contained in:
parent
b6a2c5c2ec
commit
1c3a95213d
2
api.cpp
2
api.cpp
@ -122,7 +122,7 @@ static void gpustatus(int thr_id)
|
||||
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_power = gpu_power(cgpu);
|
||||
cgpu->gpu_power = gpu_power(cgpu); // mWatts
|
||||
#endif
|
||||
cuda_gpu_clocks(cgpu);
|
||||
|
||||
|
5
nvml.cpp
5
nvml.cpp
@ -1050,7 +1050,6 @@ int gpu_busid(struct cgpu_info *gpu)
|
||||
return busid;
|
||||
}
|
||||
|
||||
/* not used in api (too much variable) */
|
||||
unsigned int gpu_power(struct cgpu_info *gpu)
|
||||
{
|
||||
unsigned int mw = 0;
|
||||
@ -1065,6 +1064,10 @@ unsigned int gpu_power(struct cgpu_info *gpu)
|
||||
mw = pct; // to fix
|
||||
}
|
||||
#endif
|
||||
if (gpu->gpu_power > 0) {
|
||||
// average
|
||||
mw = (gpu->gpu_power + mw) / 2;
|
||||
}
|
||||
return mw;
|
||||
}
|
||||
|
||||
|
8
util.cpp
8
util.cpp
@ -1619,6 +1619,7 @@ static bool stratum_benchdata(json_t *result, json_t *params, int thr_id)
|
||||
char vid[32], arch[8], driver[32];
|
||||
char *card;
|
||||
char os[8];
|
||||
uint32_t watts = 0;
|
||||
int dev_id = device_map[thr_id];
|
||||
int cuda_ver = cuda_version();
|
||||
struct cgpu_info *cgpu = &thr_info[thr_id].gpu;
|
||||
@ -1634,7 +1635,8 @@ static bool stratum_benchdata(json_t *result, json_t *params, int thr_id)
|
||||
|
||||
#ifdef USE_WRAPNVML
|
||||
cgpu->has_monitoring = true;
|
||||
cgpu->gpu_power = gpu_power(cgpu); // Watts
|
||||
cgpu->gpu_power = gpu_power(cgpu); // mWatts
|
||||
watts = (cgpu->gpu_power >= 1000) ? cgpu->gpu_power / 1000 : 0; // ignore nvapi %
|
||||
gpu_info(cgpu);
|
||||
#endif
|
||||
cuda_gpu_clocks(cgpu);
|
||||
@ -1656,9 +1658,9 @@ static bool stratum_benchdata(json_t *result, json_t *params, int thr_id)
|
||||
json_object_set_new(val, "arch", json_string(arch));
|
||||
json_object_set_new(val, "freq", json_integer(cgpu->gpu_clock/1000));
|
||||
json_object_set_new(val, "memf", json_integer(cgpu->gpu_memclock/1000));
|
||||
json_object_set_new(val, "power", json_integer(cgpu->gpu_power/1000));
|
||||
json_object_set_new(val, "power", json_integer(watts));
|
||||
json_object_set_new(val, "khashes", json_real(cgpu->khashes));
|
||||
json_object_set_new(val, "intensity", json_integer(cgpu->intensity));
|
||||
json_object_set_new(val, "intensity", json_real(cgpu->intensity));
|
||||
json_object_set_new(val, "throughput", json_integer(cgpu->throughput));
|
||||
json_object_set_new(val, "client", json_string(PACKAGE_NAME "/" PACKAGE_VERSION));
|
||||
json_object_set_new(val, "os", json_string(os));
|
||||
|
Loading…
Reference in New Issue
Block a user