From 9648529ef414ad289e2e063301ce3fe3e947918d Mon Sep 17 00:00:00 2001 From: Genoil Date: Tue, 21 Apr 2015 23:14:59 +0200 Subject: [PATCH] Use single GPU mining thread when --opencl-device is chosen --- eth/main.cpp | 1 + libethcore/Ethash.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eth/main.cpp b/eth/main.cpp index 2d79f4954..15041d651 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -612,6 +612,7 @@ int main(int argc, char** argv) else if (arg == "--opencl-device" && i + 1 < argc) try { openclDevice = stol(argv[++i]); + miningThreads = 1; } catch (...) { diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index c40ce2625..66dc953b7 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -311,7 +311,7 @@ void Ethash::GPUMiner::workLoop() auto p = EthashAux::params(m_minerSeed); auto cb = [&](void* d) { EthashAux::full(m_minerSeed, bytesRef((byte*)d, p.full_size)); }; - unsigned device = instances() > 0 ? index() : s_deviceId; + unsigned device = instances() > 1 ? index() : s_deviceId; m_miner->init(p, cb, 32, s_platformId, device); }