Browse Source

bench: handle cryptonight variants + V100 fix

pull/5/head
Tanguy Pruvot 6 years ago
parent
commit
4a76ca5cb6
  1. 16
      bench.cpp
  2. 3
      ccminer.cpp
  3. 9
      crypto/cryptonight.cu
  4. 3
      equi/equihash.cpp

16
bench.cpp

@ -156,6 +156,22 @@ bool bench_algo_switch_next(int thr_id) @@ -156,6 +156,22 @@ bool bench_algo_switch_next(int thr_id)
if (algo == ALGO_SCRYPT) algo++;
if (algo == ALGO_SCRYPT_JANE) algo++;
// Set cryptonight variant
switch (algo) {
case ALGO_MONERO:
cryptonight_fork = 7;
break;
case ALGO_GRAFT:
cryptonight_fork = 8;
break;
case ALGO_STELLITE:
cryptonight_fork = 3;
break;
case ALGO_CRYPTONIGHT:
cryptonight_fork = 1;
break;
}
// free current algo memory and track mem usage
mused = cuda_available_memory(thr_id);
algo_free_all(thr_id);

3
ccminer.cpp

@ -2384,6 +2384,9 @@ static void *miner_thread(void *userdata) @@ -2384,6 +2384,9 @@ static void *miner_thread(void *userdata)
case ALGO_CRYPTOLIGHT:
rc = scanhash_cryptolight(thr_id, &work, max_nonce, &hashes_done, 1);
break;
case ALGO_MONERO:
case ALGO_STELLITE:
case ALGO_GRAFT:
case ALGO_CRYPTONIGHT:
{
int cn_variant = 0;

9
crypto/cryptonight.cu

@ -50,8 +50,11 @@ extern "C" int scanhash_cryptonight(int thr_id, struct work* work, uint32_t max_ @@ -50,8 +50,11 @@ extern "C" int scanhash_cryptonight(int thr_id, struct work* work, uint32_t max_
gpulog_init(LOG_INFO, thr_id, "%s, %d MB available, %hd SMX", device_name[dev_id],
mem, device_mpcount[dev_id]);
if (!device_config[thr_id] && strcmp(device_name[dev_id], "TITAN V") == 0) {
device_config[thr_id] = strdup("80x24");
if (!device_config[thr_id]) {
if(strcmp(device_name[dev_id], "TITAN V") == 0)
device_config[thr_id] = strdup("80x24");
if(strstr(device_name[dev_id], "V100"))
device_config[thr_id] = strdup("80x24");
}
if (device_config[thr_id]) {
@ -83,7 +86,7 @@ extern "C" int scanhash_cryptonight(int thr_id, struct work* work, uint32_t max_ @@ -83,7 +86,7 @@ extern "C" int scanhash_cryptonight(int thr_id, struct work* work, uint32_t max_
CUDA_LOG_ERROR();
}
const size_t alloc = MEMORY * throughput;
const size_t alloc = MEMORY * size_t(throughput);
cryptonight_extra_init(thr_id);
cudaMalloc(&d_long_state[thr_id], alloc);

3
equi/equihash.cpp

@ -183,8 +183,7 @@ extern "C" int scanhash_equihash(int thr_id, struct work *work, uint32_t max_non @@ -183,8 +183,7 @@ extern "C" int scanhash_equihash(int thr_id, struct work *work, uint32_t max_non
return -1;
}
size_t memSz = solvers[thr_id]->equi_mem_sz / (1024*1024);
gpus_intensity[thr_id] = (uint32_t) solvers[thr_id]->throughput;
api_set_throughput(thr_id, gpus_intensity[thr_id]);
api_set_throughput(thr_id, (uint32_t) solvers[thr_id]->throughput);
gpulog(LOG_DEBUG, thr_id, "Allocated %u MB of context memory", (u32) memSz);
cuda_get_arch(thr_id);
init[thr_id] = true;

Loading…
Cancel
Save