Browse Source

Implement setting the GPU memory clock speed of all devices or each device as a comma separated value.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
54bc30ceec
  1. 9
      adl.c
  2. 30
      main.c
  3. 1
      miner.h

9
adl.c

@ -221,11 +221,16 @@ void init_adl(int nDevs)
ga->DefPerfLev = lpOdPerformanceLevels; ga->DefPerfLev = lpOdPerformanceLevels;
if (gpus[gpu].gpu_engine) { if (gpus[gpu].gpu_engine) {
applog(LOG_INFO, "Setting GPU %d engine clock to %d", gpu, gpus[gpu].gpu_engine);
lpOdPerformanceLevels->aLevels[lev].iEngineClock = gpus[gpu].gpu_engine * 100; lpOdPerformanceLevels->aLevels[lev].iEngineClock = gpus[gpu].gpu_engine * 100;
applog(LOG_INFO, "Setting GPU %d engine clock to %d", gpu, gpus[gpu].gpu_engine);
ADL_Overdrive5_ODPerformanceLevels_Set(iAdapterIndex, lpOdPerformanceLevels); ADL_Overdrive5_ODPerformanceLevels_Set(iAdapterIndex, lpOdPerformanceLevels);
ADL_Overdrive5_ODPerformanceLevels_Get(iAdapterIndex, 0, lpOdPerformanceLevels);
} }
if (gpus[gpu].gpu_memclock) {
lpOdPerformanceLevels->aLevels[lev].iMemoryClock = gpus[gpu].gpu_memclock * 100;
applog(LOG_INFO, "Setting GPU %d memory clock to %d", gpu, gpus[gpu].gpu_memclock);
ADL_Overdrive5_ODPerformanceLevels_Set(iAdapterIndex, lpOdPerformanceLevels);
}
ADL_Overdrive5_ODPerformanceLevels_Get(iAdapterIndex, 0, lpOdPerformanceLevels);
ga->iEngineClock = lpOdPerformanceLevels->aLevels[lev].iEngineClock; ga->iEngineClock = lpOdPerformanceLevels->aLevels[lev].iEngineClock;
ga->iMemoryClock = lpOdPerformanceLevels->aLevels[lev].iMemoryClock; ga->iMemoryClock = lpOdPerformanceLevels->aLevels[lev].iMemoryClock;
ga->iVddc = lpOdPerformanceLevels->aLevels[lev].iVddc; ga->iVddc = lpOdPerformanceLevels->aLevels[lev].iVddc;

30
main.c

@ -1139,6 +1139,33 @@ static char *set_gpu_engine(char *arg)
return NULL; return NULL;
} }
static char *set_gpu_memclock(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 memclock";
val = atoi(nextptr);
if (val <= 0 || val >= 9999)
return "Invalid value passed to set_gpu_memclock";
gpus[device++].gpu_memclock = val;
while ((nextptr = strtok_r(NULL, ",", &saveptr)) != NULL) {
val = atoi(nextptr);
if (val <= 0 || val >= 9999)
return "Invalid value passed to set_gpu_memclock";
gpus[device++].gpu_memclock = val;
}
for (i = device; i < 16; i++)
gpus[i].gpu_memclock = val;
return NULL;
}
#endif #endif
/* These options are available from config file or commandline */ /* These options are available from config file or commandline */
@ -1205,6 +1232,9 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--gpu-engine", OPT_WITH_ARG("--gpu-engine",
set_gpu_engine, NULL, NULL, set_gpu_engine, NULL, NULL,
"Set the GPU engine (over)clock in Mhz - one value for all or separate by commas for per card."), "Set the GPU engine (over)clock in Mhz - one value for all or separate by commas for per card."),
OPT_WITH_ARG("--gpu-memclock",
set_gpu_memclock, NULL, NULL,
"Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card."),
#endif #endif
OPT_WITH_ARG("--intensity|-I", OPT_WITH_ARG("--intensity|-I",
forced_int_1010, NULL, &scan_intensity, forced_int_1010, NULL, &scan_intensity,

1
miner.h

@ -199,6 +199,7 @@ struct cgpu_info {
bool has_adl; bool has_adl;
struct gpu_adl adl; struct gpu_adl adl;
int gpu_engine; int gpu_engine;
int gpu_memclock;
#endif #endif
}; };

Loading…
Cancel
Save