Skip to content

Commit

Permalink
fix error "cannot set while device is active in this process"
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausT committed Oct 13, 2017
1 parent 7c2f952 commit 5150cae
Show file tree
Hide file tree
Showing 28 changed files with 77 additions and 50 deletions.
5 changes: 3 additions & 2 deletions Algo256/blake256.cu
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,9 @@ extern int scanhash_blake256(int thr_id, uint32_t *pdata, uint32_t *ptarget,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
CUDA_SAFE_CALL(cudaMallocHost(&h_data, 15 * sizeof(uint32_t)));
CUDA_SAFE_CALL(cudaMallocHost(&h_resNonce, NBN * sizeof(uint32_t)));
Expand Down
5 changes: 3 additions & 2 deletions Algo256/cuda_fugue256.cu
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,9 @@ fugue256_gpu_hash(int thr_id, uint32_t threads, uint32_t startNounce, void *outp
void fugue256_cpu_init(int thr_id, uint32_t threads)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));

// Kopiere die Hash-Tabellen in den GPU-Speicher
texDef(mixTab0Tex, mixTab0m, mixtab0_cpu, sizeof(uint32_t)*256);
Expand Down
5 changes: 3 additions & 2 deletions Algo256/keccak256.cu
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ extern int scanhash_keccak256(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
CUDA_SAFE_CALL(cudaMallocHost(&h_nounce, 2 * sizeof(uint32_t)));
keccak256_cpu_init(thr_id, (int)throughputmax);
Expand Down
5 changes: 3 additions & 2 deletions JHA/jackpotcoin.cu
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ extern int scanhash_jackpot(int thr_id, uint32_t *pdata,
if (!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));

CUDA_SAFE_CALL(cudaMalloc(&d_hash, 16 * sizeof(uint32_t) * throughputmax));
Expand Down
5 changes: 3 additions & 2 deletions Sia/sia.cu
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ int scanhash_sia(int thr_id, uint32_t *pdata, uint32_t *ptarget, uint32_t max_no
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));

CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
CUDA_SAFE_CALL(cudaMallocHost(&h_nounce, MAXRESULTS * sizeof(uint32_t)));
Expand Down
5 changes: 3 additions & 2 deletions bitcoin.cu
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ int scanhash_bitcoin(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));

CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
bitcoin_cpu_init(thr_id);
Expand Down
1 change: 0 additions & 1 deletion ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,6 @@ int main(int argc, char *argv[])
fprintf(stderr, "%s: no URL supplied\n", argv[0]);
show_usage_and_exit(1);
}
cuda_devicereset();

if(!rpc_userpass)
{
Expand Down
5 changes: 3 additions & 2 deletions cuda_myriadgroestl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ static THREAD cudaStream_t stream[3];
__host__ void myriadgroestl_cpu_init(int thr_id, uint32_t threads)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&stream[0]));
CUDA_SAFE_CALL(cudaStreamCreate(&stream[1]));
CUDA_SAFE_CALL(cudaStreamCreate(&stream[2]));
Expand Down
5 changes: 3 additions & 2 deletions cuda_nist5.cu
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ extern int scanhash_nist5(int thr_id, uint32_t *pdata,
{
oldthroughput = throughput;
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions groestlcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ extern int scanhash_groestlcoin(int thr_id, uint32_t *pdata, uint32_t *ptarget,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));

groestlcoin_cpu_init(thr_id, throughputmax);
Expand Down
5 changes: 3 additions & 2 deletions lyra2/lyra2REv2.cu
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ int scanhash_lyra2v2(int thr_id, uint32_t *pdata,
if (!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
4 changes: 3 additions & 1 deletion neoscrypt/neoscrypt.cu
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ int scanhash_neoscrypt(bool stratum, int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));

cudaDeviceProp props;
cudaGetDeviceProperties(&props, device_map[thr_id]);
Expand Down Expand Up @@ -99,7 +102,6 @@ int scanhash_neoscrypt(bool stratum, int thr_id, uint32_t *pdata,
}

throughputmax = device_intensity(device_map[thr_id], __func__, intensity) / 2;
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
// cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaMallocHost(&foundNonce, 2 * 4));

Expand Down
5 changes: 3 additions & 2 deletions pentablake.cu
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,9 @@ extern int scanhash_pentablake(int thr_id, uint32_t *pdata, uint32_t *ptarget,
if (!init[thr_id])
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions quark/quarkcoin.cu
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ extern int scanhash_quark(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
// }

Expand Down
5 changes: 3 additions & 2 deletions qubit/deep.cu
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ extern int scanhash_deep(int thr_id, uint32_t *pdata,
if (!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions qubit/doom.cu
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ extern int scanhash_doom(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions qubit/qubit.cu
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ extern int scanhash_qubit(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));

#if defined WIN32 && !defined _WIN64
Expand Down
5 changes: 3 additions & 2 deletions skein.cu
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ int scanhash_skeincoin(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
CUDA_SAFE_CALL(cudaMallocHost(&foundnonces, 2 * 4));
mining_has_stopped[thr_id] = false;
Expand Down
1 change: 1 addition & 0 deletions x11/c11.cu
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ int scanhash_c11(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
Expand Down
5 changes: 3 additions & 2 deletions x11/fresh.cu
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ extern int scanhash_fresh(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions x11/s3.cu
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ extern int scanhash_s3(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
1 change: 1 addition & 0 deletions x11/x11.cu
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ extern int scanhash_x11(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
Expand Down
5 changes: 3 additions & 2 deletions x13/x13.cu
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ extern int scanhash_x13(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions x15/whirlpool.cu
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ extern int scanhash_whc(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions x15/whirlpoolx.cu
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ int scanhash_whirlpoolx(int thr_id, uint32_t *pdata, uint32_t *ptarget, uint32_t
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
whirlpoolx_cpu_init(thr_id, throughputmax);
mining_has_stopped[thr_id] = false;
Expand Down
5 changes: 3 additions & 2 deletions x15/x14.cu
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ extern int scanhash_x14(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions x15/x15.cu
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ extern int scanhash_x15(int thr_id, uint32_t *pdata,
if(!init)
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down
5 changes: 3 additions & 2 deletions x17/x17.cu
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ extern int scanhash_x17(int thr_id, uint32_t *pdata,
if (!init[thr_id])
{
CUDA_SAFE_CALL(cudaSetDevice(device_map[thr_id]));
cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync);
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
CUDA_SAFE_CALL(cudaDeviceReset());
CUDA_SAFE_CALL(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
CUDA_SAFE_CALL(cudaStreamCreate(&gpustream[thr_id]));
#if defined WIN32 && !defined _WIN64
// 2GB limit for cudaMalloc
Expand Down

0 comments on commit 5150cae

Please sign in to comment.