Skip to content

Commit

Permalink
bench: handle cryptonight variants + V100 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Aug 3, 2018
1 parent 370684f commit 4a76ca5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
16 changes: 16 additions & 0 deletions bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions crypto/cryptonight.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions equi/equihash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4a76ca5

Please sign in to comment.