Browse Source

Allow intermediate intensity (decimals)

Sample with -i 18.5
  Adding 131072 threads to intensity 18, 393216 cuda threads

And with -i 19.5
  Adding 262144 threads to intensity 19, 786432 cuda threads
master
Tanguy Pruvot 10 years ago
parent
commit
9b1ff1280e
  1. 4
      README.txt
  2. 20
      ccminer.cpp
  3. 8
      miner.h
  4. 10
      x11/x11.cu
  5. 3
      x13/x13.cu

4
README.txt

@ -86,7 +86,8 @@ its command line interface and options.
Alternatively give string names of your card like Alternatively give string names of your card like
gtx780ti or gt640#2 (matching 2nd gt640 in the PC). gtx780ti or gt640#2 (matching 2nd gt640 in the PC).
-i, --intensity GPU threads per call 0-31 (default: 0=auto) -i, --intensity GPU threads per call 8-31 (default: 0=auto)
Decimals are allowed for fine tuning
-f, --diff Divide difficulty by this factor (std is 1) -f, --diff Divide difficulty by this factor (std is 1)
-v, --vote Heavycoin block vote (default: 512) -v, --vote Heavycoin block vote (default: 512)
-o, --url=URL URL of mining server -o, --url=URL URL of mining server
@ -171,6 +172,7 @@ features.
v1.5.0 v1.5.0
Upgrade compat jansson to 2.6 (for windows) Upgrade compat jansson to 2.6 (for windows)
Add pool mining.set_extranonce support Add pool mining.set_extranonce support
Allow intermediate intensity with decimals
Allow increased scan ranges (wip) Allow increased scan ranges (wip)
Some internal changes to use the C++ compiler Some internal changes to use the C++ compiler
New API 1.2 with some new commands (read only) New API 1.2 with some new commands (read only)

20
ccminer.cpp

@ -239,6 +239,7 @@ double global_diff = 0.0;
int opt_statsavg = 30; int opt_statsavg = 30;
int opt_intensity = 0; int opt_intensity = 0;
uint32_t opt_work_size = 0; /* default */ uint32_t opt_work_size = 0; /* default */
uint32_t opt_work_adds = 0;
char *opt_api_allow = (char*) "127.0.0.1"; /* 0.0.0.0 for all ips */ char *opt_api_allow = (char*) "127.0.0.1"; /* 0.0.0.0 for all ips */
int opt_api_listen = 4068; /* 0 to disable */ int opt_api_listen = 4068; /* 0 to disable */
@ -287,7 +288,8 @@ Options:\n\
Device IDs start counting from 0! Alternatively takes\n\ Device IDs start counting from 0! Alternatively takes\n\
string names of your cards like gtx780ti or gt640#2\n\ string names of your cards like gtx780ti or gt640#2\n\
(matching 2nd gt640 in the PC)\n\ (matching 2nd gt640 in the PC)\n\
-i --intensity=N GPU intensity 0-31 (default: auto) \n\ -i --intensity=N GPU intensity 8-31 (default: auto) \n\
Decimals are allowed for fine tuning \n\
-f, --diff Divide difficulty by this factor (std is 1) \n\ -f, --diff Divide difficulty by this factor (std is 1) \n\
-v, --vote=VOTE block reward vote (for HeavyCoin)\n\ -v, --vote=VOTE block reward vote (for HeavyCoin)\n\
-m, --trust-pool trust the max block reward vote (maxvote) sent by the pool\n\ -m, --trust-pool trust the max block reward vote (maxvote) sent by the pool\n\
@ -901,7 +903,7 @@ static void stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
case ALGO_KECCAK: case ALGO_KECCAK:
case ALGO_BLAKECOIN: case ALGO_BLAKECOIN:
case ALGO_WHC: case ALGO_WHC:
SHA256((uint8_t*)sctx->job.coinbase, sctx->job.coinbase_size, (uint8_t*)merkle_root); SHA256((uchar*)sctx->job.coinbase, sctx->job.coinbase_size, (uchar*)merkle_root);
break; break;
default: default:
sha256d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size); sha256d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size);
@ -1693,12 +1695,22 @@ static void parse_arg(int key, char *arg)
break; break;
} }
case 'i': case 'i':
v = atoi(arg); d = atof(arg);
v = (uint32_t) d;
if (v < 0 || v > 31) if (v < 0 || v > 31)
show_usage_and_exit(1); show_usage_and_exit(1);
opt_intensity = v; opt_intensity = v;
if (v > 0) /* 0 = default */ if (v > 7) { /* 0 = default */
opt_work_size = (1 << v); opt_work_size = (1 << v);
if ((d - v) > 0.0) {
opt_work_adds = (uint32_t) floor((d - v) * (1 << (v-8))) * 256;
opt_work_size += opt_work_adds;
applog(LOG_INFO, "Adding %u threads to intensity %u, %u cuda threads",
opt_work_adds, v, opt_work_size);
} else {
applog(LOG_INFO, "Intensity set to %u, %u cuda threads", v, opt_work_size);
}
}
break; break;
case 'D': case 'D':
opt_debug = true; opt_debug = true;

8
miner.h

@ -117,6 +117,14 @@ typedef unsigned char uchar;
#define UINT32_MAX UINT_MAX #define UINT32_MAX UINT_MAX
#endif #endif
static inline bool is_windows(void) {
#ifdef WIN32
return 1;
#else
return 0;
#endif
}
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#define WANT_BUILTIN_BSWAP #define WANT_BUILTIN_BSWAP
#else #else

10
x11/x11.cu

@ -129,16 +129,6 @@ extern "C" void x11hash(void *output, const void *input)
memcpy(output, hash, 32); memcpy(output, hash, 32);
} }
/* reduce by one default intensity on windows */
static int is_windows(void)
{
#ifdef WIN32
return 1;
#else
return 0;
#endif
}
extern "C" int scanhash_x11(int thr_id, uint32_t *pdata, extern "C" int scanhash_x11(int thr_id, uint32_t *pdata,
const uint32_t *ptarget, uint32_t max_nonce, const uint32_t *ptarget, uint32_t max_nonce,
unsigned long *hashes_done) unsigned long *hashes_done)

3
x13/x13.cu

@ -151,7 +151,8 @@ extern "C" int scanhash_x13(int thr_id, uint32_t *pdata,
{ {
const uint32_t first_nonce = pdata[19]; const uint32_t first_nonce = pdata[19];
static bool init[8] = { 0 }; static bool init[8] = { 0 };
int throughput = opt_work_size ? opt_work_size : (1 << 19); // 256*256*8; int intensity = 19; // (device_sm[device_map[thr_id]] > 500 && !is_windows()) ? 20 : 19;
int throughput = opt_work_size ? opt_work_size : (1 << intensity); // 19=256*256*8;
throughput = min(throughput, (int)(max_nonce - first_nonce)); throughput = min(throughput, (int)(max_nonce - first_nonce));
if (opt_benchmark) if (opt_benchmark)

Loading…
Cancel
Save