Browse Source

Limit intensity range according to whether scrypt is in use or not.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
2b171f7fae
  1. 2
      api.c
  2. 12
      cgminer.c
  3. 10
      driver-opencl.c
  4. 22
      miner.h

2
api.c

@ -532,7 +532,7 @@ struct CODES {
{ SEVERITY_ERR, MSG_MISVAL, PARAM_NONE, "Missing comma after GPU number" }, { SEVERITY_ERR, MSG_MISVAL, PARAM_NONE, "Missing comma after GPU number" },
{ SEVERITY_ERR, MSG_NOADL, PARAM_NONE, "ADL is not available" }, { 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_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_INFO, MSG_GPUINT, PARAM_BOTH, "GPU %d set new intensity to %s" },
{ SEVERITY_SUCC, MSG_MINECONFIG,PARAM_NONE, "CGMiner config" }, { SEVERITY_SUCC, MSG_MINECONFIG,PARAM_NONE, "CGMiner config" },
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL

12
cgminer.c

@ -1041,10 +1041,18 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--lookup-gap", OPT_WITH_ARG("--lookup-gap",
set_lookup_gap, NULL, NULL, set_lookup_gap, NULL, NULL,
"Set GPU lookup gap for scrypt mining, comma separated"), "Set GPU lookup gap for scrypt mining, comma separated"),
#endif
OPT_WITH_ARG("--intensity|-I", OPT_WITH_ARG("--intensity|-I",
set_intensity, NULL, NULL, 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 #endif
OPT_WITH_ARG("--hotplug", OPT_WITH_ARG("--hotplug",
set_int_0_to_9999, NULL, &hotplug_time, set_int_0_to_9999, NULL, &hotplug_time,

10
driver-opencl.c

@ -789,7 +789,15 @@ retry:
wlogprint("Invalid selection\n"); wlogprint("Invalid selection\n");
goto retry; 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) { if (!intvar) {
wlogprint("Invalid input\n"); wlogprint("Invalid input\n");
goto retry; goto retry;

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_GPUDEVICES 16
#define MAX_DEVICES 4096 #define MAX_DEVICES 4096
#define MIN_INTENSITY -10 #define MIN_SHA_INTENSITY -10
#define _MIN_INTENSITY_STR "-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 #ifdef USE_SCRYPT
#define MAX_INTENSITY 20 #define MIN_INTENSITY (opt_scrypt ? MIN_SCRYPT_INTENSITY : MIN_SHA_INTENSITY)
#define _MAX_INTENSITY_STR "20" #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 #else
#define MAX_INTENSITY 14 #define MIN_INTENSITY MIN_SHA_INTENSITY
#define _MAX_INTENSITY_STR "14" #define MIN_INTENSITY_STR MIN_SHA_INTENSITY_STR
#define MAX_INTENSITY MAX_SHA_INTENSITY
#define MAX_INTENSITY_STR MAX_SHA_INTENSITY_STR
#endif #endif
extern bool hotplug_mode; extern bool hotplug_mode;

Loading…
Cancel
Save