mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Implement setting the GPU powertune value of all devices or each device as a comma separated value.
This commit is contained in:
parent
656bacc5a9
commit
47f1a75924
5
adl.c
5
adl.c
@ -270,6 +270,11 @@ void init_adl(int nDevs)
|
|||||||
if (ADL_Overdrive5_PowerControl_Get(ga->iAdapterIndex, &ga->iPercentage, &dummy) != ADL_OK)
|
if (ADL_Overdrive5_PowerControl_Get(ga->iAdapterIndex, &ga->iPercentage, &dummy) != ADL_OK)
|
||||||
applog(LOG_INFO, "Failed to ADL_Overdrive5_PowerControl_get");
|
applog(LOG_INFO, "Failed to ADL_Overdrive5_PowerControl_get");
|
||||||
|
|
||||||
|
if (gpus[gpu].gpu_powertune) {
|
||||||
|
ADL_Overdrive5_PowerControl_Set(ga->iAdapterIndex, gpus[gpu].gpu_powertune);
|
||||||
|
ADL_Overdrive5_PowerControl_Get(ga->iAdapterIndex, &ga->iPercentage, &dummy);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set some default temperatures for autotune when enabled */
|
/* Set some default temperatures for autotune when enabled */
|
||||||
ga->targettemp = opt_targettemp;
|
ga->targettemp = opt_targettemp;
|
||||||
ga->overtemp = opt_overheattemp;
|
ga->overtemp = opt_overheattemp;
|
||||||
|
30
main.c
30
main.c
@ -1193,6 +1193,33 @@ static char *set_gpu_memclock(char *arg)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *set_gpu_powertune(char *arg)
|
||||||
|
{
|
||||||
|
int i, val = 0, device = 0;
|
||||||
|
char *saveptr = NULL, *nextptr;
|
||||||
|
|
||||||
|
nextptr = strtok_r(arg, ",", &saveptr);
|
||||||
|
if (nextptr == NULL)
|
||||||
|
return "Invalid parameters for set gpu powertune";
|
||||||
|
val = atoi(nextptr);
|
||||||
|
if (val < -99 || val > 99)
|
||||||
|
return "Invalid value passed to set_gpu_powertune";
|
||||||
|
|
||||||
|
gpus[device++].gpu_powertune = val;
|
||||||
|
|
||||||
|
while ((nextptr = strtok_r(NULL, ",", &saveptr)) != NULL) {
|
||||||
|
val = atoi(nextptr);
|
||||||
|
if (val < -99 || val > 99)
|
||||||
|
return "Invalid value passed to set_gpu_powertune";
|
||||||
|
|
||||||
|
gpus[device++].gpu_powertune = val;
|
||||||
|
}
|
||||||
|
for (i = device; i < 16; i++)
|
||||||
|
gpus[i].gpu_powertune = val;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static char *set_gpu_vddc(char *arg)
|
static char *set_gpu_vddc(char *arg)
|
||||||
{
|
{
|
||||||
int i, device = 0;
|
int i, device = 0;
|
||||||
@ -1293,6 +1320,9 @@ static struct opt_table opt_config_table[] = {
|
|||||||
OPT_WITH_ARG("--gpu-memclock",
|
OPT_WITH_ARG("--gpu-memclock",
|
||||||
set_gpu_memclock, NULL, NULL,
|
set_gpu_memclock, NULL, NULL,
|
||||||
"Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card."),
|
"Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card."),
|
||||||
|
OPT_WITH_ARG("--gpu-powertune",
|
||||||
|
set_gpu_powertune, NULL, NULL,
|
||||||
|
"Set the GPU powertune percentage - one value for all or separate by commas for per card."),
|
||||||
OPT_WITH_ARG("--gpu-vddc",
|
OPT_WITH_ARG("--gpu-vddc",
|
||||||
set_gpu_vddc, NULL, NULL,
|
set_gpu_vddc, NULL, NULL,
|
||||||
"Set the GPU voltage in Volts - one value for all or separate by commas for per card."),
|
"Set the GPU voltage in Volts - one value for all or separate by commas for per card."),
|
||||||
|
Loading…
Reference in New Issue
Block a user