From 2cdf2ddd4394cd1445612fa4c1d9a489d676b01a Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Wed, 8 Mar 2017 09:18:49 +0100 Subject: [PATCH] Add missing real cuda arch checks --- Algo256/blake256.cu | 2 ++ Algo256/blake2s.cu | 2 ++ Algo256/decred.cu | 2 ++ Algo256/vanilla.cu | 2 ++ lbry/lbry.cu | 1 + skein.cu | 2 ++ 6 files changed, 11 insertions(+) diff --git a/Algo256/blake256.cu b/Algo256/blake256.cu index 6a0a78e..3d2ca60 100644 --- a/Algo256/blake256.cu +++ b/Algo256/blake256.cu @@ -506,6 +506,8 @@ extern "C" int scanhash_blake256(int thr_id, struct work* work, uint32_t max_non } gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); + cuda_get_arch(thr_id); + CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); init[thr_id] = true; diff --git a/Algo256/blake2s.cu b/Algo256/blake2s.cu index 3162f8e..53cd86e 100644 --- a/Algo256/blake2s.cu +++ b/Algo256/blake2s.cu @@ -458,6 +458,8 @@ extern "C" int scanhash_blake2s(int thr_id, struct work *work, uint32_t max_nonc } gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); + cuda_get_arch(thr_id); + CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], maxResults * sizeof(uint32_t)), -1); CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], maxResults * sizeof(uint32_t)), -1); init[thr_id] = true; diff --git a/Algo256/decred.cu b/Algo256/decred.cu index e773b39..e539c8e 100644 --- a/Algo256/decred.cu +++ b/Algo256/decred.cu @@ -374,6 +374,8 @@ extern "C" int scanhash_decred(int thr_id, struct work* work, uint32_t max_nonce } gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); + cuda_get_arch(thr_id); + CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], MAX_RESULTS*sizeof(uint32_t)), -1); CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], MAX_RESULTS*sizeof(uint32_t)), -1); init[thr_id] = true; diff --git a/Algo256/vanilla.cu b/Algo256/vanilla.cu index 1928088..1b63aed 100644 --- a/Algo256/vanilla.cu +++ b/Algo256/vanilla.cu @@ -394,6 +394,8 @@ extern "C" int scanhash_vanilla(int thr_id, struct work* work, uint32_t max_nonc } gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); + cuda_get_arch(thr_id); + CUDA_CALL_OR_RET_X(cudaMalloc(&d_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); CUDA_CALL_OR_RET_X(cudaMallocHost(&h_resNonce[thr_id], NBN * sizeof(uint32_t)), -1); cudaStreamCreate(&streams[thr_id]); diff --git a/lbry/lbry.cu b/lbry/lbry.cu index 38dd513..89f67cd 100644 --- a/lbry/lbry.cu +++ b/lbry/lbry.cu @@ -119,6 +119,7 @@ extern "C" int scanhash_lbry(int thr_id, struct work *work, uint32_t max_nonce, } gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); + cuda_get_arch(thr_id); if (CUDART_VERSION == 6050) { applog(LOG_ERR, "This lbry kernel is not compatible with CUDA 6.5!"); diff --git a/skein.cu b/skein.cu index 234f7a0..568839f 100644 --- a/skein.cu +++ b/skein.cu @@ -374,6 +374,8 @@ extern "C" int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_no } gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput); + cuda_get_arch(thr_id); + if (sm5) { skeincoin_init(thr_id); } else {