Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RX] NVIDIA: fix auto adjustment #2567

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
hashMemSize = std::max(hashMemSize, algo.Mem());
}

const size_t dataset_size = getRandomXDatasetSize();
/* increase maxMemUsage by the dataset because the upper limits are
* only for the scratchpad and does not take the randomX dataset into account.
*/
maxMemUsage += dataset_size;

#ifdef WIN32
/* We use in windows bfactor (split slow kernel into smaller parts) to avoid
* that windows is killing long running kernel.
Expand All @@ -346,7 +352,6 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
size_t availableMem = freeMemory - (128u * byteToMiB) - 200u;
size_t limitedMemory = std::min(availableMem, maxMemUsage);

const size_t dataset_size = getRandomXDatasetSize();
if(limitedMemory <= dataset_size)
limitedMemory = 0;
else
Expand Down