diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-08 20:18:46 +0200 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-10 21:12:34 +0200 |
commit | e0b93c221698620bf4f14572f255317bceea7008 (patch) | |
tree | a09b642a97d5a6d3ffa44c1c50ffcba01d97d708 /xmrstak/backend/amd/autoAdjust.hpp | |
parent | e79debcfcba699a5aaf3996e18338a2c0183bb0e (diff) | |
download | xmr-stak-e0b93c221698620bf4f14572f255317bceea7008.zip xmr-stak-e0b93c221698620bf4f14572f255317bceea7008.tar.gz |
improve AMD auto suggestion
- use always a multiple of the number of compute units
- add more device information to the config file
Diffstat (limited to 'xmrstak/backend/amd/autoAdjust.hpp')
-rw-r--r-- | xmrstak/backend/amd/autoAdjust.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmrstak/backend/amd/autoAdjust.hpp b/xmrstak/backend/amd/autoAdjust.hpp index 6157b25..ebe59df 100644 --- a/xmrstak/backend/amd/autoAdjust.hpp +++ b/xmrstak/backend/amd/autoAdjust.hpp @@ -79,6 +79,8 @@ private: configEditor configTpl{}; configTpl.set( std::string(tpl) ); + constexpr size_t byteToMiB = 1024u * 1024u; + std::string conf; int i = 0; for(auto& ctx : devVec) @@ -89,8 +91,11 @@ private: size_t perThread = (size_t(1u)<<21) + 224u; size_t max_intensity = availableMem / perThread; // 1000 is a magic selected limit \todo select max intensity depending of the gpu type - size_t intensity = std::min( size_t(1000u) , max_intensity ); - conf += std::string(" // gpu: ") + ctx.name + "\n"; + size_t possibleIntensity = std::min( size_t(1000u) , max_intensity ); + // 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"; + conf += std::string(" // compute units: ") + std::to_string(ctx.computeUnits) + "\n"; // set 8 threads per block (this is a good value for the most gpus) conf += std::string(" { \"index\" : ") + std::to_string(ctx.deviceIdx) + ",\n" + " \"intensity\" : " + std::to_string(intensity) + ", \"worksize\" : " + std::to_string(8) + ",\n" + |