diff --git a/src/backend/cuda/CudaConfig.cpp b/src/backend/cuda/CudaConfig.cpp index 67cee3a22..19817c65b 100644 --- a/src/backend/cuda/CudaConfig.cpp +++ b/src/backend/cuda/CudaConfig.cpp @@ -35,6 +35,7 @@ namespace xmrig { +static bool generated = false; static const char *kDevicesHint = "devices-hint"; static const char *kEnabled = "enabled"; static const char *kLoader = "loader"; @@ -113,6 +114,10 @@ void xmrig::CudaConfig::read(const rapidjson::Value &value) void xmrig::CudaConfig::generate() { + if (generated) { + return; + } + if (!isEnabled() || m_threads.has("*")) { return; } @@ -138,6 +143,7 @@ void xmrig::CudaConfig::generate() count += xmrig::generate(m_threads, devices); count += xmrig::generate(m_threads, devices); + generated = true; m_shouldSave = count > 0; }