mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 14:58:01 +00:00
Limit intensity range according to whether scrypt is in use or not.
This commit is contained in:
parent
cb6d62de08
commit
2b171f7fae
2
api.c
2
api.c
@ -532,7 +532,7 @@ struct CODES {
|
||||
{ SEVERITY_ERR, MSG_MISVAL, PARAM_NONE, "Missing comma after GPU number" },
|
||||
{ SEVERITY_ERR, MSG_NOADL, PARAM_NONE, "ADL is not available" },
|
||||
{ SEVERITY_ERR, MSG_NOGPUADL,PARAM_GPU, "GPU %d does not have ADL" },
|
||||
{ SEVERITY_ERR, MSG_INVINT, PARAM_STR, "Invalid intensity (%s) - must be '" _DYNAMIC "' or range " _MIN_INTENSITY_STR " - " _MAX_INTENSITY_STR },
|
||||
{ SEVERITY_ERR, MSG_INVINT, PARAM_STR, "Invalid intensity (%s) - must be '" _DYNAMIC "' or range " MIN_SHA_INTENSITY_STR " - " MAX_SCRYPT_INTENSITY_STR },
|
||||
{ SEVERITY_INFO, MSG_GPUINT, PARAM_BOTH, "GPU %d set new intensity to %s" },
|
||||
{ SEVERITY_SUCC, MSG_MINECONFIG,PARAM_NONE, "CGMiner config" },
|
||||
#ifdef HAVE_OPENCL
|
||||
|
12
cgminer.c
12
cgminer.c
@ -1041,10 +1041,18 @@ static struct opt_table opt_config_table[] = {
|
||||
OPT_WITH_ARG("--lookup-gap",
|
||||
set_lookup_gap, NULL, NULL,
|
||||
"Set GPU lookup gap for scrypt mining, comma separated"),
|
||||
#endif
|
||||
OPT_WITH_ARG("--intensity|-I",
|
||||
set_intensity, NULL, NULL,
|
||||
"Intensity of GPU scanning (d or " _MIN_INTENSITY_STR " -> " _MAX_INTENSITY_STR ", default: d to maintain desktop interactivity)"),
|
||||
"Intensity of GPU scanning (d or " MIN_SHA_INTENSITY_STR
|
||||
" -> " MAX_SCRYPT_INTENSITY_STR
|
||||
",default: d to maintain desktop interactivity)"),
|
||||
#else
|
||||
OPT_WITH_ARG("--intensity|-I",
|
||||
set_intensity, NULL, NULL,
|
||||
"Intensity of GPU scanning (d or " MIN_SHA_INTENSITY_STR
|
||||
" -> " MAX_SHA_INTENSITY_STR
|
||||
",default: d to maintain desktop interactivity)"),
|
||||
#endif
|
||||
#endif
|
||||
OPT_WITH_ARG("--hotplug",
|
||||
set_int_0_to_9999, NULL, &hotplug_time,
|
||||
|
@ -789,7 +789,15 @@ retry:
|
||||
wlogprint("Invalid selection\n");
|
||||
goto retry;
|
||||
}
|
||||
intvar = curses_input("Set GPU scan intensity (d or " _MIN_INTENSITY_STR " -> " _MAX_INTENSITY_STR ")");
|
||||
if (opt_scrypt) {
|
||||
intvar = curses_input("Set GPU scan intensity (d or "
|
||||
MIN_SCRYPT_INTENSITY_STR " -> "
|
||||
MAX_SCRYPT_INTENSITY_STR ")");
|
||||
} else {
|
||||
intvar = curses_input("Set GPU scan intensity (d or "
|
||||
MIN_SHA_INTENSITY_STR " -> "
|
||||
MAX_SHA_INTENSITY_STR ")");
|
||||
}
|
||||
if (!intvar) {
|
||||
wlogprint("Invalid input\n");
|
||||
goto retry;
|
||||
|
22
miner.h
22
miner.h
@ -945,14 +945,24 @@ extern bool add_pool_details(struct pool *pool, bool live, char *url, char *user
|
||||
#define MAX_GPUDEVICES 16
|
||||
#define MAX_DEVICES 4096
|
||||
|
||||
#define MIN_INTENSITY -10
|
||||
#define _MIN_INTENSITY_STR "-10"
|
||||
#define MIN_SHA_INTENSITY -10
|
||||
#define MIN_SHA_INTENSITY_STR "-10"
|
||||
#define MAX_SHA_INTENSITY 14
|
||||
#define MAX_SHA_INTENSITY_STR "14"
|
||||
#define MIN_SCRYPT_INTENSITY 8
|
||||
#define MIN_SCRYPT_INTENSITY_STR "8"
|
||||
#define MAX_SCRYPT_INTENSITY 20
|
||||
#define MAX_SCRYPT_INTENSITY_STR "20"
|
||||
#ifdef USE_SCRYPT
|
||||
#define MAX_INTENSITY 20
|
||||
#define _MAX_INTENSITY_STR "20"
|
||||
#define MIN_INTENSITY (opt_scrypt ? MIN_SCRYPT_INTENSITY : MIN_SHA_INTENSITY)
|
||||
#define MIN_INTENSITY_STR (opt_scrypt ? MIN_SCRYPT_INTENSITY_STR : MIN_SHA_INTENSITY_STR)
|
||||
#define MAX_INTENSITY (opt_scrypt ? MAX_SCRYPT_INTENSITY : MAX_SHA_INTENSITY)
|
||||
#define MAX_INTENSITY_STR (opt_scrypt ? MAX_SCRYPT_INTENSITY_STR : MAX_SHA_INTENSITY_STR)
|
||||
#else
|
||||
#define MAX_INTENSITY 14
|
||||
#define _MAX_INTENSITY_STR "14"
|
||||
#define MIN_INTENSITY MIN_SHA_INTENSITY
|
||||
#define MIN_INTENSITY_STR MIN_SHA_INTENSITY_STR
|
||||
#define MAX_INTENSITY MAX_SHA_INTENSITY
|
||||
#define MAX_INTENSITY_STR MAX_SHA_INTENSITY_STR
|
||||
#endif
|
||||
|
||||
extern bool hotplug_mode;
|
||||
|
Loading…
Reference in New Issue
Block a user