mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-10-17 05:41:41 +02:00
tune VEGA auto suggestion
- allow to use up to 2024 threads on VEGA gpus fix #5
This commit is contained in:
@@ -97,13 +97,25 @@ private:
|
||||
int i = 0;
|
||||
for(auto& ctx : devVec)
|
||||
{
|
||||
/* 1000 is a magic selected limit, the reason is that more than 2GiB memory
|
||||
* sowing down the memory performance because of TLB cache misses
|
||||
*/
|
||||
size_t maxThreads = 1000u;
|
||||
if(ctx.name.compare("gfx901") == 0)
|
||||
{
|
||||
/* Increase the number of threads for AMD VEGA gpus.
|
||||
* Limit the number of threads based on the issue: https://github.com/fireice-uk/xmr-stak/issues/5#issuecomment-339425089
|
||||
* to avoid out of memory errors
|
||||
*/
|
||||
maxThreads = 2024u;
|
||||
}
|
||||
|
||||
// keep 128MiB memory free (value is randomly chosen)
|
||||
size_t availableMem = ctx.freeMem - (128u * byteToMiB);
|
||||
// 224byte extra memory is used per thread for meta data
|
||||
size_t perThread = hashMemSize + 224u;
|
||||
size_t max_intensity = availableMem / perThread;
|
||||
// 1000 is a magic selected limit \todo select max intensity depending of the gpu type
|
||||
size_t possibleIntensity = std::min( size_t(1000u) , max_intensity );
|
||||
size_t maxIntensity = availableMem / perThread;
|
||||
size_t possibleIntensity = std::min( maxThreads , maxIntensity );
|
||||
// map intensity to a multiple of the compute unit count, 8 is the number of threads per work group
|
||||
size_t intensity = (possibleIntensity / (8 * ctx.computeUnits)) * ctx.computeUnits * 8;
|
||||
conf += std::string(" // gpu: ") + ctx.name + " memory:" + std::to_string(availableMem / byteToMiB) + "\n";
|
||||
|
||||
Reference in New Issue
Block a user