mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-15 00:59:59 +00:00
Autoselect a GPU from the menu if it's the only device.
This commit is contained in:
parent
701c29fa64
commit
20ddda10dc
9
main.c
9
main.c
@ -3225,7 +3225,12 @@ retry:
|
|||||||
wlogprint("Or press any other key to continue\n");
|
wlogprint("Or press any other key to continue\n");
|
||||||
input = getch();
|
input = getch();
|
||||||
|
|
||||||
|
if (nDevs == 1)
|
||||||
|
selected = 0;
|
||||||
|
else
|
||||||
|
selected = -1;
|
||||||
if (!strncasecmp(&input, "e", 1)) {
|
if (!strncasecmp(&input, "e", 1)) {
|
||||||
|
if (selected)
|
||||||
selected = curses_int("Select GPU to enable");
|
selected = curses_int("Select GPU to enable");
|
||||||
if (selected < 0 || selected >= nDevs) {
|
if (selected < 0 || selected >= nDevs) {
|
||||||
wlogprint("Invalid selection\n");
|
wlogprint("Invalid selection\n");
|
||||||
@ -3251,6 +3256,7 @@ retry:
|
|||||||
tq_push(thr->q, &ping);
|
tq_push(thr->q, &ping);
|
||||||
}
|
}
|
||||||
} if (!strncasecmp(&input, "d", 1)) {
|
} if (!strncasecmp(&input, "d", 1)) {
|
||||||
|
if (selected)
|
||||||
selected = curses_int("Select GPU to disable");
|
selected = curses_int("Select GPU to disable");
|
||||||
if (selected < 0 || selected >= nDevs) {
|
if (selected < 0 || selected >= nDevs) {
|
||||||
wlogprint("Invalid selection\n");
|
wlogprint("Invalid selection\n");
|
||||||
@ -3262,6 +3268,7 @@ retry:
|
|||||||
}
|
}
|
||||||
gpu_devices[selected] = false;
|
gpu_devices[selected] = false;
|
||||||
} else if (!strncasecmp(&input, "r", 1)) {
|
} else if (!strncasecmp(&input, "r", 1)) {
|
||||||
|
if (selected)
|
||||||
selected = curses_int("Select GPU to attempt to restart");
|
selected = curses_int("Select GPU to attempt to restart");
|
||||||
if (selected < 0 || selected >= nDevs) {
|
if (selected < 0 || selected >= nDevs) {
|
||||||
wlogprint("Invalid selection\n");
|
wlogprint("Invalid selection\n");
|
||||||
@ -3270,12 +3277,14 @@ retry:
|
|||||||
wlogprint("Attempting to restart threads of GPU %d\n", selected);
|
wlogprint("Attempting to restart threads of GPU %d\n", selected);
|
||||||
reinit_device(&gpus[selected]);
|
reinit_device(&gpus[selected]);
|
||||||
} else if (adl_active && (!strncasecmp(&input, "c", 1))) {
|
} else if (adl_active && (!strncasecmp(&input, "c", 1))) {
|
||||||
|
if (selected)
|
||||||
selected = curses_int("Select GPU to change settings on");
|
selected = curses_int("Select GPU to change settings on");
|
||||||
if (selected < 0 || selected >= nDevs) {
|
if (selected < 0 || selected >= nDevs) {
|
||||||
wlogprint("Invalid selection\n");
|
wlogprint("Invalid selection\n");
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
change_gpusettings(selected);
|
change_gpusettings(selected);
|
||||||
|
goto retry;
|
||||||
} else
|
} else
|
||||||
clear_logwin();
|
clear_logwin();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user