Skip to content

Commit

Permalink
Merge pull request #423 from psychocrypt/topic-moreConservativeNvidia…
Browse files Browse the repository at this point in the history
…Autosuggestion

conservative NVIDIA auto suggestion
  • Loading branch information
fireice-uk authored Dec 9, 2017
2 parents a29e7d5 + 6b739ec commit 30888a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
( props.major < 3 ? 2 : 3 );

// increase bfactor for low end devices to avoid that the miner is killed by the OS
if(props.multiProcessorCount < 6)
if(props.multiProcessorCount <= 6)
ctx->device_bfactor += 2;
}
if(ctx->device_threads == -1)
Expand All @@ -418,6 +418,19 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)

// no limit by default 1TiB
size_t maxMemUsage = byteToMiB * byteToMiB;
if(props.major == 6)
{
if(props.multiProcessorCount < 15)
{
// limit memory usage for GPUs for pascal < GTX1070
maxMemUsage = size_t(2048u) * byteToMiB;
}
else if(props.multiProcessorCount <= 20)
{
// limit memory usage for GPUs for pascal GTX1070, GTX1080
maxMemUsage = size_t(4096u) * byteToMiB;
}
}
if(props.major < 6)
{
// limit memory usage for GPUs before pascal
Expand Down

0 comments on commit 30888a3

Please sign in to comment.