diff --git a/CHANGELOG.md b/CHANGELOG.md index a83f24d73..24749dd90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # v4.0.2-beta +- **OpenCL backend disabled by default.**. - [#1183](https://github.com/xmrig/xmrig/issues/1183) Fixed compatibility with systemd. - [#1185](https://github.com/xmrig/xmrig/pull/1185) Added JIT compiler for RandomX on ARMv8. - Added command line option `--no-cpu` to disable CPU backend. diff --git a/src/backend/opencl/OclConfig.cpp b/src/backend/opencl/OclConfig.cpp index cdb38ccb8..cec10b359 100644 --- a/src/backend/opencl/OclConfig.cpp +++ b/src/backend/opencl/OclConfig.cpp @@ -215,16 +215,18 @@ void xmrig::OclConfig::read(const rapidjson::Value &value) setPlatform(Json::getValue(value, kPlatform)); - if (isEnabled()) { - m_threads.read(value); + m_threads.read(value); - generate(); - } + generate(); } - else if (value.IsBool() && value.IsFalse()) { - m_enabled = false; + else if (value.IsBool()) { + m_enabled = value.GetBool(); + + generate(); } else { + m_shouldSave = true; + generate(); } } @@ -232,6 +234,10 @@ void xmrig::OclConfig::read(const rapidjson::Value &value) void xmrig::OclConfig::generate() { + if (!isEnabled()) { + return; + } + if (!OclLib::init(loader())) { return; } diff --git a/src/backend/opencl/OclConfig.h b/src/backend/opencl/OclConfig.h index 22d1378ea..72546342e 100644 --- a/src/backend/opencl/OclConfig.h +++ b/src/backend/opencl/OclConfig.h @@ -56,7 +56,7 @@ private: void setPlatform(const rapidjson::Value &platform); bool m_cache = true; - bool m_enabled = true; + bool m_enabled = false; bool m_shouldSave = false; String m_loader; String m_platformVendor; diff --git a/src/config.json b/src/config.json index 2f88ecabf..3023d22a1 100644 --- a/src/config.json +++ b/src/config.json @@ -29,7 +29,7 @@ "cn-lite/0": false }, "opencl": { - "enabled": true, + "enabled": false, "cache": true, "loader": null, "platform": "AMD", diff --git a/src/core/config/Config_default.h b/src/core/config/Config_default.h index 8011bf16e..b68166498 100644 --- a/src/core/config/Config_default.h +++ b/src/core/config/Config_default.h @@ -63,7 +63,7 @@ R"===( "cn-lite/0": false }, "opencl": { - "enabled": true, + "enabled": false, "cache": true, "loader": null, "platform": "AMD",