mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 01:44:23 +00:00
Clean up by setting performance profiles and fan settings to startup levels on exit.
This commit is contained in:
parent
fc36e13d5b
commit
9b7262ec71
26
adl.c
26
adl.c
@ -190,6 +190,8 @@ void init_adl(int nDevs)
|
|||||||
ga->iAdapterIndex = iAdapterIndex;
|
ga->iAdapterIndex = iAdapterIndex;
|
||||||
ga->lpAdapterID = lpAdapterID;
|
ga->lpAdapterID = lpAdapterID;
|
||||||
ga->lpStatus = lpStatus;
|
ga->lpStatus = lpStatus;
|
||||||
|
ga->DefPerfLev = NULL;
|
||||||
|
|
||||||
if (ADL_Overdrive5_ODParameters_Get(iAdapterIndex, &ga->lpOdParameters) != ADL_OK) {
|
if (ADL_Overdrive5_ODParameters_Get(iAdapterIndex, &ga->lpOdParameters) != ADL_OK) {
|
||||||
applog(LOG_INFO, "Failed to ADL_Overdrive5_ODParameters_Get");
|
applog(LOG_INFO, "Failed to ADL_Overdrive5_ODParameters_Get");
|
||||||
continue;
|
continue;
|
||||||
@ -653,8 +655,6 @@ void change_autosettings(int gpu)
|
|||||||
struct gpu_adl *ga = &gpus[gpu].adl;
|
struct gpu_adl *ga = &gpus[gpu].adl;
|
||||||
char input;
|
char input;
|
||||||
|
|
||||||
wlogprint("Fan autotune is %s\n", ga->autofan ? "enabled" : "disabled");
|
|
||||||
wlogprint("GPU engine clock autotune is %s\n", ga->autoengine ? "enabled" : "disabled");
|
|
||||||
wlogprint("Target temperature: %d\n", ga->targettemp);
|
wlogprint("Target temperature: %d\n", ga->targettemp);
|
||||||
wlogprint("Overheat temperature: %d\n", ga->overtemp);
|
wlogprint("Overheat temperature: %d\n", ga->overtemp);
|
||||||
wlogprint("Toggle [F]an auto [G]PU auto, change [T]arget [O]verheat\n");
|
wlogprint("Toggle [F]an auto [G]PU auto, change [T]arget [O]verheat\n");
|
||||||
@ -679,10 +679,15 @@ void change_autosettings(int gpu)
|
|||||||
|
|
||||||
void change_gpusettings(int gpu)
|
void change_gpusettings(int gpu)
|
||||||
{
|
{
|
||||||
int val, imin = 0, imax = 0;
|
struct gpu_adl *ga = &gpus[gpu].adl;
|
||||||
float fval, fmin = 0, fmax = 0;
|
float fval, fmin = 0, fmax = 0;
|
||||||
|
int val, imin = 0, imax = 0;
|
||||||
char input;
|
char input;
|
||||||
|
|
||||||
|
wlogprint("Temp: %.1f °C\nFan Speed: %d RPM\nEngine Clock: %d MHz\nMemory Clock: %d Mhz\nVddc: %.3f V\nActivity: %d%%\n",
|
||||||
|
gpu_temp(gpu), gpu_fanspeed(gpu), gpu_engineclock(gpu), gpu_memclock(gpu), gpu_vddc(gpu), gpu_activity(gpu));
|
||||||
|
wlogprint("Fan autotune is %s\n", ga->autofan ? "enabled" : "disabled");
|
||||||
|
wlogprint("GPU engine clock autotune is %s\n", ga->autoengine ? "enabled" : "disabled");
|
||||||
wlogprint("Change [A]utomatic [E]ngine [F]an [M]emory [V]oltage\n");
|
wlogprint("Change [A]utomatic [E]ngine [F]an [M]emory [V]oltage\n");
|
||||||
wlogprint("Or press any other key to continue\n");
|
wlogprint("Or press any other key to continue\n");
|
||||||
input = getch();
|
input = getch();
|
||||||
@ -750,11 +755,24 @@ void change_gpusettings(int gpu)
|
|||||||
input = getch();
|
input = getch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_adl(void)
|
void clear_adl(nDevs)
|
||||||
{
|
{
|
||||||
|
struct gpu_adl *ga;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!adl_active)
|
if (!adl_active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Try to reset values to their defaults */
|
||||||
|
for (i = 0; i < nDevs; i++) {
|
||||||
|
ga = &gpus[i].adl;
|
||||||
|
if (!gpus[i].has_adl)
|
||||||
|
continue;
|
||||||
|
ADL_Overdrive5_ODPerformanceLevels_Set(ga->iAdapterIndex, ga->DefPerfLev);
|
||||||
|
free(ga->DefPerfLev);
|
||||||
|
ADL_Overdrive5_FanSpeed_Set(ga->iAdapterIndex, 0, &ga->DefFanSpeedValue);
|
||||||
|
}
|
||||||
|
|
||||||
ADL_Main_Memory_Free ( (void **)&lpInfo );
|
ADL_Main_Memory_Free ( (void **)&lpInfo );
|
||||||
ADL_Main_Control_Destroy ();
|
ADL_Main_Control_Destroy ();
|
||||||
|
|
||||||
|
4
adl.h
4
adl.h
@ -11,11 +11,11 @@ int gpu_activity(int gpu);
|
|||||||
int gpu_fanspeed(int gpu);
|
int gpu_fanspeed(int gpu);
|
||||||
void change_gpusettings(int gpu);
|
void change_gpusettings(int gpu);
|
||||||
void gpu_autotune(int gpu);
|
void gpu_autotune(int gpu);
|
||||||
void clear_adl(void);
|
void clear_adl(int nDevs);
|
||||||
#else /* HAVE_ADL */
|
#else /* HAVE_ADL */
|
||||||
void init_adl(int nDevs) {}
|
void init_adl(int nDevs) {}
|
||||||
void change_gpusettings(int gpu) { }
|
void change_gpusettings(int gpu) { }
|
||||||
void gpu_autotune(int gpu) { }
|
void gpu_autotune(int gpu) { }
|
||||||
void clear_adl(void) {}
|
void clear_adl(int nDevs) {}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user