From 409ff6d2bd03e9cbd61c3251bfc2aa8fb1e9a1e7 Mon Sep 17 00:00:00 2001 From: Jonano Date: Thu, 8 Feb 2018 01:26:59 +0300 Subject: [PATCH 01/41] XNetwork renamed to XConnection --- GpuMiner/GpuMiner.vcxproj | 4 ++-- GpuMiner/GpuMiner.vcxproj.filters | 12 +++++------ .../{XNetwork.cpp => XConnection.cpp} | 20 +++++++++---------- .../XDagCore/{XNetwork.h => XConnection.h} | 6 +++--- GpuMiner/XDagCore/XPool.cpp | 20 +++++++++---------- GpuMiner/XDagCore/XPool.h | 4 ++-- 6 files changed, 33 insertions(+), 33 deletions(-) rename GpuMiner/XDagCore/{XNetwork.cpp => XConnection.cpp} (86%) rename GpuMiner/XDagCore/{XNetwork.h => XConnection.h} (85%) diff --git a/GpuMiner/GpuMiner.vcxproj b/GpuMiner/GpuMiner.vcxproj index f5d8f97..3225b16 100644 --- a/GpuMiner/GpuMiner.vcxproj +++ b/GpuMiner/GpuMiner.vcxproj @@ -177,7 +177,7 @@ - + @@ -218,7 +218,7 @@ - + diff --git a/GpuMiner/GpuMiner.vcxproj.filters b/GpuMiner/GpuMiner.vcxproj.filters index 03b39e5..0e6ffa5 100644 --- a/GpuMiner/GpuMiner.vcxproj.filters +++ b/GpuMiner/GpuMiner.vcxproj.filters @@ -58,9 +58,6 @@ Core - - XDagCore - XDagCore @@ -115,6 +112,9 @@ MinerEngine + + XDagCore + @@ -168,9 +168,6 @@ XDagCore\win\sys - - XDagCore - XDagCore @@ -222,6 +219,9 @@ MinerEngine + + XDagCore + diff --git a/GpuMiner/XDagCore/XNetwork.cpp b/GpuMiner/XDagCore/XConnection.cpp similarity index 86% rename from GpuMiner/XDagCore/XNetwork.cpp rename to GpuMiner/XDagCore/XConnection.cpp index 1c3a5b7..32f753e 100644 --- a/GpuMiner/XDagCore/XNetwork.cpp +++ b/GpuMiner/XDagCore/XConnection.cpp @@ -1,4 +1,4 @@ -#include "XNetwork.h" +#include "XConnection.h" #include #include #include "Core/Log.h" @@ -26,17 +26,17 @@ #define INVALID_SOCKET -1 #endif -XNetwork::XNetwork() +XConnection::XConnection() { _socket = INVALID_SOCKET; } -XNetwork::~XNetwork() +XConnection::~XConnection() { Close(); } -bool XNetwork::Initialize() +bool XConnection::Initialize() { #if _WIN32 WSADATA wsaData; @@ -45,7 +45,7 @@ bool XNetwork::Initialize() return true; } -bool XNetwork::ValidateAddress(const char *address, sockaddr_in &peerAddr) +bool XConnection::ValidateAddress(const char *address, sockaddr_in &peerAddr) { char *lasts; char buf[0x100]; @@ -90,7 +90,7 @@ bool XNetwork::ValidateAddress(const char *address, sockaddr_in &peerAddr) return true; } -bool XNetwork::Connect(const char *address) +bool XConnection::Connect(const char *address) { int reuseAddr = 1; linger lingerOpt = { 1, 0 }; // Linger active, timeout 0 @@ -130,7 +130,7 @@ bool XNetwork::Connect(const char *address) } //TODO: think about exception instead of result failure flag -bool XNetwork::IsReady(NetworkAction action, int timeout, bool& success) +bool XConnection::IsReady(NetworkAction action, int timeout, bool& success) { success = false; if(action != NetworkAction::Read && action != NetworkAction::Write) @@ -161,17 +161,17 @@ bool XNetwork::IsReady(NetworkAction action, int timeout, bool& success) return (p.revents & desiredAction) > 0; } -int XNetwork::Write(char* buf, int len) +int XConnection::Write(char* buf, int len) { return write(_socket, buf, len); } -int XNetwork::Read(char* buf, int len) +int XConnection::Read(char* buf, int len) { return read(_socket, buf, len); } -void XNetwork::Close() +void XConnection::Close() { if(_socket != INVALID_SOCKET) { diff --git a/GpuMiner/XDagCore/XNetwork.h b/GpuMiner/XDagCore/XConnection.h similarity index 85% rename from GpuMiner/XDagCore/XNetwork.h rename to GpuMiner/XDagCore/XConnection.h index 1395ce0..23e963c 100644 --- a/GpuMiner/XDagCore/XNetwork.h +++ b/GpuMiner/XDagCore/XConnection.h @@ -16,15 +16,15 @@ enum class NetworkAction Write }; -class XNetwork +class XConnection { private: SOCKET _socket; bool ValidateAddress(const char *address, sockaddr_in &_peerAddr); public: - XNetwork(); - virtual ~XNetwork(); + XConnection(); + virtual ~XConnection(); bool Initialize(); bool Connect(const char *address); diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index 8da62ca..e312579 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -39,7 +39,7 @@ XPool::~XPool() bool XPool::Initialize() { - if(!_network.Initialize()) + if(!_connection.Initialize()) { clog(XDag::LogChannel) << "Failed to initialize network connection"; } @@ -83,7 +83,7 @@ bool XPool::Connect() _ndata = 0; _maxndata = sizeof(struct cheatcoin_field); - if(!_network.Connect(_poolAddress)) + if(!_connection.Connect(_poolAddress)) { return false; } @@ -97,13 +97,13 @@ bool XPool::Connect() void XPool::Disconnect() { - _network.Close(); + _connection.Close(); } //requests new tasks from pool and sends shares if ready bool XPool::Interract() { - if(!_network.IsConnected()) + if(!_connection.IsConnected()) { clog(XDag::LogChannel) << "Connection closed"; return false; @@ -121,7 +121,7 @@ bool XPool::CheckNewTasks() { bool success; // TODO: think about exceptions instead of failure flag - bool isReady = _network.IsReady(NetworkAction::Read, 0, success); + bool isReady = _connection.IsReady(NetworkAction::Read, 0, success); if(!success) { return false; @@ -130,7 +130,7 @@ bool XPool::CheckNewTasks() { break; } - int res = _network.Read((char*)data + _ndata, _maxndata - _ndata); + int res = _connection.Read((char*)data + _ndata, _maxndata - _ndata); if(res < 0) { clog(XDag::LogChannel) << "Failed to read data from pool"; @@ -195,7 +195,7 @@ bool XPool::SendTaskResult() return true; } bool success; - bool isReady = _network.IsReady(NetworkAction::Write, 0, success); + bool isReady = _connection.IsReady(NetworkAction::Write, 0, success); if(!success) { return false; @@ -225,7 +225,7 @@ bool XPool::SendToPool(cheatcoin_field *fields, int fieldCount) cheatcoin_field fieldsCopy[CHEATCOIN_BLOCK_FIELDS]; cheatcoin_hash_t hash; int todo = fieldCount * sizeof(struct cheatcoin_field), done = 0; - if(!_network.IsConnected()) + if(!_connection.IsConnected()) { return false; } @@ -246,7 +246,7 @@ bool XPool::SendToPool(cheatcoin_field *fields, int fieldCount) while(todo) { bool success; - bool isReady = _network.IsReady(NetworkAction::Write, 1000, success); + bool isReady = _connection.IsReady(NetworkAction::Write, 1000, success); if(!success) { return false; @@ -255,7 +255,7 @@ bool XPool::SendToPool(cheatcoin_field *fields, int fieldCount) { continue; } - int res = _network.Write((char*)fieldsCopy + done, todo); + int res = _connection.Write((char*)fieldsCopy + done, todo); if(res <= 0) { return false; diff --git a/GpuMiner/XDagCore/XPool.h b/GpuMiner/XDagCore/XPool.h index 74fd00f..3c91397 100644 --- a/GpuMiner/XDagCore/XPool.h +++ b/GpuMiner/XDagCore/XPool.h @@ -1,6 +1,6 @@ #pragma once -#include "XNetwork.h" +#include "XConnection.h" #include "XBlock.h" #include "XTaskProcessor.h" #include "dfstools/dfslib_crypt.h" @@ -41,7 +41,7 @@ class XPool private: cheatcoin_hash_t _addressHash; char _poolAddress[256]; - XNetwork _network; + XConnection _connection; miner _localMiner; XTaskProcessor *_taskProcessor; //TODO: move out of here From c521a83a97623c119ba724671284acc7b8762ef1 Mon Sep 17 00:00:00 2001 From: Jonano Date: Sat, 10 Feb 2018 01:48:38 +0300 Subject: [PATCH 02/41] Pool logic is rewrited. --- GpuMiner/Core/MinerManager.cpp | 4 +- GpuMiner/GpuMiner.vcxproj | 6 + GpuMiner/GpuMiner.vcxproj.filters | 22 ++- GpuMiner/XDagCore/XAddress.cpp | 10 +- GpuMiner/XDagCore/XAddress.h | 12 +- GpuMiner/XDagCore/XConnection.cpp | 4 +- GpuMiner/XDagCore/XConnection.h | 6 +- GpuMiner/XDagCore/XFee.cpp | 12 ++ GpuMiner/XDagCore/XFee.h | 13 ++ GpuMiner/XDagCore/XGlobal.cpp | 10 ++ GpuMiner/XDagCore/XGlobal.h | 7 + GpuMiner/XDagCore/XPool.cpp | 188 +++--------------------- GpuMiner/XDagCore/XPool.h | 50 +------ GpuMiner/XDagCore/XPoolConnection.cpp | 197 ++++++++++++++++++++++++++ GpuMiner/XDagCore/XPoolConnection.h | 39 +++++ 15 files changed, 344 insertions(+), 236 deletions(-) create mode 100644 GpuMiner/XDagCore/XFee.cpp create mode 100644 GpuMiner/XDagCore/XFee.h create mode 100644 GpuMiner/XDagCore/XGlobal.cpp create mode 100644 GpuMiner/XDagCore/XGlobal.h create mode 100644 GpuMiner/XDagCore/XPoolConnection.cpp create mode 100644 GpuMiner/XDagCore/XPoolConnection.h diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index d5fbf70..e8c9c73 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -14,6 +14,7 @@ #include "MinerEngine/XCpuMiner.h" #include "XDagCore/XTaskProcessor.h" #include "XDagCore/XPool.h" +#include "XDagCore/XGlobal.h" #include "Utils/CpuInfo.h" #include "Utils/Random.h" @@ -296,8 +297,9 @@ void MinerManager::DoBenchmark(MinerType type, unsigned warmupDuration, unsigned void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeriod) { - XTaskProcessor taskProcessor; + XGlobal::Init(); + XTaskProcessor taskProcessor; XPool pool(_accountAddress, remote, &taskProcessor); if(!pool.Initialize()) { diff --git a/GpuMiner/GpuMiner.vcxproj b/GpuMiner/GpuMiner.vcxproj index 3225b16..53cee92 100644 --- a/GpuMiner/GpuMiner.vcxproj +++ b/GpuMiner/GpuMiner.vcxproj @@ -175,15 +175,21 @@ + + + + + + CppCode diff --git a/GpuMiner/GpuMiner.vcxproj.filters b/GpuMiner/GpuMiner.vcxproj.filters index 0e6ffa5..8ce2664 100644 --- a/GpuMiner/GpuMiner.vcxproj.filters +++ b/GpuMiner/GpuMiner.vcxproj.filters @@ -115,6 +115,15 @@ XDagCore + + XDagCore + + + XDagCore + + + XDagCore + @@ -209,7 +218,6 @@ XDagCore - MinerEngine\CL @@ -222,6 +230,18 @@ XDagCore + + XDagCore + + + XDagCore + + + XDagCore + + + XDagCore + diff --git a/GpuMiner/XDagCore/XAddress.cpp b/GpuMiner/XDagCore/XAddress.cpp index 72903be..46d40b4 100644 --- a/GpuMiner/XDagCore/XAddress.cpp +++ b/GpuMiner/XDagCore/XAddress.cpp @@ -2,15 +2,7 @@ #include static const uint8_t* bits2mime = (uint8_t*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -XAddress::XAddress() -{ - Init(); -} - -XAddress::~XAddress() -{ -} +uint8_t XAddress::_mime2bits[256]; void XAddress::Init() { diff --git a/GpuMiner/XDagCore/XAddress.h b/GpuMiner/XDagCore/XAddress.h index b9733f9..247d83a 100644 --- a/GpuMiner/XDagCore/XAddress.h +++ b/GpuMiner/XDagCore/XAddress.h @@ -5,14 +5,10 @@ class XAddress { private: - uint8_t _mime2bits[256]; - - void Init(); + static uint8_t _mime2bits[256]; public: - XAddress(); - ~XAddress(); - - bool AddressToHash(const char* address, cheatcoin_hash_t hash); - const char* HashToAddress(const cheatcoin_hash_t hash); + static void Init(); + static bool AddressToHash(const char* address, cheatcoin_hash_t hash); + static const char* HashToAddress(const cheatcoin_hash_t hash); }; diff --git a/GpuMiner/XDagCore/XConnection.cpp b/GpuMiner/XDagCore/XConnection.cpp index 32f753e..e84c0b7 100644 --- a/GpuMiner/XDagCore/XConnection.cpp +++ b/GpuMiner/XDagCore/XConnection.cpp @@ -45,7 +45,7 @@ bool XConnection::Initialize() return true; } -bool XConnection::ValidateAddress(const char *address, sockaddr_in &peerAddr) +bool XConnection::ValidatePoolAddress(const char *address, sockaddr_in &peerAddr) { char *lasts; char buf[0x100]; @@ -96,7 +96,7 @@ bool XConnection::Connect(const char *address) linger lingerOpt = { 1, 0 }; // Linger active, timeout 0 sockaddr_in peerAddr; - if(!ValidateAddress(address, peerAddr)) + if(!ValidatePoolAddress(address, peerAddr)) { return false; } diff --git a/GpuMiner/XDagCore/XConnection.h b/GpuMiner/XDagCore/XConnection.h index 23e963c..53fe1dc 100644 --- a/GpuMiner/XDagCore/XConnection.h +++ b/GpuMiner/XDagCore/XConnection.h @@ -21,13 +21,13 @@ class XConnection private: SOCKET _socket; - bool ValidateAddress(const char *address, sockaddr_in &_peerAddr); + static bool ValidatePoolAddress(const char *address, sockaddr_in &_peerAddr); public: XConnection(); virtual ~XConnection(); - bool Initialize(); - bool Connect(const char *address); + virtual bool Initialize(); + virtual bool Connect(const char *address); bool IsReady(NetworkAction action, int timeout, bool &success); int Write(char* buf, int len); int Read(char* buf, int len); diff --git a/GpuMiner/XDagCore/XFee.cpp b/GpuMiner/XDagCore/XFee.cpp new file mode 100644 index 0000000..0bf4f68 --- /dev/null +++ b/GpuMiner/XDagCore/XFee.cpp @@ -0,0 +1,12 @@ +#include "XFee.h" + + + +XFee::XFee() +{ +} + + +XFee::~XFee() +{ +} diff --git a/GpuMiner/XDagCore/XFee.h b/GpuMiner/XDagCore/XFee.h new file mode 100644 index 0000000..f6af4c6 --- /dev/null +++ b/GpuMiner/XDagCore/XFee.h @@ -0,0 +1,13 @@ +#pragma once +#include + +class XFee +{ +private: + int _nextAddress; + +public: + XFee(); + ~XFee(); +}; + diff --git a/GpuMiner/XDagCore/XGlobal.cpp b/GpuMiner/XDagCore/XGlobal.cpp new file mode 100644 index 0000000..9d93f85 --- /dev/null +++ b/GpuMiner/XDagCore/XGlobal.cpp @@ -0,0 +1,10 @@ +#include "XGlobal.h" +#include "XAddress.h" +#include "dar/crc.h" + +void XGlobal::Init() +{ + XAddress::Init(); + crc_init(); +} + diff --git a/GpuMiner/XDagCore/XGlobal.h b/GpuMiner/XDagCore/XGlobal.h new file mode 100644 index 0000000..e8cdebe --- /dev/null +++ b/GpuMiner/XDagCore/XGlobal.h @@ -0,0 +1,7 @@ +#pragma once +class XGlobal +{ +public: + static void Init(); +}; + diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index e312579..687f203 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -1,8 +1,5 @@ #include "XPool.h" #include -#include "dfstools/dfslib_string.h" -#include "dar/crc.h" -#include "XAddress.h" #include "XTime.h" #include "Core/Log.h" #include "Utils/StringFormat.h" @@ -15,26 +12,14 @@ XPool::XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcess { strcpy(_poolAddress, poolAddress.c_str()); _taskProcessor = taskProcessor; - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - _localMiner.nfield_in = 0; - _localMiner.nfield_out = 0; _taskTime = 0; _lastShareTime = 0; + _currentConnection = NULL; memset(_lastHash, 0, sizeof(cheatcoin_hash_t)); - - XAddress address; - address.AddressToHash(accountAddress.c_str(), _addressHash); - memcpy(_localMiner.id.data, _addressHash, sizeof(cheatcoin_hash_t)); } XPool::~XPool() { - if(!_crypt) - { - free(_crypt); - _crypt = NULL; - } } bool XPool::Initialize() @@ -42,56 +27,18 @@ bool XPool::Initialize() if(!_connection.Initialize()) { clog(XDag::LogChannel) << "Failed to initialize network connection"; - } - if(!InitCrypto()) - { - clog(XDag::LogChannel) << "Failed to initialize cryptography system"; return false; } - - XBlock::GenerateFakeBlock(&_firstBlock); - crc_init(); - return true; -} - -bool XPool::InitCrypto() -{ - dfslib_string str; - uint32_t sector[128]; - _crypt = (dfslib_crypt*)malloc(sizeof(struct dfslib_crypt)); - if(!_crypt) - { - return false; - } - dfslib_crypt_set_password(_crypt, dfslib_utf8_string(&str, MINERS_PWD, (uint32_t)strlen(MINERS_PWD))); - for(int i = 0; i < 128; ++i) - { - sector[i] = SECTOR0_BASE + i * SECTOR0_OFFSET; - } - for(int i = 0; i < 128; ++i) - { - dfslib_crypt_set_sector0(_crypt, sector); - dfslib_encrypt_sector(_crypt, sector, SECTOR0_BASE + i * SECTOR0_OFFSET); - } return true; } bool XPool::Connect() { - _localMiner.nfield_in = 0; - _localMiner.nfield_out = 0; - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - if(!_connection.Connect(_poolAddress)) { return false; } - //as far as I understand it is necessary for miner identification - if(!SendToPool(_firstBlock.field, CHEATCOIN_BLOCK_FIELDS)) - { - return false; - } + _currentConnection = &_connection; return true; } @@ -103,7 +50,7 @@ void XPool::Disconnect() //requests new tasks from pool and sends shares if ready bool XPool::Interract() { - if(!_connection.IsConnected()) + if(!_currentConnection->IsConnected()) { clog(XDag::LogChannel) << "Connection closed"; return false; @@ -116,55 +63,22 @@ bool XPool::Interract() bool XPool::CheckNewTasks() { - cheatcoin_field data[2]; - for(;;) + bool noData; + do { - bool success; - // TODO: think about exceptions instead of failure flag - bool isReady = _connection.IsReady(NetworkAction::Read, 0, success); - if(!success) + if(!_currentConnection->ReadTaskData([this](cheatcoin_field* data) { OnNewTask(data); }, noData)) { return false; } - if(!isReady) - { - break; - } - int res = _connection.Read((char*)data + _ndata, _maxndata - _ndata); - if(res < 0) - { - clog(XDag::LogChannel) << "Failed to read data from pool"; - return false; - } - _ndata += res; - if(_ndata == _maxndata) - { - cheatcoin_field *last = data + (_ndata / sizeof(struct cheatcoin_field) - 1); - dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); - if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) - { - // if returned data contains hash of account address - pool sent information about incoming transfer - // we just ignore it - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - } - else if(_maxndata == 2 * sizeof(struct cheatcoin_field)) - { - OnNewTask(data); - } - else - { - _maxndata = 2 * sizeof(struct cheatcoin_field); - } - } } + while(!noData); return true; } void XPool::OnNewTask(cheatcoin_field* data) { XTaskWrapper* task = _taskProcessor->GetNextTask(); - task->FillAndPrecalc(data, _addressHash); + task->FillAndPrecalc(data, _currentConnection->GetAddressHash()); _taskProcessor->SwitchTask(); _lastShareTime = _taskTime = time(0); @@ -173,9 +87,6 @@ void XPool::OnNewTask(cheatcoin_field* data) #if _TEST_TASKS _taskProcessor->DumpTasks(); #endif - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - #if _DEBUG std::cout << "State:" << std::endl; DumpHex((uint8_t*)task->GetTask()->ctx.state, 32); @@ -194,81 +105,22 @@ bool XPool::SendTaskResult() { return true; } - bool success; - bool isReady = _connection.IsReady(NetworkAction::Write, 0, success); - if(!success) + return _currentConnection->WriteTaskData([this]() { - return false; - } - if(!isReady) - { - return true; - } - - cheatcoin_pool_task *task = _taskProcessor->GetCurrentTask()->GetTask(); - uint64_t *hash = task->minhash.data; - _lastShareTime = time(0); - memcpy(_lastHash, hash, sizeof(cheatcoin_hash_t)); - bool res = SendToPool(&task->lastfield, 1); - clog(XDag::LogChannel) << string_format("Share t=%llx res=%s\n%016llx%016llx%016llx%016llx", - task->main_time << 16 | 0xffff, res ? "OK" : "Fail", hash[3], hash[2], hash[1], hash[0]); - if(!res) - { - clog(XDag::LogChannel) << "Failed to send task result"; - return false; - } - return true; -} - -bool XPool::SendToPool(cheatcoin_field *fields, int fieldCount) -{ - cheatcoin_field fieldsCopy[CHEATCOIN_BLOCK_FIELDS]; - cheatcoin_hash_t hash; - int todo = fieldCount * sizeof(struct cheatcoin_field), done = 0; - if(!_connection.IsConnected()) - { - return false; - } - memcpy(fieldsCopy, fields, todo); - if(fieldCount == CHEATCOIN_BLOCK_FIELDS) - { - uint32_t crc; - fieldsCopy[0].transport_header = 0; - XHash::GetHash(fieldsCopy, sizeof(struct cheatcoin_block), hash); - fieldsCopy[0].transport_header = HEADER_WORD; - crc = crc_of_array((uint8_t *)fieldsCopy, sizeof(struct cheatcoin_block)); - fieldsCopy[0].transport_header |= (uint64_t)crc << 32; - } - for(int i = 0; i < fieldCount; ++i) - { - dfslib_encrypt_array(_crypt, (uint32_t *)(fieldsCopy + i), DATA_SIZE, _localMiner.nfield_out++); - } - while(todo) - { - bool success; - bool isReady = _connection.IsReady(NetworkAction::Write, 1000, success); - if(!success) + cheatcoin_pool_task *task = _taskProcessor->GetCurrentTask()->GetTask(); + uint64_t *hash = task->minhash.data; + _lastShareTime = time(0); + memcpy(_lastHash, hash, sizeof(cheatcoin_hash_t)); + bool res = _currentConnection->SendToPool(&task->lastfield, 1); + clog(XDag::LogChannel) << string_format("Share t=%llx res=%s\n%016llx%016llx%016llx%016llx", + task->main_time << 16 | 0xffff, res ? "OK" : "Fail", hash[3], hash[2], hash[1], hash[0]); + if(!res) { + clog(XDag::LogChannel) << "Failed to send task result"; return false; } - if(!isReady) - { - continue; - } - int res = _connection.Write((char*)fieldsCopy + done, todo); - if(res <= 0) - { - return false; - } - done += res, todo -= res; - } - - if(fieldCount == CHEATCOIN_BLOCK_FIELDS) - { - clog(XDag::LogChannel) << string_format("Sent block info t=%llx res=OK\n%016llx%016llx%016llx%016llx", - fields[0].time, hash[3], hash[2], hash[1], hash[0]); - } - return true; + return true; + }); } bool XPool::HasNewShare() diff --git a/GpuMiner/XDagCore/XPool.h b/GpuMiner/XDagCore/XPool.h index 3c91397..1aa82ff 100644 --- a/GpuMiner/XDagCore/XPool.h +++ b/GpuMiner/XDagCore/XPool.h @@ -1,60 +1,21 @@ #pragma once -#include "XConnection.h" +#include "XPoolConnection.h" #include "XBlock.h" #include "XTaskProcessor.h" -#include "dfstools/dfslib_crypt.h" - -#define CHEATCOIN_POOL_N_CONFIRMATIONS 16 -#define N_MINERS 4096 -#define START_N_MINERS 256 -#define START_N_MINERS_IP 8 -#define N_CONFIRMATIONS CHEATCOIN_POOL_N_CONFIRMATIONS -#define MINERS_PWD "minersgonnamine" -#define SECTOR0_BASE 0x1947f3acu -#define SECTOR0_OFFSET 0x82e9d1b5u -#define HEADER_WORD 0x3fca9e2bu -#define DATA_SIZE (sizeof(struct cheatcoin_field) / sizeof(uint32_t)) -#define SEND_PERIOD 10 //result send period - -struct miner -{ - double maxdiff[N_CONFIRMATIONS]; - cheatcoin_field id; - uint32_t data[DATA_SIZE]; - double prev_diff; - cheatcoin_time_t main_time; - uint64_t nfield_in; - uint64_t nfield_out; - uint64_t ntask; - cheatcoin_block *block; - uint32_t ip; - uint16_t port; - uint16_t state; - uint8_t data_size; - uint8_t block_size; -}; -struct cheatcoin_block; +#include "XFee.h" class XPool { private: - cheatcoin_hash_t _addressHash; char _poolAddress[256]; - XConnection _connection; - miner _localMiner; + XPoolConnection _connection; + XPoolConnection* _currentConnection; XTaskProcessor *_taskProcessor; - //TODO: move out of here - dfslib_crypt *_crypt; cheatcoin_hash_t _lastHash; time_t _taskTime; time_t _lastShareTime; - //TODO: the purpose of these properties is unclear for me now, just copy-paste... - int _ndata, _maxndata; - cheatcoin_block _firstBlock; - - bool SendToPool(cheatcoin_field *fields, int fieldCount); - bool InitCrypto(); + XFee* _fee; bool CheckNewTasks(); bool SendTaskResult(); @@ -64,6 +25,7 @@ class XPool XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcessor *taskProcessor); virtual ~XPool(); + void SetFee(XFee* fee) { _fee = fee; } bool Initialize(); bool Connect(); void Disconnect(); diff --git a/GpuMiner/XDagCore/XPoolConnection.cpp b/GpuMiner/XDagCore/XPoolConnection.cpp new file mode 100644 index 0000000..5ae9c62 --- /dev/null +++ b/GpuMiner/XDagCore/XPoolConnection.cpp @@ -0,0 +1,197 @@ +#include "XPoolConnection.h" +#include "XAddress.h" +#include "XBlock.h" +#include "Core/Log.h" +#include "dfstools/dfslib_crypt.h" +#include "dar/crc.h" + +#define SECTOR0_BASE 0x1947f3acu +#define SECTOR0_OFFSET 0x82e9d1b5u +#define HEADER_WORD 0x3fca9e2bu +#define MINERS_PWD "minersgonnamine" +#define DATA_SIZE (sizeof(struct cheatcoin_field) / sizeof(uint32_t)) + +XPoolConnection::XPoolConnection() +{ + _localMiner.nfield_in = 0; + _localMiner.nfield_out = 0; +} + +XPoolConnection::XPoolConnection(std::string& accountAddress) +{ + SetAddress(accountAddress); +} + +XPoolConnection::~XPoolConnection() +{ + if(!_crypt) + { + free(_crypt); + _crypt = NULL; + } +} + +void XPoolConnection::SetAddress(std::string& accountAddress) +{ + XAddress address; + address.AddressToHash(accountAddress.c_str(), _addressHash); +} + +bool XPoolConnection::InitCrypto() +{ + dfslib_string str; + uint32_t sector[128]; + _crypt = (dfslib_crypt*)malloc(sizeof(struct dfslib_crypt)); + if(!_crypt) + { + return false; + } + dfslib_crypt_set_password(_crypt, dfslib_utf8_string(&str, MINERS_PWD, (uint32_t)strlen(MINERS_PWD))); + for(int i = 0; i < 128; ++i) + { + sector[i] = SECTOR0_BASE + i * SECTOR0_OFFSET; + } + for(int i = 0; i < 128; ++i) + { + dfslib_crypt_set_sector0(_crypt, sector); + dfslib_encrypt_sector(_crypt, sector, SECTOR0_BASE + i * SECTOR0_OFFSET); + } + return true; +} + +bool XPoolConnection::Initialize() +{ + if(!InitCrypto()) + { + clog(XDag::LogChannel) << "Failed to initialize cryptography system"; + return false; + } + return XConnection::Initialize(); +} + +bool XPoolConnection::Connect(const char *address) +{ + _localMiner.nfield_in = 0; + _localMiner.nfield_out = 0; + if(!XConnection::Connect(address)) + { + return false; + } + cheatcoin_block block; + XBlock::GenerateFakeBlock(&block); + if(!SendToPool(block.field, CHEATCOIN_BLOCK_FIELDS)) + { + return false; + } + return true; +} + +bool XPoolConnection::SendToPool(cheatcoin_field *fields, int fieldCount) +{ + cheatcoin_field fieldsCopy[CHEATCOIN_BLOCK_FIELDS]; + cheatcoin_hash_t hash; + int todo = fieldCount * sizeof(struct cheatcoin_field), done = 0; + if(!IsConnected()) + { + return false; + } + memcpy(fieldsCopy, fields, todo); + if(fieldCount == CHEATCOIN_BLOCK_FIELDS) + { + uint32_t crc; + fieldsCopy[0].transport_header = 0; + XHash::GetHash(fieldsCopy, sizeof(struct cheatcoin_block), hash); + fieldsCopy[0].transport_header = HEADER_WORD; + crc = crc_of_array((uint8_t *)fieldsCopy, sizeof(struct cheatcoin_block)); + fieldsCopy[0].transport_header |= (uint64_t)crc << 32; + } + for(int i = 0; i < fieldCount; ++i) + { + dfslib_encrypt_array(_crypt, (uint32_t *)(fieldsCopy + i), DATA_SIZE, _localMiner.nfield_out++); + } + while(todo) + { + bool success; + bool isReady = IsReady(NetworkAction::Write, 1000, success); + if(!success) + { + return false; + } + if(!isReady) + { + continue; + } + int res = Write((char*)fieldsCopy + done, todo); + if(res <= 0) + { + return false; + } + done += res, todo -= res; + } + return true; +} + +bool XPoolConnection::ReadTaskData(std::function onNewTask, bool& noData) +{ + noData = true; + cheatcoin_field data[2]; + bool success; + // TODO: think about exceptions instead of failure flag + bool isReady = IsReady(NetworkAction::Read, 0, success); + if(!success) + { + return false; + } + if(!isReady) + { + return true; + } + int res = Read((char*)data + _ndata, _maxndata - _ndata); + if(res <= 0) + { + clog(XDag::LogChannel) << "Failed to read data from pool"; + return false; + } + _ndata += res; + if(_ndata == _maxndata) + { + cheatcoin_field *last = data + (_ndata / sizeof(struct cheatcoin_field) - 1); + dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); + if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) + { + // if returned data contains hash of account address - pool sent information about incoming transfer + // we just ignore it + _ndata = 0; + _maxndata = sizeof(struct cheatcoin_field); + } + else if(_maxndata == 2 * sizeof(struct cheatcoin_field)) + { + noData = false; + onNewTask(data); + _ndata = 0; + _maxndata = sizeof(struct cheatcoin_field); + } + else + { + _maxndata = 2 * sizeof(struct cheatcoin_field); + } + } + + return true; +} + +bool XPoolConnection::WriteTaskData(std::function onSendTask) +{ + bool success; + bool isReady = IsReady(NetworkAction::Write, 0, success); + if(!success) + { + return false; + } + if(!isReady) + { + return true; + } + + return onSendTask(); +} \ No newline at end of file diff --git a/GpuMiner/XDagCore/XPoolConnection.h b/GpuMiner/XDagCore/XPoolConnection.h new file mode 100644 index 0000000..a2af748 --- /dev/null +++ b/GpuMiner/XDagCore/XPoolConnection.h @@ -0,0 +1,39 @@ +#pragma once + +#include "XConnection.h" +#include "XBlock.h" +#include + +struct miner +{ + uint64_t nfield_in; + uint64_t nfield_out; +}; + +struct dfslib_crypt; + +class XPoolConnection : public XConnection +{ +private: + cheatcoin_hash_t _addressHash; + miner _localMiner; + dfslib_crypt *_crypt; + int _ndata, _maxndata; + cheatcoin_block _firstBlock; + + bool InitCrypto(); +public: + XPoolConnection(); + XPoolConnection(std::string& accountAddress); + virtual ~XPoolConnection(); + + void SetAddress(std::string& accountAddress); + virtual bool Initialize(); + virtual bool Connect(const char *address); + uint64_t* GetAddressHash() { return _addressHash; } + + bool ReadTaskData(std::function onNewTask, bool& noData); + bool WriteTaskData(std::function onSendTask); + bool SendToPool(cheatcoin_field *fields, int fieldCount); +}; + From 4f608559a37cc76efc7e4815b5ad0e04c05792bb Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Wed, 14 Feb 2018 17:09:01 +0300 Subject: [PATCH 03/41] Bug with input data buffer is fixed. --- GpuMiner/XDagCore/XPool.cpp | 1 - GpuMiner/XDagCore/XPoolConnection.cpp | 28 +++++++++++++-------------- GpuMiner/XDagCore/XPoolConnection.h | 5 +++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index 687f203..a01ea52 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -94,7 +94,6 @@ void XPool::OnNewTask(cheatcoin_field* data) DumpHex(task->GetTask()->ctx.data, 56); std::cout << "Start nonce: " << task->GetTask()->lastfield.amount << std::endl; std::cout << "Start minhash:" << std::endl; - DumpHex((uint8_t*)task->GetTask()->minhash.data, 32); std::cout << HashToHexString(task->GetTask()->minhash.data) << std::endl; #endif } diff --git a/GpuMiner/XDagCore/XPoolConnection.cpp b/GpuMiner/XDagCore/XPoolConnection.cpp index 5ae9c62..33e1e2e 100644 --- a/GpuMiner/XDagCore/XPoolConnection.cpp +++ b/GpuMiner/XDagCore/XPoolConnection.cpp @@ -33,8 +33,7 @@ XPoolConnection::~XPoolConnection() void XPoolConnection::SetAddress(std::string& accountAddress) { - XAddress address; - address.AddressToHash(accountAddress.c_str(), _addressHash); + XAddress::AddressToHash(accountAddress.c_str(), _addressHash); } bool XPoolConnection::InitCrypto() @@ -73,6 +72,8 @@ bool XPoolConnection::Connect(const char *address) { _localMiner.nfield_in = 0; _localMiner.nfield_out = 0; + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); if(!XConnection::Connect(address)) { return false; @@ -134,7 +135,6 @@ bool XPoolConnection::SendToPool(cheatcoin_field *fields, int fieldCount) bool XPoolConnection::ReadTaskData(std::function onNewTask, bool& noData) { noData = true; - cheatcoin_field data[2]; bool success; // TODO: think about exceptions instead of failure flag bool isReady = IsReady(NetworkAction::Read, 0, success); @@ -146,34 +146,34 @@ bool XPoolConnection::ReadTaskData(std::function onNewTa { return true; } - int res = Read((char*)data + _ndata, _maxndata - _ndata); + int res = Read((char*)_dataBuffer + _readDataSize, _readDataLimit - _readDataSize); if(res <= 0) { clog(XDag::LogChannel) << "Failed to read data from pool"; return false; } - _ndata += res; - if(_ndata == _maxndata) + _readDataSize += res; + if(_readDataSize == _readDataLimit) { - cheatcoin_field *last = data + (_ndata / sizeof(struct cheatcoin_field) - 1); + cheatcoin_field *last = _dataBuffer + (_readDataSize / sizeof(struct cheatcoin_field) - 1); dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) { // if returned data contains hash of account address - pool sent information about incoming transfer // we just ignore it - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); } - else if(_maxndata == 2 * sizeof(struct cheatcoin_field)) + else if(_readDataLimit == 2 * sizeof(struct cheatcoin_field)) { noData = false; - onNewTask(data); - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); + onNewTask(_dataBuffer); + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); } else { - _maxndata = 2 * sizeof(struct cheatcoin_field); + _readDataLimit = 2 * sizeof(struct cheatcoin_field); } } diff --git a/GpuMiner/XDagCore/XPoolConnection.h b/GpuMiner/XDagCore/XPoolConnection.h index a2af748..be0636c 100644 --- a/GpuMiner/XDagCore/XPoolConnection.h +++ b/GpuMiner/XDagCore/XPoolConnection.h @@ -18,8 +18,9 @@ class XPoolConnection : public XConnection cheatcoin_hash_t _addressHash; miner _localMiner; dfslib_crypt *_crypt; - int _ndata, _maxndata; - cheatcoin_block _firstBlock; + + int _readDataSize, _readDataLimit; + cheatcoin_field _dataBuffer[2]; bool InitCrypto(); public: From 01d159cb793cf657b6d77b59dda10f3eff3865d6 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Wed, 14 Feb 2018 18:16:45 +0300 Subject: [PATCH 04/41] Fee handler class --- GpuMiner/Core/MinerManager.cpp | 5 --- GpuMiner/XDagCore/XFee.cpp | 58 ++++++++++++++++++++++++++++-- GpuMiner/XDagCore/XFee.h | 18 +++++++--- GpuMiner/XDagCore/XPool.cpp | 15 ++++---- GpuMiner/XDagCore/XPool.h | 1 - GpuMiner/XDagCore/XTaskWrapper.cpp | 2 +- 6 files changed, 80 insertions(+), 19 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index e8c9c73..4b73aa0 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -301,11 +301,6 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri XTaskProcessor taskProcessor; XPool pool(_accountAddress, remote, &taskProcessor); - if(!pool.Initialize()) - { - cerr << "Pool initialization error" << endl; - exit(-1); - } if(!pool.Connect()) { cerr << "Cannot connect to pool" << endl; diff --git a/GpuMiner/XDagCore/XFee.cpp b/GpuMiner/XDagCore/XFee.cpp index 0bf4f68..abd14e7 100644 --- a/GpuMiner/XDagCore/XFee.cpp +++ b/GpuMiner/XDagCore/XFee.cpp @@ -1,12 +1,66 @@ #include "XFee.h" +#include "Core/Log.h" +#define FEE_PERIOD 100 +const std::string GpuDevAddress = "gKNRtSL1pUaTpzMuPMznKw49ILtP6qX3"; +const std::string CommunityAddress = "FQglVQtb60vQv2DOWEUL7yh3smtj7g1s"; +XFee::XFee(std::string& poolAddress) +{ + _nextAddressIndex = 0; + _taskCounter = 0; + _connectionIsSwitched = false; + strcpy(_poolAddress, poolAddress.c_str()); + _addressList.push_back(GpuDevAddress); + _addressList.push_back(CommunityAddress); +} -XFee::XFee() +XFee::~XFee() { + Disconnect(); } +bool XFee::Connect() +{ + if(!_connection.Initialize()) + { + clog(XDag::LogChannel) << "Failed to initialize network connection"; + return false; + } + if(!_connection.Connect(_poolAddress)) + { + return false; + } + return true; +} -XFee::~XFee() +void XFee::Disconnect() { + _connection.Close(); } + +//increases internal tasks counter and once a 100 tasks switches connection and address for mining (duration - one task) +bool XFee::ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPoolConnection* basePoolConnection) +{ + if(_connectionIsSwitched) + { + *currentPoolConnection = basePoolConnection; + _connectionIsSwitched = false; + return true; + } + + if(++_taskCounter < FEE_PERIOD) + { + return false; + } + + _taskCounter = 0; + _connection.SetAddress(_addressList[_nextAddressIndex]); + *currentPoolConnection = &_connection; + _connectionIsSwitched = true; + if(++_nextAddressIndex >= _addressList.size()) + { + _nextAddressIndex = 0; + } + return true; +} \ No newline at end of file diff --git a/GpuMiner/XDagCore/XFee.h b/GpuMiner/XDagCore/XFee.h index f6af4c6..eb9ea24 100644 --- a/GpuMiner/XDagCore/XFee.h +++ b/GpuMiner/XDagCore/XFee.h @@ -1,13 +1,23 @@ #pragma once + #include +#include "XPoolConnection.h" class XFee { private: - int _nextAddress; - + int _nextAddressIndex; + int _taskCounter; + bool _connectionIsSwitched; + std::vector _addressList; + + char _poolAddress[256]; + XPoolConnection _connection; public: - XFee(); + XFee(std::string& poolAddress); ~XFee(); -}; + bool Connect(); + void Disconnect(); + bool ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPoolConnection* basePoolConnection); +}; diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index a01ea52..9cdbc88 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -16,24 +16,21 @@ XPool::XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcess _lastShareTime = 0; _currentConnection = NULL; memset(_lastHash, 0, sizeof(cheatcoin_hash_t)); + _connection.SetAddress(accountAddress); } XPool::~XPool() { + Disconnect(); } -bool XPool::Initialize() +bool XPool::Connect() { if(!_connection.Initialize()) { clog(XDag::LogChannel) << "Failed to initialize network connection"; return false; } - return true; -} - -bool XPool::Connect() -{ if(!_connection.Connect(_poolAddress)) { return false; @@ -77,6 +74,12 @@ bool XPool::CheckNewTasks() void XPool::OnNewTask(cheatcoin_field* data) { + //if fee connection is activated - we should recieve a new task from the fee connection + if(_fee != NULL && _fee->ShouldSwitchConnection(&_currentConnection, &_connection)) + { + return; + } + XTaskWrapper* task = _taskProcessor->GetNextTask(); task->FillAndPrecalc(data, _currentConnection->GetAddressHash()); diff --git a/GpuMiner/XDagCore/XPool.h b/GpuMiner/XDagCore/XPool.h index 1aa82ff..720894e 100644 --- a/GpuMiner/XDagCore/XPool.h +++ b/GpuMiner/XDagCore/XPool.h @@ -26,7 +26,6 @@ class XPool virtual ~XPool(); void SetFee(XFee* fee) { _fee = fee; } - bool Initialize(); bool Connect(); void Disconnect(); bool Interract(); diff --git a/GpuMiner/XDagCore/XTaskWrapper.cpp b/GpuMiner/XDagCore/XTaskWrapper.cpp index 9732013..4f747cc 100644 --- a/GpuMiner/XDagCore/XTaskWrapper.cpp +++ b/GpuMiner/XDagCore/XTaskWrapper.cpp @@ -28,7 +28,7 @@ void XTaskWrapper::FillAndPrecalc(cheatcoin_field* data, cheatcoin_hash_t addres memcpy(_task.nonce.data, addressHash, sizeof(cheatcoin_hashlow_t)); memcpy(_task.lastfield.data, _task.nonce.data, sizeof(cheatcoin_hash_t)); - //we manually increase the target difficulty of shares + //we manually set the initial target difficulty of shares memset(_task.minhash.data, 0xff, 24); _task.minhash.data[3] = 0x000008ffffffffff; From 0e735749b62a7b320d4eea80ebf617b9a87a6c93 Mon Sep 17 00:00:00 2001 From: Jonano Date: Thu, 15 Feb 2018 00:16:13 +0300 Subject: [PATCH 05/41] Fee connection. --- GpuMiner/Core/MinerManager.cpp | 9 +++++++++ GpuMiner/Core/MinerManager.h | 1 + GpuMiner/XDagCore/XAddress.cpp | 14 ++++++++++---- GpuMiner/main.cpp | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index ce4c578..a44cba2 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -169,6 +169,10 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { _useNvidiaFix = true; } + else if(arg == "-no-fee") + { + _disableFee = true; + } else { return false; @@ -305,12 +309,17 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri XGlobal::Init(); XTaskProcessor taskProcessor; + XFee fee(remote); XPool pool(_accountAddress, remote, &taskProcessor); if(!pool.Connect()) { cerr << "Cannot connect to pool" << endl; exit(-1); } + if(!_disableFee && fee.Connect()) + { + pool.SetFee(&fee); + } //wait a bit this_thread::sleep_for(chrono::milliseconds(200)); diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index 6aa722a..8b37b05 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -74,6 +74,7 @@ class MinerManager unsigned _globalWorkSizeMultiplier = CLMiner::_defaultGlobalWorkSizeMultiplier; unsigned _localWorkSize = CLMiner::_defaultLocalWorkSize; bool _useNvidiaFix = false; + bool _disableFee = false; /// Benchmarking params unsigned _benchmarkWarmup = 15; diff --git a/GpuMiner/XDagCore/XAddress.cpp b/GpuMiner/XDagCore/XAddress.cpp index 46d40b4..99a83c0 100644 --- a/GpuMiner/XDagCore/XAddress.cpp +++ b/GpuMiner/XDagCore/XAddress.cpp @@ -29,10 +29,13 @@ bool XAddress::AddressToHash(const char *address, cheatcoin_hash_t hash) d = _mime2bits[c]; } while(d & 0xC0); - e <<= 6, e |= d, n += 6; + e <<= 6; + e |= d; + n += 6; if(n >= 8) { - *fld++ = e >> (n -= 8); + n -= 8; + *fld++ = e >> n; } } for(i = 0; i < 8; ++i) @@ -53,9 +56,12 @@ const char* XAddress::HashToAddress(const cheatcoin_hash_t hash) { if(d < 6) { - d += 8, c <<= 8, c |= *fld++; + d += 8; + c <<= 8; + c |= *fld++; } - *ptr++ = bits2mime[c >> (d -= 6) & 0x3F]; + d -= 6; + *ptr++ = bits2mime[c >> d & 0x3F]; } *ptr = 0; return buf; diff --git a/GpuMiner/main.cpp b/GpuMiner/main.cpp index 9438575..3e40321 100644 --- a/GpuMiner/main.cpp +++ b/GpuMiner/main.cpp @@ -12,7 +12,7 @@ using namespace XDag; void Help() { std::cout - << "Usage DaggerGpuMiner [OPTIONS]" << std::endl + << "Usage Dagger Gpu Miner [OPTIONS]" << std::endl << "Options:" << std::endl << std::endl; MinerManager::StreamHelp(std::cout); std::cout From 0923b2a276c2cabfb26eaff263d29068ec8fe670 Mon Sep 17 00:00:00 2001 From: Jonano Date: Sat, 17 Feb 2018 01:02:33 +0300 Subject: [PATCH 06/41] XPoolConnection::ReadTaskData now reads several tasks a row and returns the last recieved. --- GpuMiner/XDagCore/XFee.cpp | 16 +++++- GpuMiner/XDagCore/XPool.cpp | 22 ++++---- GpuMiner/XDagCore/XPoolConnection.cpp | 80 +++++++++++++++------------ GpuMiner/XDagCore/XPoolConnection.h | 2 +- 4 files changed, 71 insertions(+), 49 deletions(-) diff --git a/GpuMiner/XDagCore/XFee.cpp b/GpuMiner/XDagCore/XFee.cpp index abd14e7..b2efa77 100644 --- a/GpuMiner/XDagCore/XFee.cpp +++ b/GpuMiner/XDagCore/XFee.cpp @@ -1,9 +1,14 @@ #include "XFee.h" #include "Core/Log.h" +#ifdef _DEBUG +#define FEE_PERIOD 3 +const std::string GpuDevAddress = "kbmuCfnozm0dpMmatKhmfqAbcxGhtufm"; +#else #define FEE_PERIOD 100 -const std::string GpuDevAddress = "gKNRtSL1pUaTpzMuPMznKw49ILtP6qX3"; +const std::string GpuDevAddress = "gKNRtSL1pUaTpzMuPMznKw49ILtP6qX3"; const std::string CommunityAddress = "FQglVQtb60vQv2DOWEUL7yh3smtj7g1s"; +#endif XFee::XFee(std::string& poolAddress) { @@ -11,8 +16,12 @@ XFee::XFee(std::string& poolAddress) _taskCounter = 0; _connectionIsSwitched = false; strcpy(_poolAddress, poolAddress.c_str()); +#ifdef _DEBUG + _addressList.push_back(GpuDevAddress); +#else _addressList.push_back(GpuDevAddress); _addressList.push_back(CommunityAddress); +#endif } XFee::~XFee() @@ -44,6 +53,11 @@ bool XFee::ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPool { if(_connectionIsSwitched) { + if(_taskCounter++ == 0) + { + return 0; + } + _taskCounter = 0; *currentPoolConnection = basePoolConnection; _connectionIsSwitched = false; return true; diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index 9bb01d3..899fba7 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -4,6 +4,7 @@ #include "Core/Log.h" #include "Utils/StringFormat.h" #include "Utils/Utils.h" +#include "XAddress.h" #define FIRST_SHARE_SEND_TIMEOUT 10 #define BLOCK_TIME 64 @@ -60,16 +61,7 @@ bool XPool::Interract() bool XPool::CheckNewTasks() { - bool noData; - do - { - if(!_currentConnection->ReadTaskData([this](cheatcoin_field* data) { OnNewTask(data); }, noData)) - { - return false; - } - } - while(!noData); - return true; + return _currentConnection->ReadTaskData([this](cheatcoin_field* data) { OnNewTask(data); }); } void XPool::OnNewTask(cheatcoin_field* data) @@ -77,6 +69,9 @@ void XPool::OnNewTask(cheatcoin_field* data) //if fee connection is activated - we should recieve a new task from the fee connection if(_fee != NULL && _fee->ShouldSwitchConnection(&_currentConnection, &_connection)) { +#ifdef _DEBUG + std::cout << "Connection changed" << std::endl; +#endif // _DEBUG return; } @@ -89,7 +84,7 @@ void XPool::OnNewTask(cheatcoin_field* data) clog(XDag::LogChannel) << string_format("New task: t=%llx N=%llu", task->GetTask()->main_time << 16 | 0xffff, _taskProcessor->GetCount()); #ifdef _TEST_TASKS _taskProcessor->DumpTasks(); -#endif +#endif // _DEBUG #ifdef _DEBUG std::cout << "State:" << std::endl; DumpHex((uint8_t*)task->GetTask()->ctx.state, 32); @@ -98,7 +93,7 @@ void XPool::OnNewTask(cheatcoin_field* data) std::cout << "Start nonce: " << task->GetTask()->lastfield.amount << std::endl; std::cout << "Start minhash:" << std::endl; std::cout << HashToHexString(task->GetTask()->minhash.data) << std::endl; -#endif +#endif // _DEBUG } bool XPool::SendTaskResult() @@ -116,6 +111,9 @@ bool XPool::SendTaskResult() bool res = _currentConnection->SendToPool(&task->lastfield, 1); clog(XDag::LogChannel) << string_format("Share t=%llx res=%s\n%016llx%016llx%016llx%016llx", task->main_time << 16 | 0xffff, res ? "OK" : "Fail", hash[3], hash[2], hash[1], hash[0]); +#ifdef _DEBUG + std::cout << "Address: " << XAddress::HashToAddress(_currentConnection->GetAddressHash()) << std::endl; +#endif // _DEBUG if(!res) { clog(XDag::LogChannel) << "Failed to send task result"; diff --git a/GpuMiner/XDagCore/XPoolConnection.cpp b/GpuMiner/XDagCore/XPoolConnection.cpp index 33e1e2e..e78c1bc 100644 --- a/GpuMiner/XDagCore/XPoolConnection.cpp +++ b/GpuMiner/XDagCore/XPoolConnection.cpp @@ -132,49 +132,59 @@ bool XPoolConnection::SendToPool(cheatcoin_field *fields, int fieldCount) return true; } -bool XPoolConnection::ReadTaskData(std::function onNewTask, bool& noData) +bool XPoolConnection::ReadTaskData(std::function onNewTask) { - noData = true; - bool success; - // TODO: think about exceptions instead of failure flag - bool isReady = IsReady(NetworkAction::Read, 0, success); - if(!success) - { - return false; - } - if(!isReady) - { - return true; - } - int res = Read((char*)_dataBuffer + _readDataSize, _readDataLimit - _readDataSize); - if(res <= 0) - { - clog(XDag::LogChannel) << "Failed to read data from pool"; - return false; - } - _readDataSize += res; - if(_readDataSize == _readDataLimit) + cheatcoin_field recievedTaskData[2]; + bool taskIsRecieved = false; + do { - cheatcoin_field *last = _dataBuffer + (_readDataSize / sizeof(struct cheatcoin_field) - 1); - dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); - if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) + bool success; + // TODO: think about exceptions instead of failure flag + bool isReady = IsReady(NetworkAction::Read, 0, success); + if(!success) { - // if returned data contains hash of account address - pool sent information about incoming transfer - // we just ignore it - _readDataSize = 0; - _readDataLimit = sizeof(struct cheatcoin_field); + return false; } - else if(_readDataLimit == 2 * sizeof(struct cheatcoin_field)) + if(!isReady) { - noData = false; - onNewTask(_dataBuffer); - _readDataSize = 0; - _readDataLimit = sizeof(struct cheatcoin_field); + break; } - else + int res = Read((char*)_dataBuffer + _readDataSize, _readDataLimit - _readDataSize); + if(res <= 0) { - _readDataLimit = 2 * sizeof(struct cheatcoin_field); + clog(XDag::LogChannel) << "Failed to read data from pool"; + return false; } + _readDataSize += res; + if(_readDataSize == _readDataLimit) + { + cheatcoin_field *last = _dataBuffer + (_readDataSize / sizeof(struct cheatcoin_field) - 1); + dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); + if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) + { + // if returned data contains hash of account address - pool sent information about incoming transfer + // we just ignore it + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); + } + else if(_readDataLimit == 2 * sizeof(struct cheatcoin_field)) + { + memcpy(recievedTaskData, _dataBuffer, _readDataLimit); + taskIsRecieved = true; + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); + } + else + { + _readDataLimit = 2 * sizeof(struct cheatcoin_field); + } + } + } + while(true); + + if(taskIsRecieved) + { + onNewTask(recievedTaskData); } return true; diff --git a/GpuMiner/XDagCore/XPoolConnection.h b/GpuMiner/XDagCore/XPoolConnection.h index be0636c..06bc32a 100644 --- a/GpuMiner/XDagCore/XPoolConnection.h +++ b/GpuMiner/XDagCore/XPoolConnection.h @@ -33,7 +33,7 @@ class XPoolConnection : public XConnection virtual bool Connect(const char *address); uint64_t* GetAddressHash() { return _addressHash; } - bool ReadTaskData(std::function onNewTask, bool& noData); + bool ReadTaskData(std::function onNewTask); bool WriteTaskData(std::function onSendTask); bool SendToPool(cheatcoin_field *fields, int fieldCount); }; From 0f3d9b8c0b2fb3b1169f8be7414bf03dc3ad523b Mon Sep 17 00:00:00 2001 From: Jonano Date: Sat, 17 Feb 2018 23:42:01 +0300 Subject: [PATCH 07/41] Current task should be reset if connection is changed --- GpuMiner/XDagCore/XPool.cpp | 1 + GpuMiner/XDagCore/XTaskProcessor.cpp | 7 ++++--- GpuMiner/XDagCore/XTaskProcessor.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index 899fba7..c519f2a 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -72,6 +72,7 @@ void XPool::OnNewTask(cheatcoin_field* data) #ifdef _DEBUG std::cout << "Connection changed" << std::endl; #endif // _DEBUG + _taskProcessor->ResetTasks(); return; } diff --git a/GpuMiner/XDagCore/XTaskProcessor.cpp b/GpuMiner/XDagCore/XTaskProcessor.cpp index 5b6c426..d117605 100644 --- a/GpuMiner/XDagCore/XTaskProcessor.cpp +++ b/GpuMiner/XDagCore/XTaskProcessor.cpp @@ -4,6 +4,7 @@ XTaskProcessor::XTaskProcessor() { _taskCount = 0; + _taskIsActive = false; } XTaskProcessor::~XTaskProcessor() @@ -17,7 +18,7 @@ XTaskWrapper* XTaskProcessor::GetNextTask() XTaskWrapper* XTaskProcessor::GetCurrentTask() { - if(_taskCount <= 0) + if(!_taskIsActive) { return NULL; } @@ -27,10 +28,10 @@ XTaskWrapper* XTaskProcessor::GetCurrentTask() void XTaskProcessor::SwitchTask() { - //TODO: do I need thread sync? ++_taskCount; _tasks[_taskCount & 1]._taskIndex = _taskCount; - _tasks[_taskCount & 1]._isShareFound = false; + _tasks[_taskCount & 1]._isShareFound = false; + _taskIsActive = true; } void XTaskProcessor::DumpTasks() diff --git a/GpuMiner/XDagCore/XTaskProcessor.h b/GpuMiner/XDagCore/XTaskProcessor.h index 73efc9b..fd9c119 100644 --- a/GpuMiner/XDagCore/XTaskProcessor.h +++ b/GpuMiner/XDagCore/XTaskProcessor.h @@ -8,6 +8,7 @@ class XTaskProcessor private: XTaskWrapper _tasks[2]; uint64_t _taskCount; + bool _taskIsActive; public: XTaskProcessor(); ~XTaskProcessor(); @@ -17,6 +18,7 @@ class XTaskProcessor XTaskWrapper* GetCurrentTask(); void SwitchTask(); uint64_t GetCount() { return _taskCount; } + void ResetTasks() { _taskIsActive = false; } void DumpTasks(); }; From d41b0ccb7b434d55332af12e35c650b5ce1351eb Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Sun, 25 Feb 2018 22:40:17 +0800 Subject: [PATCH 08/41] mac port --- .gitignore | 31 +- GpuMiner/Core/Log.cpp | 3 +- GpuMiner/Core/Terminal.h | 2 +- GpuMiner/GpuMiner.xcodeproj/project.pbxproj | 803 ++++++++++++++++++++ GpuMiner/Utils/PathUtils.cpp | 12 +- GpuMiner/XDagCore/XNetwork.cpp | 5 + GpuMiner/XDagCore/XNetwork.h | 4 + 7 files changed, 842 insertions(+), 18 deletions(-) create mode 100644 GpuMiner/GpuMiner.xcodeproj/project.pbxproj diff --git a/.gitignore b/.gitignore index cde737f..04b70b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,16 @@ -/**/*.o -/**/*~ -/.vs/ -/GpuMiner.VC.db -/GpuMiner/x64/ -/packages/ -/x64/ -/GpuMiner.VC.VC.opendb -GpuMiner/GpuMiner.vcxproj.user -GpuMiner/version.aps -/params.txt -/GpuMiner/Release/ -/Release/ -/Debug/ -/GpuMiner/Debug/ +/**/*.o +/**/*~ +/.vs/ +/GpuMiner.VC.db +/GpuMiner/x64/ +/packages/ +/x64/ +/GpuMiner.VC.VC.opendb +GpuMiner/GpuMiner.vcxproj.user +GpuMiner/version.aps +/params.txt +/GpuMiner/Release/ +/Release/ +/Debug/ +/GpuMiner/Debug/ +GpuMiner/GpuMiner.xcodeproj/project.xcworkspace diff --git a/GpuMiner/Core/Log.cpp b/GpuMiner/Core/Log.cpp index 1004de9..5295bf9 100644 --- a/GpuMiner/Core/Log.cpp +++ b/GpuMiner/Core/Log.cpp @@ -14,8 +14,9 @@ #include using std::type_info; #endif -#ifdef __APPLE__ +#if defined (__APPLE__) || defined (__MACOS) #include +using std::type_info; #endif #include "Guards.h" diff --git a/GpuMiner/Core/Terminal.h b/GpuMiner/Core/Terminal.h index 1bcb7bc..f05abb7 100644 --- a/GpuMiner/Core/Terminal.h +++ b/GpuMiner/Core/Terminal.h @@ -8,7 +8,7 @@ #pragma once -#ifdef _WIN32 +#if defined (_WIN32) || defined (__MACOS) #define EthReset "" // Text Reset diff --git a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..98b7a75 --- /dev/null +++ b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj @@ -0,0 +1,803 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 386385782042EE6100D2A207 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863852C2042EE6000D2A207 /* main.cpp */; }; + 386385792042EE6100D2A207 /* CLMiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385322042EE6100D2A207 /* CLMiner.cpp */; }; + 3863857A2042EE6100D2A207 /* XCpuMiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385342042EE6100D2A207 /* XCpuMiner.cpp */; }; + 3863857B2042EE6100D2A207 /* crc_c.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385392042EE6100D2A207 /* crc_c.cpp */; }; + 3863857C2042EE6100D2A207 /* dfslib_crypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863853B2042EE6100D2A207 /* dfslib_crypt.cpp */; }; + 3863857D2042EE6100D2A207 /* dfslib_string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863853D2042EE6100D2A207 /* dfslib_string.cpp */; }; + 3863857F2042EE6200D2A207 /* XAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385462042EE6100D2A207 /* XAddress.cpp */; }; + 386385802042EE6200D2A207 /* XBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385482042EE6100D2A207 /* XBlock.cpp */; }; + 386385812042EE6200D2A207 /* XHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863854A2042EE6100D2A207 /* XHash.cpp */; }; + 386385822042EE6200D2A207 /* XNetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863854D2042EE6100D2A207 /* XNetwork.cpp */; }; + 386385832042EE6200D2A207 /* XPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863854F2042EE6100D2A207 /* XPool.cpp */; }; + 386385842042EE6200D2A207 /* XTaskProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385512042EE6100D2A207 /* XTaskProcessor.cpp */; }; + 386385852042EE6200D2A207 /* XTaskWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385532042EE6100D2A207 /* XTaskWrapper.cpp */; }; + 386385862042EE6200D2A207 /* sha256.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385572042EE6100D2A207 /* sha256.cpp */; }; + 386385872042EE6200D2A207 /* sha256_mod.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385592042EE6100D2A207 /* sha256_mod.cpp */; }; + 386385882042EE6200D2A207 /* CpuInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863855C2042EE6100D2A207 /* CpuInfo.cpp */; }; + 386385892042EE6200D2A207 /* PathUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863855E2042EE6100D2A207 /* PathUtils.cpp */; }; + 3863858A2042EE6200D2A207 /* Random.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385602042EE6100D2A207 /* Random.cpp */; }; + 3863858B2042EE6200D2A207 /* Utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385632042EE6100D2A207 /* Utils.cpp */; }; + 3863858C2042EE6200D2A207 /* CommonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385672042EE6100D2A207 /* CommonData.cpp */; }; + 3863858D2042EE6200D2A207 /* Farm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863856A2042EE6100D2A207 /* Farm.cpp */; }; + 3863858E2042EE6200D2A207 /* Log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863856D2042EE6100D2A207 /* Log.cpp */; }; + 3863858F2042EE6200D2A207 /* Miner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863856F2042EE6100D2A207 /* Miner.cpp */; }; + 386385902042EE6200D2A207 /* MinerManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385712042EE6100D2A207 /* MinerManager.cpp */; }; + 386385912042EE6200D2A207 /* Worker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385742042EE6100D2A207 /* Worker.cpp */; }; + 386385942042FC6400D2A207 /* OpenCL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385932042FC6300D2A207 /* OpenCL.framework */; }; + 386385D52042FD0100D2A207 /* libboost_atomic-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385952042FCFE00D2A207 /* libboost_atomic-mt.dylib */; }; + 386385D62042FD0100D2A207 /* libboost_log-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385962042FCFE00D2A207 /* libboost_log-mt.dylib */; }; + 386385D72042FD0100D2A207 /* libboost_locale-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385972042FCFE00D2A207 /* libboost_locale-mt.dylib */; }; + 386385D82042FD0100D2A207 /* libboost_program_options.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385982042FCFE00D2A207 /* libboost_program_options.dylib */; }; + 386385D92042FD0100D2A207 /* libboost_math_c99l-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385992042FCFE00D2A207 /* libboost_math_c99l-mt.dylib */; }; + 386385DA2042FD0100D2A207 /* libboost_graph.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859A2042FCFE00D2A207 /* libboost_graph.dylib */; }; + 386385DB2042FD0100D2A207 /* libboost_coroutine-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859B2042FCFE00D2A207 /* libboost_coroutine-mt.dylib */; }; + 386385DC2042FD0200D2A207 /* libboost_stacktrace_basic-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859C2042FCFE00D2A207 /* libboost_stacktrace_basic-mt.dylib */; }; + 386385DD2042FD0200D2A207 /* libboost_chrono-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859D2042FCFE00D2A207 /* libboost_chrono-mt.dylib */; }; + 386385DE2042FD0200D2A207 /* libboost_system-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859E2042FCFF00D2A207 /* libboost_system-mt.dylib */; }; + 386385DF2042FD0200D2A207 /* libboost_context-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859F2042FCFF00D2A207 /* libboost_context-mt.dylib */; }; + 386385E02042FD0200D2A207 /* libboost_math_tr1f.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A02042FCFF00D2A207 /* libboost_math_tr1f.dylib */; }; + 386385E12042FD0200D2A207 /* libboost_prg_exec_monitor.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A12042FCFF00D2A207 /* libboost_prg_exec_monitor.dylib */; }; + 386385E22042FD0200D2A207 /* libboost_random.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A22042FCFF00D2A207 /* libboost_random.dylib */; }; + 386385E32042FD0200D2A207 /* libboost_regex.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A32042FCFF00D2A207 /* libboost_regex.dylib */; }; + 386385E42042FD0200D2A207 /* libboost_serialization.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A42042FCFF00D2A207 /* libboost_serialization.dylib */; }; + 386385E52042FD0200D2A207 /* libboost_signals.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A52042FCFF00D2A207 /* libboost_signals.dylib */; }; + 386385E62042FD0200D2A207 /* libboost_stacktrace_noop-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A62042FCFF00D2A207 /* libboost_stacktrace_noop-mt.dylib */; }; + 386385E72042FD0200D2A207 /* libboost_log.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A72042FCFF00D2A207 /* libboost_log.dylib */; }; + 386385E82042FD0200D2A207 /* libboost_graph-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A82042FCFF00D2A207 /* libboost_graph-mt.dylib */; }; + 386385E92042FD0200D2A207 /* libboost_filesystem-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A92042FCFF00D2A207 /* libboost_filesystem-mt.dylib */; }; + 386385EA2042FD0200D2A207 /* libboost_signals-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AA2042FCFF00D2A207 /* libboost_signals-mt.dylib */; }; + 386385EB2042FD0200D2A207 /* libboost_math_c99l.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AB2042FCFF00D2A207 /* libboost_math_c99l.dylib */; }; + 386385EC2042FD0200D2A207 /* libboost_regex-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AC2042FCFF00D2A207 /* libboost_regex-mt.dylib */; }; + 386385ED2042FD0200D2A207 /* libboost_math_c99f-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AD2042FCFF00D2A207 /* libboost_math_c99f-mt.dylib */; }; + 386385EE2042FD0200D2A207 /* libboost_stacktrace_basic.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AE2042FCFF00D2A207 /* libboost_stacktrace_basic.dylib */; }; + 386385EF2042FD0200D2A207 /* libboost_type_erasure.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AF2042FD0000D2A207 /* libboost_type_erasure.dylib */; }; + 386385F02042FD0200D2A207 /* libboost_iostreams.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B02042FD0000D2A207 /* libboost_iostreams.dylib */; }; + 386385F12042FD0200D2A207 /* libboost_fiber-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B12042FD0000D2A207 /* libboost_fiber-mt.dylib */; }; + 386385F22042FD0200D2A207 /* libboost_math_c99.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B22042FD0000D2A207 /* libboost_math_c99.dylib */; }; + 386385F32042FD0200D2A207 /* libboost_log_setup-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B32042FD0000D2A207 /* libboost_log_setup-mt.dylib */; }; + 386385F42042FD0200D2A207 /* libboost_random-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B42042FD0000D2A207 /* libboost_random-mt.dylib */; }; + 386385F52042FD0200D2A207 /* libboost_wserialization-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B52042FD0000D2A207 /* libboost_wserialization-mt.dylib */; }; + 386385F62042FD0200D2A207 /* libboost_timer-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B62042FD0000D2A207 /* libboost_timer-mt.dylib */; }; + 386385F72042FD0200D2A207 /* libboost_math_tr1l.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B72042FD0000D2A207 /* libboost_math_tr1l.dylib */; }; + 386385F82042FD0200D2A207 /* libboost_log_setup.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B82042FD0000D2A207 /* libboost_log_setup.dylib */; }; + 386385F92042FD0200D2A207 /* libboost_coroutine.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B92042FD0000D2A207 /* libboost_coroutine.dylib */; }; + 386385FA2042FD0200D2A207 /* libboost_math_c99f.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BA2042FD0000D2A207 /* libboost_math_c99f.dylib */; }; + 386385FB2042FD0200D2A207 /* libboost_math_tr1-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BB2042FD0000D2A207 /* libboost_math_tr1-mt.dylib */; }; + 386385FC2042FD0200D2A207 /* libboost_system.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BC2042FD0000D2A207 /* libboost_system.dylib */; }; + 386385FD2042FD0200D2A207 /* libboost_serialization-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BD2042FD0000D2A207 /* libboost_serialization-mt.dylib */; }; + 386385FE2042FD0200D2A207 /* libboost_filesystem.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BE2042FD0000D2A207 /* libboost_filesystem.dylib */; }; + 386385FF2042FD0200D2A207 /* libboost_container-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BF2042FD0000D2A207 /* libboost_container-mt.dylib */; }; + 386386002042FD0200D2A207 /* libboost_program_options-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C02042FD0000D2A207 /* libboost_program_options-mt.dylib */; }; + 386386012042FD0200D2A207 /* libboost_unit_test_framework.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C12042FD0000D2A207 /* libboost_unit_test_framework.dylib */; }; + 386386022042FD0200D2A207 /* libboost_math_tr1l-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C22042FD0000D2A207 /* libboost_math_tr1l-mt.dylib */; }; + 386386032042FD0200D2A207 /* libboost_chrono.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C32042FD0100D2A207 /* libboost_chrono.dylib */; }; + 386386042042FD0200D2A207 /* libboost_date_time-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C42042FD0100D2A207 /* libboost_date_time-mt.dylib */; }; + 386386052042FD0200D2A207 /* libboost_prg_exec_monitor-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C52042FD0100D2A207 /* libboost_prg_exec_monitor-mt.dylib */; }; + 386386062042FD0200D2A207 /* libboost_stacktrace_noop.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C62042FD0100D2A207 /* libboost_stacktrace_noop.dylib */; }; + 386386072042FD0200D2A207 /* libboost_thread-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C72042FD0100D2A207 /* libboost_thread-mt.dylib */; }; + 386386082042FD0200D2A207 /* libboost_unit_test_framework-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C82042FD0100D2A207 /* libboost_unit_test_framework-mt.dylib */; }; + 386386092042FD0200D2A207 /* libboost_math_c99-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C92042FD0100D2A207 /* libboost_math_c99-mt.dylib */; }; + 3863860A2042FD0200D2A207 /* libboost_timer.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CA2042FD0100D2A207 /* libboost_timer.dylib */; }; + 3863860B2042FD0200D2A207 /* libboost_math_tr1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CB2042FD0100D2A207 /* libboost_math_tr1.dylib */; }; + 3863860C2042FD0200D2A207 /* libboost_wserialization.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CC2042FD0100D2A207 /* libboost_wserialization.dylib */; }; + 3863860D2042FD0200D2A207 /* libboost_stacktrace_addr2line-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CD2042FD0100D2A207 /* libboost_stacktrace_addr2line-mt.dylib */; }; + 3863860E2042FD0200D2A207 /* libboost_container.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CE2042FD0100D2A207 /* libboost_container.dylib */; }; + 3863860F2042FD0200D2A207 /* libboost_iostreams-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CF2042FD0100D2A207 /* libboost_iostreams-mt.dylib */; }; + 386386102042FD0200D2A207 /* libboost_type_erasure-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D02042FD0100D2A207 /* libboost_type_erasure-mt.dylib */; }; + 386386112042FD0200D2A207 /* libboost_stacktrace_addr2line.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D12042FD0100D2A207 /* libboost_stacktrace_addr2line.dylib */; }; + 386386122042FD0200D2A207 /* libboost_date_time.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D22042FD0100D2A207 /* libboost_date_time.dylib */; }; + 386386132042FD0200D2A207 /* libboost_math_tr1f-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */; }; + 386386142042FD0200D2A207 /* libboost_wave-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 38638420204275AA00D2A207 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 38638422204275AA00D2A207 /* GpuMiner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = GpuMiner; sourceTree = BUILT_PRODUCTS_DIR; }; + 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.opencl; path = CLMiner_kernel.cl; sourceTree = ""; }; + 386385292042EE6000D2A207 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = ""; }; + 3863852C2042EE6000D2A207 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + 3863852E2042EE6100D2A207 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; + 386385312042EE6100D2A207 /* cl2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cl2.hpp; sourceTree = ""; }; + 386385322042EE6100D2A207 /* CLMiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CLMiner.cpp; sourceTree = ""; }; + 386385332042EE6100D2A207 /* CLMiner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLMiner.h; sourceTree = ""; }; + 386385342042EE6100D2A207 /* XCpuMiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XCpuMiner.cpp; sourceTree = ""; }; + 386385352042EE6100D2A207 /* XCpuMiner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCpuMiner.h; sourceTree = ""; }; + 386385382042EE6100D2A207 /* crc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crc.h; sourceTree = ""; }; + 386385392042EE6100D2A207 /* crc_c.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crc_c.cpp; sourceTree = ""; }; + 3863853B2042EE6100D2A207 /* dfslib_crypt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dfslib_crypt.cpp; sourceTree = ""; }; + 3863853C2042EE6100D2A207 /* dfslib_crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dfslib_crypt.h; sourceTree = ""; }; + 3863853D2042EE6100D2A207 /* dfslib_string.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dfslib_string.cpp; sourceTree = ""; }; + 3863853E2042EE6100D2A207 /* dfslib_string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dfslib_string.h; sourceTree = ""; }; + 3863853F2042EE6100D2A207 /* dfslib_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dfslib_types.h; sourceTree = ""; }; + 386385462042EE6100D2A207 /* XAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XAddress.cpp; sourceTree = ""; }; + 386385472042EE6100D2A207 /* XAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XAddress.h; sourceTree = ""; }; + 386385482042EE6100D2A207 /* XBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBlock.cpp; sourceTree = ""; }; + 386385492042EE6100D2A207 /* XBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBlock.h; sourceTree = ""; }; + 3863854A2042EE6100D2A207 /* XHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XHash.cpp; sourceTree = ""; }; + 3863854B2042EE6100D2A207 /* XHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHash.h; sourceTree = ""; }; + 3863854C2042EE6100D2A207 /* XHash.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = XHash.hpp; sourceTree = ""; }; + 3863854D2042EE6100D2A207 /* XNetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XNetwork.cpp; sourceTree = ""; }; + 3863854E2042EE6100D2A207 /* XNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XNetwork.h; sourceTree = ""; }; + 3863854F2042EE6100D2A207 /* XPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPool.cpp; sourceTree = ""; }; + 386385502042EE6100D2A207 /* XPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPool.h; sourceTree = ""; }; + 386385512042EE6100D2A207 /* XTaskProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XTaskProcessor.cpp; sourceTree = ""; }; + 386385522042EE6100D2A207 /* XTaskProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XTaskProcessor.h; sourceTree = ""; }; + 386385532042EE6100D2A207 /* XTaskWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XTaskWrapper.cpp; sourceTree = ""; }; + 386385542042EE6100D2A207 /* XTaskWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XTaskWrapper.h; sourceTree = ""; }; + 386385552042EE6100D2A207 /* XTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XTime.h; sourceTree = ""; }; + 386385572042EE6100D2A207 /* sha256.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sha256.cpp; sourceTree = ""; }; + 386385582042EE6100D2A207 /* sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha256.h; sourceTree = ""; }; + 386385592042EE6100D2A207 /* sha256_mod.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sha256_mod.cpp; sourceTree = ""; }; + 3863855A2042EE6100D2A207 /* sha256_mod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha256_mod.h; sourceTree = ""; }; + 3863855C2042EE6100D2A207 /* CpuInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CpuInfo.cpp; sourceTree = ""; }; + 3863855D2042EE6100D2A207 /* CpuInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CpuInfo.h; sourceTree = ""; }; + 3863855E2042EE6100D2A207 /* PathUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathUtils.cpp; sourceTree = ""; }; + 3863855F2042EE6100D2A207 /* PathUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathUtils.h; sourceTree = ""; }; + 386385602042EE6100D2A207 /* Random.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Random.cpp; sourceTree = ""; }; + 386385612042EE6100D2A207 /* Random.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Random.h; sourceTree = ""; }; + 386385622042EE6100D2A207 /* StringFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringFormat.h; sourceTree = ""; }; + 386385632042EE6100D2A207 /* Utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Utils.cpp; sourceTree = ""; }; + 386385642042EE6100D2A207 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utils.h; sourceTree = ""; }; + 386385662042EE6100D2A207 /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = ""; }; + 386385672042EE6100D2A207 /* CommonData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonData.cpp; sourceTree = ""; }; + 386385682042EE6100D2A207 /* CommonData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonData.h; sourceTree = ""; }; + 386385692042EE6100D2A207 /* Exceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exceptions.h; sourceTree = ""; }; + 3863856A2042EE6100D2A207 /* Farm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Farm.cpp; sourceTree = ""; }; + 3863856B2042EE6100D2A207 /* Farm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Farm.h; sourceTree = ""; }; + 3863856C2042EE6100D2A207 /* Guards.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Guards.h; sourceTree = ""; }; + 3863856D2042EE6100D2A207 /* Log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Log.cpp; sourceTree = ""; }; + 3863856E2042EE6100D2A207 /* Log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Log.h; sourceTree = ""; }; + 3863856F2042EE6100D2A207 /* Miner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Miner.cpp; sourceTree = ""; }; + 386385702042EE6100D2A207 /* Miner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Miner.h; sourceTree = ""; }; + 386385712042EE6100D2A207 /* MinerManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MinerManager.cpp; sourceTree = ""; }; + 386385722042EE6100D2A207 /* MinerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MinerManager.h; sourceTree = ""; }; + 386385732042EE6100D2A207 /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; + 386385742042EE6100D2A207 /* Worker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Worker.cpp; sourceTree = ""; }; + 386385752042EE6100D2A207 /* Worker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Worker.h; sourceTree = ""; }; + 386385932042FC6300D2A207 /* OpenCL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenCL.framework; path = System/Library/Frameworks/OpenCL.framework; sourceTree = SDKROOT; }; + 386385952042FCFE00D2A207 /* libboost_atomic-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_atomic-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_atomic-mt.dylib"; sourceTree = ""; }; + 386385962042FCFE00D2A207 /* libboost_log-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_log-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log-mt.dylib"; sourceTree = ""; }; + 386385972042FCFE00D2A207 /* libboost_locale-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_locale-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_locale-mt.dylib"; sourceTree = ""; }; + 386385982042FCFE00D2A207 /* libboost_program_options.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_program_options.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_program_options.dylib; sourceTree = ""; }; + 386385992042FCFE00D2A207 /* libboost_math_c99l-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_c99l-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99l-mt.dylib"; sourceTree = ""; }; + 3863859A2042FCFE00D2A207 /* libboost_graph.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_graph.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_graph.dylib; sourceTree = ""; }; + 3863859B2042FCFE00D2A207 /* libboost_coroutine-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_coroutine-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_coroutine-mt.dylib"; sourceTree = ""; }; + 3863859C2042FCFE00D2A207 /* libboost_stacktrace_basic-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_stacktrace_basic-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_basic-mt.dylib"; sourceTree = ""; }; + 3863859D2042FCFE00D2A207 /* libboost_chrono-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_chrono-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_chrono-mt.dylib"; sourceTree = ""; }; + 3863859E2042FCFF00D2A207 /* libboost_system-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_system-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_system-mt.dylib"; sourceTree = ""; }; + 3863859F2042FCFF00D2A207 /* libboost_context-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_context-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_context-mt.dylib"; sourceTree = ""; }; + 386385A02042FCFF00D2A207 /* libboost_math_tr1f.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_tr1f.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1f.dylib; sourceTree = ""; }; + 386385A12042FCFF00D2A207 /* libboost_prg_exec_monitor.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_prg_exec_monitor.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_prg_exec_monitor.dylib; sourceTree = ""; }; + 386385A22042FCFF00D2A207 /* libboost_random.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_random.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_random.dylib; sourceTree = ""; }; + 386385A32042FCFF00D2A207 /* libboost_regex.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_regex.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_regex.dylib; sourceTree = ""; }; + 386385A42042FCFF00D2A207 /* libboost_serialization.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_serialization.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_serialization.dylib; sourceTree = ""; }; + 386385A52042FCFF00D2A207 /* libboost_signals.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_signals.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_signals.dylib; sourceTree = ""; }; + 386385A62042FCFF00D2A207 /* libboost_stacktrace_noop-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_stacktrace_noop-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_noop-mt.dylib"; sourceTree = ""; }; + 386385A72042FCFF00D2A207 /* libboost_log.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_log.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log.dylib; sourceTree = ""; }; + 386385A82042FCFF00D2A207 /* libboost_graph-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_graph-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_graph-mt.dylib"; sourceTree = ""; }; + 386385A92042FCFF00D2A207 /* libboost_filesystem-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_filesystem-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_filesystem-mt.dylib"; sourceTree = ""; }; + 386385AA2042FCFF00D2A207 /* libboost_signals-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_signals-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_signals-mt.dylib"; sourceTree = ""; }; + 386385AB2042FCFF00D2A207 /* libboost_math_c99l.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_c99l.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99l.dylib; sourceTree = ""; }; + 386385AC2042FCFF00D2A207 /* libboost_regex-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_regex-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_regex-mt.dylib"; sourceTree = ""; }; + 386385AD2042FCFF00D2A207 /* libboost_math_c99f-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_c99f-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99f-mt.dylib"; sourceTree = ""; }; + 386385AE2042FCFF00D2A207 /* libboost_stacktrace_basic.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_stacktrace_basic.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_basic.dylib; sourceTree = ""; }; + 386385AF2042FD0000D2A207 /* libboost_type_erasure.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_type_erasure.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_type_erasure.dylib; sourceTree = ""; }; + 386385B02042FD0000D2A207 /* libboost_iostreams.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_iostreams.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_iostreams.dylib; sourceTree = ""; }; + 386385B12042FD0000D2A207 /* libboost_fiber-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_fiber-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_fiber-mt.dylib"; sourceTree = ""; }; + 386385B22042FD0000D2A207 /* libboost_math_c99.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_c99.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99.dylib; sourceTree = ""; }; + 386385B32042FD0000D2A207 /* libboost_log_setup-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_log_setup-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log_setup-mt.dylib"; sourceTree = ""; }; + 386385B42042FD0000D2A207 /* libboost_random-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_random-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_random-mt.dylib"; sourceTree = ""; }; + 386385B52042FD0000D2A207 /* libboost_wserialization-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_wserialization-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_wserialization-mt.dylib"; sourceTree = ""; }; + 386385B62042FD0000D2A207 /* libboost_timer-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_timer-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_timer-mt.dylib"; sourceTree = ""; }; + 386385B72042FD0000D2A207 /* libboost_math_tr1l.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_tr1l.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1l.dylib; sourceTree = ""; }; + 386385B82042FD0000D2A207 /* libboost_log_setup.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_log_setup.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log_setup.dylib; sourceTree = ""; }; + 386385B92042FD0000D2A207 /* libboost_coroutine.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_coroutine.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_coroutine.dylib; sourceTree = ""; }; + 386385BA2042FD0000D2A207 /* libboost_math_c99f.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_c99f.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99f.dylib; sourceTree = ""; }; + 386385BB2042FD0000D2A207 /* libboost_math_tr1-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_tr1-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1-mt.dylib"; sourceTree = ""; }; + 386385BC2042FD0000D2A207 /* libboost_system.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_system.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_system.dylib; sourceTree = ""; }; + 386385BD2042FD0000D2A207 /* libboost_serialization-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_serialization-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_serialization-mt.dylib"; sourceTree = ""; }; + 386385BE2042FD0000D2A207 /* libboost_filesystem.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_filesystem.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_filesystem.dylib; sourceTree = ""; }; + 386385BF2042FD0000D2A207 /* libboost_container-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_container-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_container-mt.dylib"; sourceTree = ""; }; + 386385C02042FD0000D2A207 /* libboost_program_options-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_program_options-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_program_options-mt.dylib"; sourceTree = ""; }; + 386385C12042FD0000D2A207 /* libboost_unit_test_framework.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_unit_test_framework.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_unit_test_framework.dylib; sourceTree = ""; }; + 386385C22042FD0000D2A207 /* libboost_math_tr1l-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_tr1l-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1l-mt.dylib"; sourceTree = ""; }; + 386385C32042FD0100D2A207 /* libboost_chrono.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_chrono.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_chrono.dylib; sourceTree = ""; }; + 386385C42042FD0100D2A207 /* libboost_date_time-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_date_time-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_date_time-mt.dylib"; sourceTree = ""; }; + 386385C52042FD0100D2A207 /* libboost_prg_exec_monitor-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_prg_exec_monitor-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_prg_exec_monitor-mt.dylib"; sourceTree = ""; }; + 386385C62042FD0100D2A207 /* libboost_stacktrace_noop.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_stacktrace_noop.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_noop.dylib; sourceTree = ""; }; + 386385C72042FD0100D2A207 /* libboost_thread-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_thread-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_thread-mt.dylib"; sourceTree = ""; }; + 386385C82042FD0100D2A207 /* libboost_unit_test_framework-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_unit_test_framework-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_unit_test_framework-mt.dylib"; sourceTree = ""; }; + 386385C92042FD0100D2A207 /* libboost_math_c99-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_c99-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99-mt.dylib"; sourceTree = ""; }; + 386385CA2042FD0100D2A207 /* libboost_timer.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_timer.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_timer.dylib; sourceTree = ""; }; + 386385CB2042FD0100D2A207 /* libboost_math_tr1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_tr1.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1.dylib; sourceTree = ""; }; + 386385CC2042FD0100D2A207 /* libboost_wserialization.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_wserialization.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_wserialization.dylib; sourceTree = ""; }; + 386385CD2042FD0100D2A207 /* libboost_stacktrace_addr2line-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_stacktrace_addr2line-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_addr2line-mt.dylib"; sourceTree = ""; }; + 386385CE2042FD0100D2A207 /* libboost_container.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_container.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_container.dylib; sourceTree = ""; }; + 386385CF2042FD0100D2A207 /* libboost_iostreams-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_iostreams-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_iostreams-mt.dylib"; sourceTree = ""; }; + 386385D02042FD0100D2A207 /* libboost_type_erasure-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_type_erasure-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_type_erasure-mt.dylib"; sourceTree = ""; }; + 386385D12042FD0100D2A207 /* libboost_stacktrace_addr2line.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_stacktrace_addr2line.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_addr2line.dylib; sourceTree = ""; }; + 386385D22042FD0100D2A207 /* libboost_date_time.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_date_time.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_date_time.dylib; sourceTree = ""; }; + 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_tr1f-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1f-mt.dylib"; sourceTree = ""; }; + 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_wave-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_wave-mt.dylib"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3863841F204275AA00D2A207 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 386385942042FC6400D2A207 /* OpenCL.framework in Frameworks */, + 386385D52042FD0100D2A207 /* libboost_atomic-mt.dylib in Frameworks */, + 386385D62042FD0100D2A207 /* libboost_log-mt.dylib in Frameworks */, + 386385D72042FD0100D2A207 /* libboost_locale-mt.dylib in Frameworks */, + 386385D82042FD0100D2A207 /* libboost_program_options.dylib in Frameworks */, + 386385D92042FD0100D2A207 /* libboost_math_c99l-mt.dylib in Frameworks */, + 386385DA2042FD0100D2A207 /* libboost_graph.dylib in Frameworks */, + 386385DB2042FD0100D2A207 /* libboost_coroutine-mt.dylib in Frameworks */, + 386385DC2042FD0200D2A207 /* libboost_stacktrace_basic-mt.dylib in Frameworks */, + 386385DD2042FD0200D2A207 /* libboost_chrono-mt.dylib in Frameworks */, + 386385DE2042FD0200D2A207 /* libboost_system-mt.dylib in Frameworks */, + 386385DF2042FD0200D2A207 /* libboost_context-mt.dylib in Frameworks */, + 386385E02042FD0200D2A207 /* libboost_math_tr1f.dylib in Frameworks */, + 386385E12042FD0200D2A207 /* libboost_prg_exec_monitor.dylib in Frameworks */, + 386385E22042FD0200D2A207 /* libboost_random.dylib in Frameworks */, + 386385E32042FD0200D2A207 /* libboost_regex.dylib in Frameworks */, + 386385E42042FD0200D2A207 /* libboost_serialization.dylib in Frameworks */, + 386385E52042FD0200D2A207 /* libboost_signals.dylib in Frameworks */, + 386385E62042FD0200D2A207 /* libboost_stacktrace_noop-mt.dylib in Frameworks */, + 386385E72042FD0200D2A207 /* libboost_log.dylib in Frameworks */, + 386385E82042FD0200D2A207 /* libboost_graph-mt.dylib in Frameworks */, + 386385E92042FD0200D2A207 /* libboost_filesystem-mt.dylib in Frameworks */, + 386385EA2042FD0200D2A207 /* libboost_signals-mt.dylib in Frameworks */, + 386385EB2042FD0200D2A207 /* libboost_math_c99l.dylib in Frameworks */, + 386385EC2042FD0200D2A207 /* libboost_regex-mt.dylib in Frameworks */, + 386385ED2042FD0200D2A207 /* libboost_math_c99f-mt.dylib in Frameworks */, + 386385EE2042FD0200D2A207 /* libboost_stacktrace_basic.dylib in Frameworks */, + 386385EF2042FD0200D2A207 /* libboost_type_erasure.dylib in Frameworks */, + 386385F02042FD0200D2A207 /* libboost_iostreams.dylib in Frameworks */, + 386385F12042FD0200D2A207 /* libboost_fiber-mt.dylib in Frameworks */, + 386385F22042FD0200D2A207 /* libboost_math_c99.dylib in Frameworks */, + 386385F32042FD0200D2A207 /* libboost_log_setup-mt.dylib in Frameworks */, + 386385F42042FD0200D2A207 /* libboost_random-mt.dylib in Frameworks */, + 386385F52042FD0200D2A207 /* libboost_wserialization-mt.dylib in Frameworks */, + 386385F62042FD0200D2A207 /* libboost_timer-mt.dylib in Frameworks */, + 386385F72042FD0200D2A207 /* libboost_math_tr1l.dylib in Frameworks */, + 386385F82042FD0200D2A207 /* libboost_log_setup.dylib in Frameworks */, + 386385F92042FD0200D2A207 /* libboost_coroutine.dylib in Frameworks */, + 386385FA2042FD0200D2A207 /* libboost_math_c99f.dylib in Frameworks */, + 386385FB2042FD0200D2A207 /* libboost_math_tr1-mt.dylib in Frameworks */, + 386385FC2042FD0200D2A207 /* libboost_system.dylib in Frameworks */, + 386385FD2042FD0200D2A207 /* libboost_serialization-mt.dylib in Frameworks */, + 386385FE2042FD0200D2A207 /* libboost_filesystem.dylib in Frameworks */, + 386385FF2042FD0200D2A207 /* libboost_container-mt.dylib in Frameworks */, + 386386002042FD0200D2A207 /* libboost_program_options-mt.dylib in Frameworks */, + 386386012042FD0200D2A207 /* libboost_unit_test_framework.dylib in Frameworks */, + 386386022042FD0200D2A207 /* libboost_math_tr1l-mt.dylib in Frameworks */, + 386386032042FD0200D2A207 /* libboost_chrono.dylib in Frameworks */, + 386386042042FD0200D2A207 /* libboost_date_time-mt.dylib in Frameworks */, + 386386052042FD0200D2A207 /* libboost_prg_exec_monitor-mt.dylib in Frameworks */, + 386386062042FD0200D2A207 /* libboost_stacktrace_noop.dylib in Frameworks */, + 386386072042FD0200D2A207 /* libboost_thread-mt.dylib in Frameworks */, + 386386082042FD0200D2A207 /* libboost_unit_test_framework-mt.dylib in Frameworks */, + 386386092042FD0200D2A207 /* libboost_math_c99-mt.dylib in Frameworks */, + 3863860A2042FD0200D2A207 /* libboost_timer.dylib in Frameworks */, + 3863860B2042FD0200D2A207 /* libboost_math_tr1.dylib in Frameworks */, + 3863860C2042FD0200D2A207 /* libboost_wserialization.dylib in Frameworks */, + 3863860D2042FD0200D2A207 /* libboost_stacktrace_addr2line-mt.dylib in Frameworks */, + 3863860E2042FD0200D2A207 /* libboost_container.dylib in Frameworks */, + 3863860F2042FD0200D2A207 /* libboost_iostreams-mt.dylib in Frameworks */, + 386386102042FD0200D2A207 /* libboost_type_erasure-mt.dylib in Frameworks */, + 386386112042FD0200D2A207 /* libboost_stacktrace_addr2line.dylib in Frameworks */, + 386386122042FD0200D2A207 /* libboost_date_time.dylib in Frameworks */, + 386386132042FD0200D2A207 /* libboost_math_tr1f-mt.dylib in Frameworks */, + 386386142042FD0200D2A207 /* libboost_wave-mt.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 38638419204275AA00D2A207 = { + isa = PBXGroup; + children = ( + 386385252042EE5F00D2A207 /* CL */, + 386385652042EE6100D2A207 /* Core */, + 386385562042EE6100D2A207 /* Hash */, + 386385282042EE6000D2A207 /* HashCL */, + 3863852C2042EE6000D2A207 /* main.cpp */, + 3863852F2042EE6100D2A207 /* MinerEngine */, + 386385292042EE6000D2A207 /* resource.h */, + 3863855B2042EE6100D2A207 /* Utils */, + 3863852E2042EE6100D2A207 /* version.h */, + 386385362042EE6100D2A207 /* XDagCore */, + 38638423204275AA00D2A207 /* Products */, + 386385922042FC6300D2A207 /* Frameworks */, + ); + sourceTree = ""; + }; + 38638423204275AA00D2A207 /* Products */ = { + isa = PBXGroup; + children = ( + 38638422204275AA00D2A207 /* GpuMiner */, + ); + name = Products; + sourceTree = ""; + }; + 386385252042EE5F00D2A207 /* CL */ = { + isa = PBXGroup; + children = ( + 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */, + ); + path = CL; + sourceTree = ""; + }; + 386385282042EE6000D2A207 /* HashCL */ = { + isa = PBXGroup; + children = ( + ); + path = HashCL; + sourceTree = ""; + }; + 3863852F2042EE6100D2A207 /* MinerEngine */ = { + isa = PBXGroup; + children = ( + 386385302042EE6100D2A207 /* CL */, + 386385322042EE6100D2A207 /* CLMiner.cpp */, + 386385332042EE6100D2A207 /* CLMiner.h */, + 386385342042EE6100D2A207 /* XCpuMiner.cpp */, + 386385352042EE6100D2A207 /* XCpuMiner.h */, + ); + path = MinerEngine; + sourceTree = ""; + }; + 386385302042EE6100D2A207 /* CL */ = { + isa = PBXGroup; + children = ( + 386385312042EE6100D2A207 /* cl2.hpp */, + ); + path = CL; + sourceTree = ""; + }; + 386385362042EE6100D2A207 /* XDagCore */ = { + isa = PBXGroup; + children = ( + 386385372042EE6100D2A207 /* dar */, + 3863853A2042EE6100D2A207 /* dfstools */, + 386385462042EE6100D2A207 /* XAddress.cpp */, + 386385472042EE6100D2A207 /* XAddress.h */, + 386385482042EE6100D2A207 /* XBlock.cpp */, + 386385492042EE6100D2A207 /* XBlock.h */, + 3863854A2042EE6100D2A207 /* XHash.cpp */, + 3863854B2042EE6100D2A207 /* XHash.h */, + 3863854C2042EE6100D2A207 /* XHash.hpp */, + 3863854D2042EE6100D2A207 /* XNetwork.cpp */, + 3863854E2042EE6100D2A207 /* XNetwork.h */, + 3863854F2042EE6100D2A207 /* XPool.cpp */, + 386385502042EE6100D2A207 /* XPool.h */, + 386385512042EE6100D2A207 /* XTaskProcessor.cpp */, + 386385522042EE6100D2A207 /* XTaskProcessor.h */, + 386385532042EE6100D2A207 /* XTaskWrapper.cpp */, + 386385542042EE6100D2A207 /* XTaskWrapper.h */, + 386385552042EE6100D2A207 /* XTime.h */, + ); + path = XDagCore; + sourceTree = ""; + }; + 386385372042EE6100D2A207 /* dar */ = { + isa = PBXGroup; + children = ( + 386385382042EE6100D2A207 /* crc.h */, + 386385392042EE6100D2A207 /* crc_c.cpp */, + ); + path = dar; + sourceTree = ""; + }; + 3863853A2042EE6100D2A207 /* dfstools */ = { + isa = PBXGroup; + children = ( + 3863853B2042EE6100D2A207 /* dfslib_crypt.cpp */, + 3863853C2042EE6100D2A207 /* dfslib_crypt.h */, + 3863853D2042EE6100D2A207 /* dfslib_string.cpp */, + 3863853E2042EE6100D2A207 /* dfslib_string.h */, + 3863853F2042EE6100D2A207 /* dfslib_types.h */, + ); + path = dfstools; + sourceTree = ""; + }; + 386385562042EE6100D2A207 /* Hash */ = { + isa = PBXGroup; + children = ( + 386385572042EE6100D2A207 /* sha256.cpp */, + 386385582042EE6100D2A207 /* sha256.h */, + 386385592042EE6100D2A207 /* sha256_mod.cpp */, + 3863855A2042EE6100D2A207 /* sha256_mod.h */, + ); + path = Hash; + sourceTree = ""; + }; + 3863855B2042EE6100D2A207 /* Utils */ = { + isa = PBXGroup; + children = ( + 3863855C2042EE6100D2A207 /* CpuInfo.cpp */, + 3863855D2042EE6100D2A207 /* CpuInfo.h */, + 3863855E2042EE6100D2A207 /* PathUtils.cpp */, + 3863855F2042EE6100D2A207 /* PathUtils.h */, + 386385602042EE6100D2A207 /* Random.cpp */, + 386385612042EE6100D2A207 /* Random.h */, + 386385622042EE6100D2A207 /* StringFormat.h */, + 386385632042EE6100D2A207 /* Utils.cpp */, + 386385642042EE6100D2A207 /* Utils.h */, + ); + path = Utils; + sourceTree = ""; + }; + 386385652042EE6100D2A207 /* Core */ = { + isa = PBXGroup; + children = ( + 386385662042EE6100D2A207 /* Common.h */, + 386385672042EE6100D2A207 /* CommonData.cpp */, + 386385682042EE6100D2A207 /* CommonData.h */, + 386385692042EE6100D2A207 /* Exceptions.h */, + 3863856A2042EE6100D2A207 /* Farm.cpp */, + 3863856B2042EE6100D2A207 /* Farm.h */, + 3863856C2042EE6100D2A207 /* Guards.h */, + 3863856D2042EE6100D2A207 /* Log.cpp */, + 3863856E2042EE6100D2A207 /* Log.h */, + 3863856F2042EE6100D2A207 /* Miner.cpp */, + 386385702042EE6100D2A207 /* Miner.h */, + 386385712042EE6100D2A207 /* MinerManager.cpp */, + 386385722042EE6100D2A207 /* MinerManager.h */, + 386385732042EE6100D2A207 /* Terminal.h */, + 386385742042EE6100D2A207 /* Worker.cpp */, + 386385752042EE6100D2A207 /* Worker.h */, + ); + path = Core; + sourceTree = ""; + }; + 386385922042FC6300D2A207 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 386385952042FCFE00D2A207 /* libboost_atomic-mt.dylib */, + 3863859D2042FCFE00D2A207 /* libboost_chrono-mt.dylib */, + 386385C32042FD0100D2A207 /* libboost_chrono.dylib */, + 386385BF2042FD0000D2A207 /* libboost_container-mt.dylib */, + 386385CE2042FD0100D2A207 /* libboost_container.dylib */, + 3863859F2042FCFF00D2A207 /* libboost_context-mt.dylib */, + 3863859B2042FCFE00D2A207 /* libboost_coroutine-mt.dylib */, + 386385B92042FD0000D2A207 /* libboost_coroutine.dylib */, + 386385C42042FD0100D2A207 /* libboost_date_time-mt.dylib */, + 386385D22042FD0100D2A207 /* libboost_date_time.dylib */, + 386385B12042FD0000D2A207 /* libboost_fiber-mt.dylib */, + 386385A92042FCFF00D2A207 /* libboost_filesystem-mt.dylib */, + 386385BE2042FD0000D2A207 /* libboost_filesystem.dylib */, + 386385A82042FCFF00D2A207 /* libboost_graph-mt.dylib */, + 3863859A2042FCFE00D2A207 /* libboost_graph.dylib */, + 386385CF2042FD0100D2A207 /* libboost_iostreams-mt.dylib */, + 386385B02042FD0000D2A207 /* libboost_iostreams.dylib */, + 386385972042FCFE00D2A207 /* libboost_locale-mt.dylib */, + 386385B32042FD0000D2A207 /* libboost_log_setup-mt.dylib */, + 386385B82042FD0000D2A207 /* libboost_log_setup.dylib */, + 386385962042FCFE00D2A207 /* libboost_log-mt.dylib */, + 386385A72042FCFF00D2A207 /* libboost_log.dylib */, + 386385C92042FD0100D2A207 /* libboost_math_c99-mt.dylib */, + 386385B22042FD0000D2A207 /* libboost_math_c99.dylib */, + 386385AD2042FCFF00D2A207 /* libboost_math_c99f-mt.dylib */, + 386385BA2042FD0000D2A207 /* libboost_math_c99f.dylib */, + 386385992042FCFE00D2A207 /* libboost_math_c99l-mt.dylib */, + 386385AB2042FCFF00D2A207 /* libboost_math_c99l.dylib */, + 386385BB2042FD0000D2A207 /* libboost_math_tr1-mt.dylib */, + 386385CB2042FD0100D2A207 /* libboost_math_tr1.dylib */, + 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */, + 386385A02042FCFF00D2A207 /* libboost_math_tr1f.dylib */, + 386385C22042FD0000D2A207 /* libboost_math_tr1l-mt.dylib */, + 386385B72042FD0000D2A207 /* libboost_math_tr1l.dylib */, + 386385C52042FD0100D2A207 /* libboost_prg_exec_monitor-mt.dylib */, + 386385A12042FCFF00D2A207 /* libboost_prg_exec_monitor.dylib */, + 386385C02042FD0000D2A207 /* libboost_program_options-mt.dylib */, + 386385982042FCFE00D2A207 /* libboost_program_options.dylib */, + 386385B42042FD0000D2A207 /* libboost_random-mt.dylib */, + 386385A22042FCFF00D2A207 /* libboost_random.dylib */, + 386385AC2042FCFF00D2A207 /* libboost_regex-mt.dylib */, + 386385A32042FCFF00D2A207 /* libboost_regex.dylib */, + 386385BD2042FD0000D2A207 /* libboost_serialization-mt.dylib */, + 386385A42042FCFF00D2A207 /* libboost_serialization.dylib */, + 386385AA2042FCFF00D2A207 /* libboost_signals-mt.dylib */, + 386385A52042FCFF00D2A207 /* libboost_signals.dylib */, + 386385CD2042FD0100D2A207 /* libboost_stacktrace_addr2line-mt.dylib */, + 386385D12042FD0100D2A207 /* libboost_stacktrace_addr2line.dylib */, + 3863859C2042FCFE00D2A207 /* libboost_stacktrace_basic-mt.dylib */, + 386385AE2042FCFF00D2A207 /* libboost_stacktrace_basic.dylib */, + 386385A62042FCFF00D2A207 /* libboost_stacktrace_noop-mt.dylib */, + 386385C62042FD0100D2A207 /* libboost_stacktrace_noop.dylib */, + 3863859E2042FCFF00D2A207 /* libboost_system-mt.dylib */, + 386385BC2042FD0000D2A207 /* libboost_system.dylib */, + 386385C72042FD0100D2A207 /* libboost_thread-mt.dylib */, + 386385B62042FD0000D2A207 /* libboost_timer-mt.dylib */, + 386385CA2042FD0100D2A207 /* libboost_timer.dylib */, + 386385D02042FD0100D2A207 /* libboost_type_erasure-mt.dylib */, + 386385AF2042FD0000D2A207 /* libboost_type_erasure.dylib */, + 386385C82042FD0100D2A207 /* libboost_unit_test_framework-mt.dylib */, + 386385C12042FD0000D2A207 /* libboost_unit_test_framework.dylib */, + 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */, + 386385B52042FD0000D2A207 /* libboost_wserialization-mt.dylib */, + 386385CC2042FD0100D2A207 /* libboost_wserialization.dylib */, + 386385932042FC6300D2A207 /* OpenCL.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 38638421204275AA00D2A207 /* GpuMiner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 38638429204275AA00D2A207 /* Build configuration list for PBXNativeTarget "GpuMiner" */; + buildPhases = ( + 3863841E204275AA00D2A207 /* Sources */, + 3863841F204275AA00D2A207 /* Frameworks */, + 38638420204275AA00D2A207 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GpuMiner; + productName = xdag; + productReference = 38638422204275AA00D2A207 /* GpuMiner */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3863841A204275AA00D2A207 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = xrdavies; + TargetAttributes = { + 38638421204275AA00D2A207 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 3863841D204275AA00D2A207 /* Build configuration list for PBXProject "GpuMiner" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 38638419204275AA00D2A207; + productRefGroup = 38638423204275AA00D2A207 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 38638421204275AA00D2A207 /* GpuMiner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 3863841E204275AA00D2A207 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3863857B2042EE6100D2A207 /* crc_c.cpp in Sources */, + 3863857F2042EE6200D2A207 /* XAddress.cpp in Sources */, + 386385822042EE6200D2A207 /* XNetwork.cpp in Sources */, + 386385872042EE6200D2A207 /* sha256_mod.cpp in Sources */, + 386385912042EE6200D2A207 /* Worker.cpp in Sources */, + 386385802042EE6200D2A207 /* XBlock.cpp in Sources */, + 3863858A2042EE6200D2A207 /* Random.cpp in Sources */, + 3863858F2042EE6200D2A207 /* Miner.cpp in Sources */, + 3863858C2042EE6200D2A207 /* CommonData.cpp in Sources */, + 386385792042EE6100D2A207 /* CLMiner.cpp in Sources */, + 386385892042EE6200D2A207 /* PathUtils.cpp in Sources */, + 3863858E2042EE6200D2A207 /* Log.cpp in Sources */, + 3863857D2042EE6100D2A207 /* dfslib_string.cpp in Sources */, + 386385902042EE6200D2A207 /* MinerManager.cpp in Sources */, + 386385832042EE6200D2A207 /* XPool.cpp in Sources */, + 3863857A2042EE6100D2A207 /* XCpuMiner.cpp in Sources */, + 3863858D2042EE6200D2A207 /* Farm.cpp in Sources */, + 386385782042EE6100D2A207 /* main.cpp in Sources */, + 386385812042EE6200D2A207 /* XHash.cpp in Sources */, + 386385852042EE6200D2A207 /* XTaskWrapper.cpp in Sources */, + 386385842042EE6200D2A207 /* XTaskProcessor.cpp in Sources */, + 3863857C2042EE6100D2A207 /* dfslib_crypt.cpp in Sources */, + 3863858B2042EE6200D2A207 /* Utils.cpp in Sources */, + 386385862042EE6200D2A207 /* sha256.cpp in Sources */, + 386385882042EE6200D2A207 /* CpuInfo.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 38638427204275AA00D2A207 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 38638428204275AA00D2A207 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + }; + name = Release; + }; + 3863842A204275AA00D2A207 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + GCC_PREPROCESSOR_DEFINITIONS = ( + __MACOS, + "DEBUG=0", + ); + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + /usr/local/opt/boost/include/, + ); + LIBRARY_SEARCH_PATHS = ( + /usr/local/opt/boost/lib/, + /usr/local/Cellar/boost/1.66.0/lib, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)\" /usr/local/opt/boost/include/"; + }; + name = Debug; + }; + 3863842B204275AA00D2A207 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + GCC_PREPROCESSOR_DEFINITIONS = __MACOS; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + /usr/local/opt/boost/include/, + ); + LIBRARY_SEARCH_PATHS = ( + /usr/local/opt/boost/lib/, + /usr/local/Cellar/boost/1.66.0/lib, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)\" /usr/local/opt/boost/include/"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3863841D204275AA00D2A207 /* Build configuration list for PBXProject "GpuMiner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 38638427204275AA00D2A207 /* Debug */, + 38638428204275AA00D2A207 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 38638429204275AA00D2A207 /* Build configuration list for PBXNativeTarget "GpuMiner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3863842A204275AA00D2A207 /* Debug */, + 3863842B204275AA00D2A207 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3863841A204275AA00D2A207 /* Project object */; +} diff --git a/GpuMiner/Utils/PathUtils.cpp b/GpuMiner/Utils/PathUtils.cpp index 8d79f01..d16f548 100644 --- a/GpuMiner/Utils/PathUtils.cpp +++ b/GpuMiner/Utils/PathUtils.cpp @@ -3,6 +3,8 @@ #include #include #include +#elif __MACOS +#include #elif _WIN32 #include #endif @@ -16,6 +18,14 @@ std::string PathUtils::GetModuleFolder() } else { return ""; } +#elif __MACOS +// char result[1024]; +// if (readlink("/proc/self/exe", result, 1024) > 0) { +// return std::string(dirname(result)).append("/"); +// } else { +// return ""; +// } + return "./CL/"; #elif _WIN32 char szPath[MAX_PATH]; char szBuffer[MAX_PATH]; @@ -31,7 +41,7 @@ std::string PathUtils::GetModuleFolder() bool PathUtils::FileExists(const std::string& fname) { -#ifdef __linux__ +#if defined (__linux__) || defined (__MACOS) return access(fname.c_str(), F_OK) != -1; #elif _WIN32 return PathFileExists(fname.c_str()) == TRUE; diff --git a/GpuMiner/XDagCore/XNetwork.cpp b/GpuMiner/XDagCore/XNetwork.cpp index 8588bf2..acade47 100644 --- a/GpuMiner/XDagCore/XNetwork.cpp +++ b/GpuMiner/XDagCore/XNetwork.cpp @@ -7,6 +7,11 @@ #include #include #include +#include +#elif __MACOS +#include +#include +#include #include #elif _WIN32 #include "win\netinet\in.h" diff --git a/GpuMiner/XDagCore/XNetwork.h b/GpuMiner/XDagCore/XNetwork.h index 1395ce0..8d06348 100644 --- a/GpuMiner/XDagCore/XNetwork.h +++ b/GpuMiner/XDagCore/XNetwork.h @@ -3,6 +3,10 @@ #ifdef __linux__ #include "netinet/in.h" #include "sys/socket.h" +typedef int SOCKET; +#elif __MACOS +#include "netinet/in.h" +#include "sys/socket.h" typedef int SOCKET; #elif _WIN32 #define WIN32_LEAN_AND_MEAN From 304e527a584be604bfa3212e1caf9c6b7b54bc5d Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Sat, 10 Mar 2018 13:44:36 +0300 Subject: [PATCH 09/41] Refactoring --- GpuMiner/Core/MinerManager.cpp | 8 +- GpuMiner/GpuMiner.vcxproj | 8 +- GpuMiner/GpuMiner.vcxproj.filters | 24 +- GpuMiner/XDagCore/XAddress.cpp | 24 +- GpuMiner/XDagCore/XAddress.h | 12 +- .../{XNetwork.cpp => XConnection.cpp} | 362 +++++++++--------- .../XDagCore/{XNetwork.h => XConnection.h} | 76 ++-- GpuMiner/XDagCore/XGlobal.cpp | 10 + GpuMiner/XDagCore/XGlobal.h | 7 + GpuMiner/XDagCore/XPool.cpp | 212 ++-------- GpuMiner/XDagCore/XPool.h | 48 +-- GpuMiner/XDagCore/XPoolConnection.cpp | 207 ++++++++++ GpuMiner/XDagCore/XPoolConnection.h | 40 ++ GpuMiner/XDagCore/XTaskWrapper.cpp | 2 +- GpuMiner/main.cpp | 12 +- 15 files changed, 559 insertions(+), 493 deletions(-) rename GpuMiner/XDagCore/{XNetwork.cpp => XConnection.cpp} (86%) rename GpuMiner/XDagCore/{XNetwork.h => XConnection.h} (68%) create mode 100644 GpuMiner/XDagCore/XGlobal.cpp create mode 100644 GpuMiner/XDagCore/XGlobal.h create mode 100644 GpuMiner/XDagCore/XPoolConnection.cpp create mode 100644 GpuMiner/XDagCore/XPoolConnection.h diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index f7b7784..8dd3b3c 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -14,6 +14,7 @@ #include "MinerEngine/XCpuMiner.h" #include "XDagCore/XTaskProcessor.h" #include "XDagCore/XPool.h" +#include "XDagCore/XGlobal.h" #include "Utils/CpuInfo.h" #include "Utils/Random.h" @@ -301,14 +302,9 @@ void MinerManager::DoBenchmark(MinerType type, unsigned warmupDuration, unsigned void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeriod) { + XGlobal::Init(); XTaskProcessor taskProcessor; - XPool pool(_accountAddress, remote, &taskProcessor); - if(!pool.Initialize()) - { - cerr << "Pool initialization error" << endl; - exit(-1); - } if(!pool.Connect()) { cerr << "Cannot connect to pool" << endl; diff --git a/GpuMiner/GpuMiner.vcxproj b/GpuMiner/GpuMiner.vcxproj index f5d8f97..fded1f8 100644 --- a/GpuMiner/GpuMiner.vcxproj +++ b/GpuMiner/GpuMiner.vcxproj @@ -175,15 +175,20 @@ + + - + + + + CppCode @@ -218,7 +223,6 @@ - diff --git a/GpuMiner/GpuMiner.vcxproj.filters b/GpuMiner/GpuMiner.vcxproj.filters index 03b39e5..1e2e347 100644 --- a/GpuMiner/GpuMiner.vcxproj.filters +++ b/GpuMiner/GpuMiner.vcxproj.filters @@ -58,9 +58,6 @@ Core - - XDagCore - XDagCore @@ -115,6 +112,15 @@ MinerEngine + + XDagCore + + + XDagCore + + + XDagCore + @@ -168,9 +174,6 @@ XDagCore\win\sys - - XDagCore - XDagCore @@ -222,6 +225,15 @@ MinerEngine + + XDagCore + + + XDagCore + + + XDagCore + diff --git a/GpuMiner/XDagCore/XAddress.cpp b/GpuMiner/XDagCore/XAddress.cpp index 72903be..99a83c0 100644 --- a/GpuMiner/XDagCore/XAddress.cpp +++ b/GpuMiner/XDagCore/XAddress.cpp @@ -2,15 +2,7 @@ #include static const uint8_t* bits2mime = (uint8_t*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -XAddress::XAddress() -{ - Init(); -} - -XAddress::~XAddress() -{ -} +uint8_t XAddress::_mime2bits[256]; void XAddress::Init() { @@ -37,10 +29,13 @@ bool XAddress::AddressToHash(const char *address, cheatcoin_hash_t hash) d = _mime2bits[c]; } while(d & 0xC0); - e <<= 6, e |= d, n += 6; + e <<= 6; + e |= d; + n += 6; if(n >= 8) { - *fld++ = e >> (n -= 8); + n -= 8; + *fld++ = e >> n; } } for(i = 0; i < 8; ++i) @@ -61,9 +56,12 @@ const char* XAddress::HashToAddress(const cheatcoin_hash_t hash) { if(d < 6) { - d += 8, c <<= 8, c |= *fld++; + d += 8; + c <<= 8; + c |= *fld++; } - *ptr++ = bits2mime[c >> (d -= 6) & 0x3F]; + d -= 6; + *ptr++ = bits2mime[c >> d & 0x3F]; } *ptr = 0; return buf; diff --git a/GpuMiner/XDagCore/XAddress.h b/GpuMiner/XDagCore/XAddress.h index b9733f9..247d83a 100644 --- a/GpuMiner/XDagCore/XAddress.h +++ b/GpuMiner/XDagCore/XAddress.h @@ -5,14 +5,10 @@ class XAddress { private: - uint8_t _mime2bits[256]; - - void Init(); + static uint8_t _mime2bits[256]; public: - XAddress(); - ~XAddress(); - - bool AddressToHash(const char* address, cheatcoin_hash_t hash); - const char* HashToAddress(const cheatcoin_hash_t hash); + static void Init(); + static bool AddressToHash(const char* address, cheatcoin_hash_t hash); + static const char* HashToAddress(const cheatcoin_hash_t hash); }; diff --git a/GpuMiner/XDagCore/XNetwork.cpp b/GpuMiner/XDagCore/XConnection.cpp similarity index 86% rename from GpuMiner/XDagCore/XNetwork.cpp rename to GpuMiner/XDagCore/XConnection.cpp index 8588bf2..340b242 100644 --- a/GpuMiner/XDagCore/XNetwork.cpp +++ b/GpuMiner/XDagCore/XConnection.cpp @@ -1,181 +1,181 @@ -#include "XNetwork.h" -#include -#include -#include "Core/Log.h" - -#ifdef __linux__ -#include -#include -#include -#include -#elif _WIN32 -#include "win\netinet\in.h" -#define poll WSAPoll -#endif - -#ifdef _WIN32 -#define strtok_r strtok_s -#define ioctl ioctlsocket -#define fcntl(a,b,c) 0 -#define close closesocket -#define write(a,b,c) send(a,b,c,0) -#define read(a,b,c) recv(a,b,c,0) -#define sysconf(x) (512) - -#else -#define INVALID_SOCKET -1 -#endif - -XNetwork::XNetwork() -{ - _socket = INVALID_SOCKET; -} - -XNetwork::~XNetwork() -{ - Close(); -} - -bool XNetwork::Initialize() -{ -#ifdef _WIN32 - WSADATA wsaData; - return WSAStartup(MAKEWORD(2, 2), &wsaData) == 0; -#endif - return true; -} - -bool XNetwork::ValidateAddress(const char *address, sockaddr_in &peerAddr) -{ - char *lasts; - char buf[0x100]; - - // Fill in the address of server - memset(&peerAddr, 0, sizeof(peerAddr)); - peerAddr.sin_family = AF_INET; - - // Resolve the server address (convert from symbolic name to IP number) - strcpy(buf, address); - char *addressPart = strtok_r(buf, ":", &lasts); - if(!addressPart) - { - //mess = "host is not given"; - return false; - } - if(!strcmp(addressPart, "any")) - { - peerAddr.sin_addr.s_addr = htonl(INADDR_ANY); - } - else if(!inet_aton(addressPart, &peerAddr.sin_addr)) - { - hostent *host = gethostbyname(addressPart); - if(!host || !host->h_addr_list[0]) - { - //mess = "cannot resolve host ", mess1 = poolAddressPart; - return false; - } - // Write resolved IP address of a server to the address structure - memmove(&peerAddr.sin_addr.s_addr, host->h_addr_list[0], 4); - } - - // Resolve port - char *portPart = strtok_r(0, ":", &lasts); - if(!portPart) - { - //mess = "port is not given"; - return false; - } - peerAddr.sin_port = htons(atoi(portPart)); - - return true; -} - -bool XNetwork::Connect(const char *address) -{ - int reuseAddr = 1; - linger lingerOpt = { 1, 0 }; // Linger active, timeout 0 - sockaddr_in peerAddr; - - if(!ValidateAddress(address, peerAddr)) - { - return false; - } - - _socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if(_socket == INVALID_SOCKET) - { - //mess = "cannot create a socket"; - return false; - } - if(fcntl(_socket, F_SETFD, FD_CLOEXEC) == -1) - { - //TODO: log - //cheatcoin_err("pool : can't set FD_CLOEXEC flag on socket %d, %s\n", g_socket, strerror(errno)); - } - - // Set the "LINGER" timeout to zero, to close the listen socket - // immediately at program termination. - setsockopt(_socket, SOL_SOCKET, SO_LINGER, (char *)&lingerOpt, sizeof(lingerOpt)); - setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuseAddr, sizeof(int)); - - // Now, connect to a pool - int res = connect(_socket, (struct sockaddr*)&peerAddr, sizeof(peerAddr)); - if(res) - { - //mess = "cannot connect to the pool"; - Close(); - return false; - } - return true; -} - -//TODO: think about exception instead of result failure flag -bool XNetwork::IsReady(NetworkAction action, int timeout, bool& success) -{ - success = false; - if(action != NetworkAction::Read && action != NetworkAction::Write) - { - return false; - } - short desiredAction = action == NetworkAction::Read ? POLLIN : POLLOUT; - - pollfd p; - p.fd = _socket; - p.events = desiredAction; - if(!poll(&p, 1, timeout)) - { - success = true; - return false; - } - if(p.revents & POLLHUP) - { - clog(XDag::LogChannel) << "Connection is closed"; - return false; - } - if(p.revents & POLLERR) - { - clog(XDag::LogChannel) << "Connection error"; - return false; - } - success = true; - return (p.revents & desiredAction) > 0; -} - -int XNetwork::Write(char* buf, int len) -{ - return write(_socket, buf, len); -} - -int XNetwork::Read(char* buf, int len) -{ - return read(_socket, buf, len); -} - -void XNetwork::Close() -{ - if(_socket != INVALID_SOCKET) - { - close(_socket); - _socket = INVALID_SOCKET; - } -} +#include "XConnection.h" +#include +#include +#include "Core/Log.h" + +#ifdef __linux__ +#include +#include +#include +#include +#elif _WIN32 +#include "win\netinet\in.h" +#define poll WSAPoll +#endif + +#ifdef _WIN32 +#define strtok_r strtok_s +#define ioctl ioctlsocket +#define fcntl(a,b,c) 0 +#define close closesocket +#define write(a,b,c) send(a,b,c,0) +#define read(a,b,c) recv(a,b,c,0) +#define sysconf(x) (512) + +#else +#define INVALID_SOCKET -1 +#endif + +XConnection::XConnection() +{ + _socket = INVALID_SOCKET; +} + +XConnection::~XConnection() +{ + Close(); +} + +bool XConnection::Initialize() +{ +#ifdef _WIN32 + WSADATA wsaData; + return WSAStartup(MAKEWORD(2, 2), &wsaData) == 0; +#endif + return true; +} + +bool XConnection::ValidatePoolAddress(const char *address, sockaddr_in &peerAddr) +{ + char *lasts; + char buf[0x100]; + + // Fill in the address of server + memset(&peerAddr, 0, sizeof(peerAddr)); + peerAddr.sin_family = AF_INET; + + // Resolve the server address (convert from symbolic name to IP number) + strcpy(buf, address); + char *addressPart = strtok_r(buf, ":", &lasts); + if(!addressPart) + { + //mess = "host is not given"; + return false; + } + if(!strcmp(addressPart, "any")) + { + peerAddr.sin_addr.s_addr = htonl(INADDR_ANY); + } + else if(!inet_aton(addressPart, &peerAddr.sin_addr)) + { + hostent *host = gethostbyname(addressPart); + if(!host || !host->h_addr_list[0]) + { + //mess = "cannot resolve host ", mess1 = poolAddressPart; + return false; + } + // Write resolved IP address of a server to the address structure + memmove(&peerAddr.sin_addr.s_addr, host->h_addr_list[0], 4); + } + + // Resolve port + char *portPart = strtok_r(0, ":", &lasts); + if(!portPart) + { + //mess = "port is not given"; + return false; + } + peerAddr.sin_port = htons(atoi(portPart)); + + return true; +} + +bool XConnection::Connect(const char *address) +{ + int reuseAddr = 1; + linger lingerOpt = { 1, 0 }; // Linger active, timeout 0 + sockaddr_in peerAddr; + + if(!ValidatePoolAddress(address, peerAddr)) + { + return false; + } + + _socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if(_socket == INVALID_SOCKET) + { + //mess = "cannot create a socket"; + return false; + } + if(fcntl(_socket, F_SETFD, FD_CLOEXEC) == -1) + { + //TODO: log + //cheatcoin_err("pool : can't set FD_CLOEXEC flag on socket %d, %s\n", g_socket, strerror(errno)); + } + + // Set the "LINGER" timeout to zero, to close the listen socket + // immediately at program termination. + setsockopt(_socket, SOL_SOCKET, SO_LINGER, (char *)&lingerOpt, sizeof(lingerOpt)); + setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuseAddr, sizeof(int)); + + // Now, connect to a pool + int res = connect(_socket, (struct sockaddr*)&peerAddr, sizeof(peerAddr)); + if(res) + { + //mess = "cannot connect to the pool"; + Close(); + return false; + } + return true; +} + +//TODO: think about exception instead of result failure flag +bool XConnection::IsReady(NetworkAction action, int timeout, bool& success) +{ + success = false; + if(action != NetworkAction::Read && action != NetworkAction::Write) + { + return false; + } + short desiredAction = action == NetworkAction::Read ? POLLIN : POLLOUT; + + pollfd p; + p.fd = _socket; + p.events = desiredAction; + if(!poll(&p, 1, timeout)) + { + success = true; + return false; + } + if(p.revents & POLLHUP) + { + clog(XDag::LogChannel) << "Connection is closed"; + return false; + } + if(p.revents & POLLERR) + { + clog(XDag::LogChannel) << "Connection error"; + return false; + } + success = true; + return (p.revents & desiredAction) > 0; +} + +int XConnection::Write(char* buf, int len) +{ + return write(_socket, buf, len); +} + +int XConnection::Read(char* buf, int len) +{ + return read(_socket, buf, len); +} + +void XConnection::Close() +{ + if(_socket != INVALID_SOCKET) + { + close(_socket); + _socket = INVALID_SOCKET; + } +} diff --git a/GpuMiner/XDagCore/XNetwork.h b/GpuMiner/XDagCore/XConnection.h similarity index 68% rename from GpuMiner/XDagCore/XNetwork.h rename to GpuMiner/XDagCore/XConnection.h index 1395ce0..4b86856 100644 --- a/GpuMiner/XDagCore/XNetwork.h +++ b/GpuMiner/XDagCore/XConnection.h @@ -1,38 +1,38 @@ -#pragma once - -#ifdef __linux__ -#include "netinet/in.h" -#include "sys/socket.h" -typedef int SOCKET; -#elif _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#include -#endif - -enum class NetworkAction -{ - Read, - Write -}; - -class XNetwork -{ -private: - SOCKET _socket; - - bool ValidateAddress(const char *address, sockaddr_in &_peerAddr); -public: - XNetwork(); - virtual ~XNetwork(); - - bool Initialize(); - bool Connect(const char *address); - bool IsReady(NetworkAction action, int timeout, bool &success); - int Write(char* buf, int len); - int Read(char* buf, int len); - void Close(); - - bool IsConnected() { return _socket != -1; } -}; - +#pragma once + +#ifdef __linux__ +#include "netinet/in.h" +#include "sys/socket.h" +typedef int SOCKET; +#elif _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#include +#endif + +enum class NetworkAction +{ + Read, + Write +}; + +class XConnection +{ +private: + SOCKET _socket; + + static bool ValidatePoolAddress(const char *address, sockaddr_in &_peerAddr); +public: + XConnection(); + virtual ~XConnection(); + + virtual bool Initialize(); + virtual bool Connect(const char *address); + bool IsReady(NetworkAction action, int timeout, bool &success); + int Write(char* buf, int len); + int Read(char* buf, int len); + void Close(); + + bool IsConnected() { return _socket != -1; } +}; + diff --git a/GpuMiner/XDagCore/XGlobal.cpp b/GpuMiner/XDagCore/XGlobal.cpp new file mode 100644 index 0000000..fa870e9 --- /dev/null +++ b/GpuMiner/XDagCore/XGlobal.cpp @@ -0,0 +1,10 @@ +#include "XGlobal.h" +#include "XAddress.h" +#include "dar/crc.h" + +void XGlobal::Init() +{ + XAddress::Init(); + crc_init(); +} + diff --git a/GpuMiner/XDagCore/XGlobal.h b/GpuMiner/XDagCore/XGlobal.h new file mode 100644 index 0000000..9d95149 --- /dev/null +++ b/GpuMiner/XDagCore/XGlobal.h @@ -0,0 +1,7 @@ +#pragma once +class XGlobal +{ +public: + static void Init(); +}; + diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index 6141ff8..d8df4a2 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -1,12 +1,10 @@ #include "XPool.h" #include -#include "dfstools/dfslib_string.h" -#include "dar/crc.h" -#include "XAddress.h" #include "XTime.h" #include "Core/Log.h" #include "Utils/StringFormat.h" #include "Utils/Utils.h" +#include "XAddress.h" #define FIRST_SHARE_SEND_TIMEOUT 10 #define BLOCK_TIME 64 @@ -15,95 +13,42 @@ XPool::XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcess { strcpy(_poolAddress, poolAddress.c_str()); _taskProcessor = taskProcessor; - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - _localMiner.nfield_in = 0; - _localMiner.nfield_out = 0; _taskTime = 0; _lastShareTime = 0; + _currentConnection = NULL; memset(_lastHash, 0, sizeof(cheatcoin_hash_t)); - - XAddress address; - address.AddressToHash(accountAddress.c_str(), _addressHash); - memcpy(_localMiner.id.data, _addressHash, sizeof(cheatcoin_hash_t)); + _connection.SetAddress(accountAddress); } XPool::~XPool() { - if(!_crypt) - { - free(_crypt); - _crypt = NULL; - } -} - -bool XPool::Initialize() -{ - if(!_network.Initialize()) - { - clog(XDag::LogChannel) << "Failed to initialize network connection"; - } - if(!InitCrypto()) - { - clog(XDag::LogChannel) << "Failed to initialize cryptography system"; - return false; - } - - XBlock::GenerateFakeBlock(&_firstBlock); - crc_init(); - return true; -} - -bool XPool::InitCrypto() -{ - dfslib_string str; - uint32_t sector[128]; - _crypt = (dfslib_crypt*)malloc(sizeof(struct dfslib_crypt)); - if(!_crypt) - { - return false; - } - dfslib_crypt_set_password(_crypt, dfslib_utf8_string(&str, MINERS_PWD, (uint32_t)strlen(MINERS_PWD))); - for(int i = 0; i < 128; ++i) - { - sector[i] = SECTOR0_BASE + i * SECTOR0_OFFSET; - } - for(int i = 0; i < 128; ++i) - { - dfslib_crypt_set_sector0(_crypt, sector); - dfslib_encrypt_sector(_crypt, sector, SECTOR0_BASE + i * SECTOR0_OFFSET); - } - return true; + Disconnect(); } bool XPool::Connect() { - _localMiner.nfield_in = 0; - _localMiner.nfield_out = 0; - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - - if(!_network.Connect(_poolAddress)) + if(!_connection.Initialize()) { + clog(XDag::LogChannel) << "Failed to initialize network connection"; return false; } - //as far as I understand it is necessary for miner identification - if(!SendToPool(_firstBlock.field, CHEATCOIN_BLOCK_FIELDS)) + if(!_connection.Connect(_poolAddress)) { return false; } + _currentConnection = &_connection; return true; } void XPool::Disconnect() { - _network.Close(); + _connection.Close(); } //requests new tasks from pool and sends shares if ready bool XPool::Interract() { - if(!_network.IsConnected()) + if(!_currentConnection->IsConnected()) { clog(XDag::LogChannel) << "Connection closed"; return false; @@ -116,55 +61,13 @@ bool XPool::Interract() bool XPool::CheckNewTasks() { - cheatcoin_field data[2]; - for(;;) - { - bool success; - // TODO: think about exceptions instead of failure flag - bool isReady = _network.IsReady(NetworkAction::Read, 0, success); - if(!success) - { - return false; - } - if(!isReady) - { - break; - } - int res = _network.Read((char*)data + _ndata, _maxndata - _ndata); - if(res < 0) - { - clog(XDag::LogChannel) << "Failed to read data from pool"; - return false; - } - _ndata += res; - if(_ndata == _maxndata) - { - cheatcoin_field *last = data + (_ndata / sizeof(struct cheatcoin_field) - 1); - dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); - if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) - { - // if returned data contains hash of account address - pool sent information about incoming transfer - // we just ignore it - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - } - else if(_maxndata == 2 * sizeof(struct cheatcoin_field)) - { - OnNewTask(data); - } - else - { - _maxndata = 2 * sizeof(struct cheatcoin_field); - } - } - } - return true; + return _currentConnection->ReadTaskData([this](cheatcoin_field* data) { OnNewTask(data); }); } void XPool::OnNewTask(cheatcoin_field* data) { XTaskWrapper* task = _taskProcessor->GetNextTask(); - task->FillAndPrecalc(data, _addressHash); + task->FillAndPrecalc(data, _currentConnection->GetAddressHash()); _taskProcessor->SwitchTask(); _lastShareTime = _taskTime = time(0); @@ -172,10 +75,7 @@ void XPool::OnNewTask(cheatcoin_field* data) clog(XDag::LogChannel) << string_format("New task: t=%llx N=%llu", task->GetTask()->main_time << 16 | 0xffff, _taskProcessor->GetCount()); #ifdef _TEST_TASKS _taskProcessor->DumpTasks(); -#endif - _ndata = 0; - _maxndata = sizeof(struct cheatcoin_field); - +#endif // _DEBUG #ifdef _DEBUG std::cout << "State:" << std::endl; DumpHex((uint8_t*)task->GetTask()->ctx.state, 32); @@ -183,9 +83,8 @@ void XPool::OnNewTask(cheatcoin_field* data) DumpHex(task->GetTask()->ctx.data, 56); std::cout << "Start nonce: " << task->GetTask()->lastfield.amount << std::endl; std::cout << "Start minhash:" << std::endl; - DumpHex((uint8_t*)task->GetTask()->minhash.data, 32); std::cout << HashToHexString(task->GetTask()->minhash.data) << std::endl; -#endif +#endif // _DEBUG } bool XPool::SendTaskResult() @@ -194,81 +93,22 @@ bool XPool::SendTaskResult() { return true; } - bool success; - bool isReady = _network.IsReady(NetworkAction::Write, 0, success); - if(!success) - { - return false; - } - if(!isReady) - { - return true; - } - - cheatcoin_pool_task *task = _taskProcessor->GetCurrentTask()->GetTask(); - uint64_t *hash = task->minhash.data; - _lastShareTime = time(0); - memcpy(_lastHash, hash, sizeof(cheatcoin_hash_t)); - bool res = SendToPool(&task->lastfield, 1); - clog(XDag::LogChannel) << string_format("Share t=%llx res=%s\n%016llx%016llx%016llx%016llx", - task->main_time << 16 | 0xffff, res ? "OK" : "Fail", hash[3], hash[2], hash[1], hash[0]); - if(!res) - { - clog(XDag::LogChannel) << "Failed to send task result"; - return false; - } - return true; -} - -bool XPool::SendToPool(cheatcoin_field *fields, int fieldCount) -{ - cheatcoin_field fieldsCopy[CHEATCOIN_BLOCK_FIELDS]; - cheatcoin_hash_t hash; - int todo = fieldCount * sizeof(struct cheatcoin_field), done = 0; - if(!_network.IsConnected()) + return _currentConnection->WriteTaskData([this]() { - return false; - } - memcpy(fieldsCopy, fields, todo); - if(fieldCount == CHEATCOIN_BLOCK_FIELDS) - { - uint32_t crc; - fieldsCopy[0].transport_header = 0; - XHash::GetHash(fieldsCopy, sizeof(struct cheatcoin_block), hash); - fieldsCopy[0].transport_header = HEADER_WORD; - crc = crc_of_array((uint8_t *)fieldsCopy, sizeof(struct cheatcoin_block)); - fieldsCopy[0].transport_header |= (uint64_t)crc << 32; - } - for(int i = 0; i < fieldCount; ++i) - { - dfslib_encrypt_array(_crypt, (uint32_t *)(fieldsCopy + i), DATA_SIZE, _localMiner.nfield_out++); - } - while(todo) - { - bool success; - bool isReady = _network.IsReady(NetworkAction::Write, 1000, success); - if(!success) - { - return false; - } - if(!isReady) - { - continue; - } - int res = _network.Write((char*)fieldsCopy + done, todo); - if(res <= 0) + cheatcoin_pool_task *task = _taskProcessor->GetCurrentTask()->GetTask(); + uint64_t *hash = task->minhash.data; + _lastShareTime = time(0); + memcpy(_lastHash, hash, sizeof(cheatcoin_hash_t)); + bool res = _currentConnection->SendToPool(&task->lastfield, 1); + clog(XDag::LogChannel) << string_format("Share t=%llx res=%s\n%016llx%016llx%016llx%016llx", + task->main_time << 16 | 0xffff, res ? "OK" : "Fail", hash[3], hash[2], hash[1], hash[0]); + if(!res) { + clog(XDag::LogChannel) << "Failed to send task result"; return false; } - done += res, todo -= res; - } - - if(fieldCount == CHEATCOIN_BLOCK_FIELDS) - { - clog(XDag::LogChannel) << string_format("Sent block info t=%llx res=OK\n%016llx%016llx%016llx%016llx", - fields[0].time, hash[3], hash[2], hash[1], hash[0]); - } - return true; + return true; + }); } bool XPool::HasNewShare() diff --git a/GpuMiner/XDagCore/XPool.h b/GpuMiner/XDagCore/XPool.h index 74fd00f..25e3d6a 100644 --- a/GpuMiner/XDagCore/XPool.h +++ b/GpuMiner/XDagCore/XPool.h @@ -1,60 +1,19 @@ #pragma once -#include "XNetwork.h" +#include "XPoolConnection.h" #include "XBlock.h" #include "XTaskProcessor.h" -#include "dfstools/dfslib_crypt.h" - -#define CHEATCOIN_POOL_N_CONFIRMATIONS 16 -#define N_MINERS 4096 -#define START_N_MINERS 256 -#define START_N_MINERS_IP 8 -#define N_CONFIRMATIONS CHEATCOIN_POOL_N_CONFIRMATIONS -#define MINERS_PWD "minersgonnamine" -#define SECTOR0_BASE 0x1947f3acu -#define SECTOR0_OFFSET 0x82e9d1b5u -#define HEADER_WORD 0x3fca9e2bu -#define DATA_SIZE (sizeof(struct cheatcoin_field) / sizeof(uint32_t)) -#define SEND_PERIOD 10 //result send period - -struct miner -{ - double maxdiff[N_CONFIRMATIONS]; - cheatcoin_field id; - uint32_t data[DATA_SIZE]; - double prev_diff; - cheatcoin_time_t main_time; - uint64_t nfield_in; - uint64_t nfield_out; - uint64_t ntask; - cheatcoin_block *block; - uint32_t ip; - uint16_t port; - uint16_t state; - uint8_t data_size; - uint8_t block_size; -}; -struct cheatcoin_block; class XPool { private: - cheatcoin_hash_t _addressHash; char _poolAddress[256]; - XNetwork _network; - miner _localMiner; + XPoolConnection _connection; + XPoolConnection* _currentConnection; XTaskProcessor *_taskProcessor; - //TODO: move out of here - dfslib_crypt *_crypt; cheatcoin_hash_t _lastHash; time_t _taskTime; time_t _lastShareTime; - //TODO: the purpose of these properties is unclear for me now, just copy-paste... - int _ndata, _maxndata; - cheatcoin_block _firstBlock; - - bool SendToPool(cheatcoin_field *fields, int fieldCount); - bool InitCrypto(); bool CheckNewTasks(); bool SendTaskResult(); @@ -64,7 +23,6 @@ class XPool XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcessor *taskProcessor); virtual ~XPool(); - bool Initialize(); bool Connect(); void Disconnect(); bool Interract(); diff --git a/GpuMiner/XDagCore/XPoolConnection.cpp b/GpuMiner/XDagCore/XPoolConnection.cpp new file mode 100644 index 0000000..06f7547 --- /dev/null +++ b/GpuMiner/XDagCore/XPoolConnection.cpp @@ -0,0 +1,207 @@ +#include "XPoolConnection.h" +#include "XAddress.h" +#include "XBlock.h" +#include "Core/Log.h" +#include "dfstools/dfslib_crypt.h" +#include "dar/crc.h" + +#define SECTOR0_BASE 0x1947f3acu +#define SECTOR0_OFFSET 0x82e9d1b5u +#define HEADER_WORD 0x3fca9e2bu +#define MINERS_PWD "minersgonnamine" +#define DATA_SIZE (sizeof(struct cheatcoin_field) / sizeof(uint32_t)) + +XPoolConnection::XPoolConnection() +{ + _localMiner.nfield_in = 0; + _localMiner.nfield_out = 0; +} + +XPoolConnection::XPoolConnection(std::string& accountAddress) +{ + SetAddress(accountAddress); +} + +XPoolConnection::~XPoolConnection() +{ + if(!_crypt) + { + free(_crypt); + _crypt = NULL; + } +} + +void XPoolConnection::SetAddress(std::string& accountAddress) +{ + XAddress::AddressToHash(accountAddress.c_str(), _addressHash); +} + +bool XPoolConnection::InitCrypto() +{ + dfslib_string str; + uint32_t sector[128]; + _crypt = (dfslib_crypt*)malloc(sizeof(struct dfslib_crypt)); + if(!_crypt) + { + return false; + } + dfslib_crypt_set_password(_crypt, dfslib_utf8_string(&str, MINERS_PWD, (uint32_t)strlen(MINERS_PWD))); + for(int i = 0; i < 128; ++i) + { + sector[i] = SECTOR0_BASE + i * SECTOR0_OFFSET; + } + for(int i = 0; i < 128; ++i) + { + dfslib_crypt_set_sector0(_crypt, sector); + dfslib_encrypt_sector(_crypt, sector, SECTOR0_BASE + i * SECTOR0_OFFSET); + } + return true; +} + +bool XPoolConnection::Initialize() +{ + if(!InitCrypto()) + { + clog(XDag::LogChannel) << "Failed to initialize cryptography system"; + return false; + } + return XConnection::Initialize(); +} + +bool XPoolConnection::Connect(const char *address) +{ + _localMiner.nfield_in = 0; + _localMiner.nfield_out = 0; + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); + if(!XConnection::Connect(address)) + { + return false; + } + cheatcoin_block block; + XBlock::GenerateFakeBlock(&block); + if(!SendToPool(block.field, CHEATCOIN_BLOCK_FIELDS)) + { + return false; + } + return true; +} + +bool XPoolConnection::SendToPool(cheatcoin_field *fields, int fieldCount) +{ + cheatcoin_field fieldsCopy[CHEATCOIN_BLOCK_FIELDS]; + cheatcoin_hash_t hash; + int todo = fieldCount * sizeof(struct cheatcoin_field), done = 0; + if(!IsConnected()) + { + return false; + } + memcpy(fieldsCopy, fields, todo); + if(fieldCount == CHEATCOIN_BLOCK_FIELDS) + { + uint32_t crc; + fieldsCopy[0].transport_header = 0; + XHash::GetHash(fieldsCopy, sizeof(struct cheatcoin_block), hash); + fieldsCopy[0].transport_header = HEADER_WORD; + crc = crc_of_array((uint8_t *)fieldsCopy, sizeof(struct cheatcoin_block)); + fieldsCopy[0].transport_header |= (uint64_t)crc << 32; + } + for(int i = 0; i < fieldCount; ++i) + { + dfslib_encrypt_array(_crypt, (uint32_t *)(fieldsCopy + i), DATA_SIZE, _localMiner.nfield_out++); + } + while(todo) + { + bool success; + bool isReady = IsReady(NetworkAction::Write, 1000, success); + if(!success) + { + return false; + } + if(!isReady) + { + continue; + } + int res = Write((char*)fieldsCopy + done, todo); + if(res <= 0) + { + return false; + } + done += res, todo -= res; + } + return true; +} + +bool XPoolConnection::ReadTaskData(std::function onNewTask) +{ + cheatcoin_field recievedTaskData[2]; + bool taskIsRecieved = false; + do + { + bool success; + // TODO: think about exceptions instead of failure flag + bool isReady = IsReady(NetworkAction::Read, 0, success); + if(!success) + { + return false; + } + if(!isReady) + { + break; + } + int res = Read((char*)_dataBuffer + _readDataSize, _readDataLimit - _readDataSize); + if(res <= 0) + { + clog(XDag::LogChannel) << "Failed to read data from pool"; + return false; + } + _readDataSize += res; + if(_readDataSize == _readDataLimit) + { + cheatcoin_field *last = _dataBuffer + (_readDataSize / sizeof(struct cheatcoin_field) - 1); + dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); + if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) + { + // if returned data contains hash of account address - pool sent information about incoming transfer + // we just ignore it + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); + } + else if(_readDataLimit == 2 * sizeof(struct cheatcoin_field)) + { + memcpy(recievedTaskData, _dataBuffer, _readDataLimit); + taskIsRecieved = true; + _readDataSize = 0; + _readDataLimit = sizeof(struct cheatcoin_field); + } + else + { + _readDataLimit = 2 * sizeof(struct cheatcoin_field); + } + } + } + while(true); + + if(taskIsRecieved) + { + onNewTask(recievedTaskData); + } + + return true; +} + +bool XPoolConnection::WriteTaskData(std::function onSendTask) +{ + bool success; + bool isReady = IsReady(NetworkAction::Write, 0, success); + if(!success) + { + return false; + } + if(!isReady) + { + return true; + } + + return onSendTask(); +} \ No newline at end of file diff --git a/GpuMiner/XDagCore/XPoolConnection.h b/GpuMiner/XDagCore/XPoolConnection.h new file mode 100644 index 0000000..d3b8d6e --- /dev/null +++ b/GpuMiner/XDagCore/XPoolConnection.h @@ -0,0 +1,40 @@ +#pragma once + +#include "XConnection.h" +#include "XBlock.h" +#include + +struct miner +{ + uint64_t nfield_in; + uint64_t nfield_out; +}; + +struct dfslib_crypt; + +class XPoolConnection : public XConnection +{ +private: + cheatcoin_hash_t _addressHash; + miner _localMiner; + dfslib_crypt *_crypt; + + int _readDataSize, _readDataLimit; + cheatcoin_field _dataBuffer[2]; + + bool InitCrypto(); +public: + XPoolConnection(); + XPoolConnection(std::string& accountAddress); + virtual ~XPoolConnection(); + + void SetAddress(std::string& accountAddress); + virtual bool Initialize(); + virtual bool Connect(const char *address); + uint64_t* GetAddressHash() { return _addressHash; } + + bool ReadTaskData(std::function onNewTask); + bool WriteTaskData(std::function onSendTask); + bool SendToPool(cheatcoin_field *fields, int fieldCount); +}; + diff --git a/GpuMiner/XDagCore/XTaskWrapper.cpp b/GpuMiner/XDagCore/XTaskWrapper.cpp index 9732013..4f747cc 100644 --- a/GpuMiner/XDagCore/XTaskWrapper.cpp +++ b/GpuMiner/XDagCore/XTaskWrapper.cpp @@ -28,7 +28,7 @@ void XTaskWrapper::FillAndPrecalc(cheatcoin_field* data, cheatcoin_hash_t addres memcpy(_task.nonce.data, addressHash, sizeof(cheatcoin_hashlow_t)); memcpy(_task.lastfield.data, _task.nonce.data, sizeof(cheatcoin_hash_t)); - //we manually increase the target difficulty of shares + //we manually set the initial target difficulty of shares memset(_task.minhash.data, 0xff, 24); _task.minhash.data[3] = 0x000008ffffffffff; diff --git a/GpuMiner/main.cpp b/GpuMiner/main.cpp index 9438575..11ff53b 100644 --- a/GpuMiner/main.cpp +++ b/GpuMiner/main.cpp @@ -1,8 +1,6 @@ #ifdef _WIN32 #include #endif -#include -#include #include #include "Core/Log.h" #include "Core/MinerManager.h" @@ -32,20 +30,20 @@ int main(int argc, char** argv) MinerManager miner(MinerManager::OperationMode::None); - for(int i = 1; i < argc; ++i) + for (int i = 1; i < argc; ++i) { // Mining options: - if(miner.InterpretOption(i, argc, argv)) + if (miner.InterpretOption(i, argc, argv)) { continue; } std::string arg = argv[i]; - if((arg == "-v" || arg == "--verbosity") && i + 1 < argc) + if ((arg == "-v" || arg == "--verbosity") && i + 1 < argc) { g_logVerbosity = atoi(argv[++i]); } - else if(arg == "-h" || arg == "--help") + else if (arg == "-h" || arg == "--help") { Help(); } @@ -56,7 +54,7 @@ int main(int argc, char** argv) } } - if(!miner.CheckMandatoryParams()) + if (!miner.CheckMandatoryParams()) { std::cerr << "Invalid arguments" << std::endl; exit(-1); From 2f128bf99750abe6c072a0ecf106f45cce0edc1c Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Sat, 10 Mar 2018 17:09:45 +0300 Subject: [PATCH 10/41] New parameter "-vectors". Delay time is added to "-nvidia-fix" command. --- GpuMiner/Core/MinerManager.cpp | 21 +++++++++++-- GpuMiner/Core/MinerManager.h | 2 ++ GpuMiner/MinerEngine/CLMiner.cpp | 51 ++++++++++++++++---------------- GpuMiner/MinerEngine/CLMiner.h | 24 +++++++++++---- 4 files changed, 65 insertions(+), 33 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index 8dd3b3c..a2c42f1 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -168,6 +168,21 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) else if(arg == "-nvidia-fix") { _useNvidiaFix = true; + if(i + 1 < argc) + { + try + { + _nvidiaSpeedDamp = stol(argv[i + 1]); + ++i; + } + catch (...) + { + } + } + } + else if(arg == "-vectors") + { + _useVectors = true; } else { @@ -230,11 +245,12 @@ void MinerManager::StreamHelp(ostream& _out) << " -t Set number of CPU threads to n (default: the number of threads is equal to number of cores)." << endl << " -d Limit number of used GPU devices to n (default: use everything available on selected platform)." << endl << " -list-devices List the detected devices and exit. Should be combined with -G or -cpu flag." << endl - << " -nvidia-fix Use workaround on high cpu usage with nvidia cards." << endl + << " -nvidia-fix Use workaround on high cpu usage with nvidia cards. n - optional value of thread sleep time, should be 0-95. (default: 90)" << endl << endl << " OpenCL configuration:" << endl << " -cl-local-work Set the OpenCL local work size. Default is " << CLMiner::_defaultLocalWorkSize << endl << " -cl-global-work Set the OpenCL global work size as a multiple of the local work size. Default is " << CLMiner::_defaultGlobalWorkSizeMultiplier << " * " << CLMiner::_defaultLocalWorkSize << endl + << " -vectors Sets OpenCL to use vector mathematics" << endl << endl << "For test purposes: " << endl << " -opencl-cpu Use CPU as OpenCL device." << endl @@ -393,7 +409,8 @@ void MinerManager::ConfigureGpu() } CLMiner::SetNumInstances(_openclMiningDevices); - CLMiner::SetUseNvidiaFix(_useNvidiaFix); + CLMiner::SetUseNvidiaFix(_useNvidiaFix, _nvidiaSpeedDamp); + CLMiner::SetUseVectors(_useVectors); } void MinerManager::ConfigureCpu() diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index 6aa722a..73d62ed 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -74,6 +74,8 @@ class MinerManager unsigned _globalWorkSizeMultiplier = CLMiner::_defaultGlobalWorkSizeMultiplier; unsigned _localWorkSize = CLMiner::_defaultLocalWorkSize; bool _useNvidiaFix = false; + uint32_t _nvidiaSpeedDamp = CLMiner::_defaultNvidiaSpinDamp; + bool _useVectors = false; /// Benchmarking params unsigned _benchmarkWarmup = 15; diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index 17203a5..e020b6c 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -20,10 +20,7 @@ using namespace XDag; #define KERNEL_ARG_TARGET_H 4 #define KERNEL_ARG_TARGET_G 5 #define KERNEL_ARG_OUTPUT 6 -//TODO: weird, but it decreases performance... -//#define USE_VECTORS #define KERNEL_ITERATIONS 16 -#define NVIDIA_SPIN_DAMP 0.9 unsigned CLMiner::_sWorkgroupSize = CLMiner::_defaultLocalWorkSize; unsigned CLMiner::_sInitialGlobalWorkSize = CLMiner::_defaultGlobalWorkSizeMultiplier * CLMiner::_defaultLocalWorkSize; @@ -34,6 +31,8 @@ std::string CLMiner::_clKernelName = "CLMiner_kernel.cl"; #endif bool CLMiner::_useOpenClCpu = false; bool CLMiner::_useNvidiaFix = false; +double CLMiner::_nvidiaSpinDamp = CLMiner::_defaultNvidiaSpinDamp / 100.0; +bool CLMiner::_useVectors = false; struct CLChannel : public LogChannel { @@ -456,12 +455,13 @@ bool CLMiner::Initialize() { AddDefinition(_kernelCode, "BFI_INT", 1); } -#ifdef USE_VECTORS - AddDefinition(_kernelCode, "VECTORS", 1); -#endif // USE_VECTORS + if(_useVectors) + { + AddDefinition(_kernelCode, "VECTORS", 1); + } // create miner OpenCL program - cl::Program::Sources sources { { _kernelCode.data(), _kernelCode.size() } }; + cl::Program::Sources sources{ { _kernelCode.data(), _kernelCode.size() } }; cl::Program program(_context, sources); try { @@ -582,12 +582,11 @@ void CLMiner::WorkLoop() _searchKernel.setArg(KERNEL_ARG_TARGET_G, ((uint32_t*)taskWrapper->GetTask()->minhash.data)[6]); } - uint32_t hashesProcessed; -#ifdef USE_VECTORS - hashesProcessed = _globalWorkSize * 2 * KERNEL_ITERATIONS; -#else - hashesProcessed = _globalWorkSize * KERNEL_ITERATIONS; -#endif // USE_VECTORS + uint32_t hashesProcessed = _globalWorkSize * KERNEL_ITERATIONS; + if(_useVectors) + { + hashesProcessed <<= 1; + } // Increase start nonce for following kernel execution. nonce += hashesProcessed; @@ -639,18 +638,18 @@ void CLMiner::ListDevices(bool useOpenClCpu) outString += "\tCL_DEVICE_TYPE: "; switch(device.getInfo()) { - case CL_DEVICE_TYPE_CPU: - outString += "CPU\n"; - break; - case CL_DEVICE_TYPE_GPU: - outString += "GPU\n"; - break; - case CL_DEVICE_TYPE_ACCELERATOR: - outString += "ACCELERATOR\n"; - break; - default: - outString += "DEFAULT\n"; - break; + case CL_DEVICE_TYPE_CPU: + outString += "CPU\n"; + break; + case CL_DEVICE_TYPE_GPU: + outString += "GPU\n"; + break; + case CL_DEVICE_TYPE_ACCELERATOR: + outString += "ACCELERATOR\n"; + break; + default: + outString += "DEFAULT\n"; + break; } outString += "\tCL_DEVICE_GLOBAL_MEM_SIZE: " + std::to_string(device.getInfo()) + "\n"; outString += "\tCL_DEVICE_MAX_MEM_ALLOC_SIZE: " + std::to_string(device.getInfo()) + "\n"; @@ -777,6 +776,6 @@ void CLMiner::ReadData(uint64_t* results) _queue.enqueueReadBuffer(_searchBuffer, CL_TRUE, 0, (OUTPUT_SIZE + 1) * sizeof(uint64_t), results); auto endTime = std::chrono::high_resolution_clock::now(); std::chrono::microseconds duration = std::chrono::duration_cast(endTime - startTime); - _kernelExecutionMcs = (uint32_t)((_kernelExecutionMcs + duration.count()) * NVIDIA_SPIN_DAMP); + _kernelExecutionMcs = (uint32_t)((_kernelExecutionMcs + duration.count()) * _nvidiaSpinDamp); } } diff --git a/GpuMiner/MinerEngine/CLMiner.h b/GpuMiner/MinerEngine/CLMiner.h index 9396910..9f69802 100644 --- a/GpuMiner/MinerEngine/CLMiner.h +++ b/GpuMiner/MinerEngine/CLMiner.h @@ -38,10 +38,12 @@ namespace XDag { public: /* -- default values -- */ - /// Default value of the local work size. Also known as workgroup size. + // Default value of the local work size. Also known as workgroup size. static const uint32_t _defaultLocalWorkSize = 128; - /// Default value of the global work size as a multiplier of the local work size + // Default value of the global work size as a multiplier of the local work size static const uint32_t _defaultGlobalWorkSizeMultiplier = 8192; + // Defauld value of the damp for nvidia bug workaround + static const uint32_t _defaultNvidiaSpinDamp = 90; CLMiner(uint32_t index, XTaskProcessor* taskProcessor); virtual ~CLMiner(); @@ -63,7 +65,16 @@ namespace XDag _devices[i] = devices[i]; } } - static void SetUseNvidiaFix(bool useNvidiaFix) { _useNvidiaFix = useNvidiaFix; } + static void SetUseNvidiaFix(bool useNvidiaFix, int nvidiaSpinDamp) + { + _useNvidiaFix = useNvidiaFix; + if(nvidiaSpinDamp >= 0 && nvidiaSpinDamp <= 95) + { + _nvidiaSpinDamp = nvidiaSpinDamp / 100.0; + } + } + + static void SetUseVectors(bool useVectors) { _useVectors = useVectors; } bool Initialize() override; HwMonitor Hwmon() override; @@ -94,10 +105,13 @@ namespace XDag static int _devices[MAX_CL_DEVICES]; static bool _useOpenClCpu; static bool _useNvidiaFix; + static bool _useVectors; - /// The local work size for the search + // The local work size for the search static uint32_t _sWorkgroupSize; - /// The initial global work size for the searches + // The initial global work size for the searches static uint32_t _sInitialGlobalWorkSize; + // The damp value for nvidia bug workaround + static double _nvidiaSpinDamp; }; } From 047d95495f0e1f3c403c4c42dc6bda397979e8e9 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Sat, 10 Mar 2018 19:00:08 +0300 Subject: [PATCH 11/41] Restarting GPU on OpenCL error --- GpuMiner/MinerEngine/CLMiner.cpp | 162 +++++++++++++++++-------------- GpuMiner/MinerEngine/CLMiner.h | 1 + 2 files changed, 90 insertions(+), 73 deletions(-) diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index e020b6c..78578cd 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -22,8 +22,10 @@ using namespace XDag; #define KERNEL_ARG_OUTPUT 6 #define KERNEL_ITERATIONS 16 -unsigned CLMiner::_sWorkgroupSize = CLMiner::_defaultLocalWorkSize; -unsigned CLMiner::_sInitialGlobalWorkSize = CLMiner::_defaultGlobalWorkSizeMultiplier * CLMiner::_defaultLocalWorkSize; +#define MAX_GPU_ERROR_COUNT 3 + +uint32_t CLMiner::_sWorkgroupSize = CLMiner::_defaultLocalWorkSize; +uint32_t CLMiner::_sInitialGlobalWorkSize = CLMiner::_defaultGlobalWorkSizeMultiplier * CLMiner::_defaultLocalWorkSize; #ifdef __linux__ std::string CLMiner::_clKernelName = "CL/CLMiner_kernel.cl"; #else @@ -310,7 +312,7 @@ bool CLMiner::ConfigureGPU( } std::vector devices = GetDevices(platforms, _selectedPlatformId, _useOpenClCpu); - if(devices.size() == 0) + if(devices.empty()) { XCL_LOG("No OpenCL devices found."); return false; @@ -501,6 +503,31 @@ bool CLMiner::Initialize() } void CLMiner::WorkLoop() +{ + int errorCount = 0; + while(errorCount < MAX_GPU_ERROR_COUNT) + { + try + { + InternalWorkLook(errorCount); + break; + } + catch(cl::Error const& _e) + { + cwarn << XDagCLErrorHelper("OpenCL Error", _e); + if(++errorCount < MAX_GPU_ERROR_COUNT) + { + cwarn << "GPU will be restarted"; + if(!Initialize()) + { + break; + } + } + } + } +} + +void CLMiner::InternalWorkLook(int& errorCount) { cheatcoin_field last; uint64_t prevTaskIndex = 0; @@ -511,94 +538,83 @@ void CLMiner::WorkLoop() uint64_t zeroBuffer[OUTPUT_SIZE + 1]; memset(zeroBuffer, 0, (OUTPUT_SIZE + 1) * sizeof(uint64_t)); - try + while(!ShouldStop()) { - while(true) + XTaskWrapper* taskWrapper = GetTask(); + if(taskWrapper == NULL) + { + clog(LogChannel) << "No work. Pause for 3 s."; + std::this_thread::sleep_for(std::chrono::seconds(3)); + continue; + } + + if(taskWrapper->GetIndex() != prevTaskIndex) { - // Check if we should stop. - if(ShouldStop()) + //new task came, we have to finish current task and reload all data + if(prevTaskIndex > 0) { - // Make sure the last buffer write has finished -- - // it reads local variable. _queue.finish(); - break; } - XTaskWrapper* taskWrapper = GetTask(); - if(taskWrapper == NULL) - { - clog(LogChannel) << "No work. Pause for 3 s."; - std::this_thread::sleep_for(std::chrono::seconds(3)); - continue; - } + prevTaskIndex = taskWrapper->GetIndex(); + loopCounter = 0; + memcpy(last.data, taskWrapper->GetTask()->nonce.data, sizeof(cheatcoin_hash_t)); + nonce = last.amount + _index * 1000000000000;//TODO: think of nonce increment - if(taskWrapper->GetIndex() != prevTaskIndex) - { - //new task came, we have to finish current task and reload all data - if(prevTaskIndex > 0) - { - _queue.finish(); - } - - prevTaskIndex = taskWrapper->GetIndex(); - loopCounter = 0; - memcpy(last.data, taskWrapper->GetTask()->nonce.data, sizeof(cheatcoin_hash_t)); - nonce = last.amount + _index * 1000000000000;//TODO: think of nonce increment + WriteKernelArgs(taskWrapper, zeroBuffer); + } - WriteKernelArgs(taskWrapper, zeroBuffer); - } + bool hasSolution = false; + if(loopCounter > 0) + { + // Read results. + ReadData(results); + errorCount = 0; - bool hasSolution = false; - if(loopCounter > 0) + //miner return an array with 17 64-bit values. If nonce for hash lower than target hash is found - it is written to array. + //the first value in array contains count of found solutions + hasSolution = results[0] > 0; + if(hasSolution) { - // Read results. - ReadData(results); - - //miner return an array with 17 64-bit values. If nonce for hash lower than target hash is found - it is written to array. - //the first value in array contains count of found solutions - hasSolution = results[0] > 0; - if(hasSolution) - { - // Reset search buffer if any solution found. - _queue.enqueueWriteBuffer(_searchBuffer, CL_FALSE, 0, sizeof(zeroBuffer), zeroBuffer); - } + // Reset search buffer if any solution found. + _queue.enqueueWriteBuffer(_searchBuffer, CL_FALSE, 0, sizeof(zeroBuffer), zeroBuffer); } + } - // Run the kernel. - _searchKernel.setArg(KERNEL_ARG_NONCE, nonce); - _queue.enqueueNDRangeKernel(_searchKernel, cl::NullRange, _globalWorkSize, _workgroupSize); + // Run the kernel. + _searchKernel.setArg(KERNEL_ARG_NONCE, nonce); + _queue.enqueueNDRangeKernel(_searchKernel, cl::NullRange, _globalWorkSize, _workgroupSize); - // Report results while the kernel is running. - // It takes some time because hashes must be re-evaluated on CPU. - if(hasSolution) - { - //we need to recalculate hashes for all founded nonces and choose the minimal one - SetMinShare(taskWrapper, results, last); + // Report results while the kernel is running. + // It takes some time because hashes must be re-evaluated on CPU. + if(hasSolution) + { + //we need to recalculate hashes for all founded nonces and choose the minimal one + SetMinShare(taskWrapper, results, last); #ifdef _DEBUG - std::cout << HashToHexString(taskWrapper->GetTask()->minhash.data) << std::endl; + std::cout << HashToHexString(taskWrapper->GetTask()->minhash.data) << std::endl; #endif - //new minimal hash is written as target hash for GPU - _searchKernel.setArg(KERNEL_ARG_TARGET_H, ((uint32_t*)taskWrapper->GetTask()->minhash.data)[7]); - _searchKernel.setArg(KERNEL_ARG_TARGET_G, ((uint32_t*)taskWrapper->GetTask()->minhash.data)[6]); - } - - uint32_t hashesProcessed = _globalWorkSize * KERNEL_ITERATIONS; - if(_useVectors) - { - hashesProcessed <<= 1; - } + //new minimal hash is written as target hash for GPU + _searchKernel.setArg(KERNEL_ARG_TARGET_H, ((uint32_t*)taskWrapper->GetTask()->minhash.data)[7]); + _searchKernel.setArg(KERNEL_ARG_TARGET_G, ((uint32_t*)taskWrapper->GetTask()->minhash.data)[6]); + } - // Increase start nonce for following kernel execution. - nonce += hashesProcessed; - // Report hash count - AddHashCount(hashesProcessed); - ++loopCounter; + uint32_t hashesProcessed = _globalWorkSize * KERNEL_ITERATIONS; + if(_useVectors) + { + hashesProcessed <<= 1; } + + // Increase start nonce for following kernel execution. + nonce += hashesProcessed; + // Report hash count + AddHashCount(hashesProcessed); + ++loopCounter; } - catch(cl::Error const& _e) - { - cwarn << XDagCLErrorHelper("OpenCL Error", _e); - } + + // Make sure the last buffer write has finished -- + // it reads local variable. + _queue.finish(); } uint32_t CLMiner::GetNumDevices() diff --git a/GpuMiner/MinerEngine/CLMiner.h b/GpuMiner/MinerEngine/CLMiner.h index 9f69802..1fd51b4 100644 --- a/GpuMiner/MinerEngine/CLMiner.h +++ b/GpuMiner/MinerEngine/CLMiner.h @@ -78,6 +78,7 @@ namespace XDag bool Initialize() override; HwMonitor Hwmon() override; + void InternalWorkLook(int& errorCount); private: void WorkLoop() override; From 9450a92d85f3fd52befd55aa15a8dfc91791ab8f Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Sat, 10 Mar 2018 19:05:02 +0300 Subject: [PATCH 12/41] Version 0.2.4 --- GpuMiner/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GpuMiner/version.h b/GpuMiner/version.h index e1dd667..55bc940 100644 --- a/GpuMiner/version.h +++ b/GpuMiner/version.h @@ -3,7 +3,7 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 2 -#define VERSION_REVISION 3 +#define VERSION_REVISION 4 #define VER_FILE_DESCRIPTION_STR "Standalone GPU/CPU miner for Dagger coin" #define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION From 1abb306571b1ba1531b6134aa6d6a1e80e8273d8 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Sun, 11 Mar 2018 00:42:27 +0800 Subject: [PATCH 13/41] mac port for opencl --- GpuMiner/GpuMiner.xcodeproj/project.pbxproj | 23 +++++++--- GpuMiner/MinerEngine/CLMiner.cpp | 49 ++++++++++++++++----- GpuMiner/MinerEngine/CLMiner.h | 3 +- GpuMiner/Utils/PathUtils.cpp | 13 ++---- GpuMiner/XDagCore/XNetwork.cpp | 2 +- GpuMiner/XDagCore/XNetwork.h | 2 +- 6 files changed, 62 insertions(+), 30 deletions(-) diff --git a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj index 98b7a75..9087bec 100644 --- a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj +++ b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj @@ -97,17 +97,20 @@ 386386122042FD0200D2A207 /* libboost_date_time.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D22042FD0100D2A207 /* libboost_date_time.dylib */; }; 386386132042FD0200D2A207 /* libboost_math_tr1f-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */; }; 386386142042FD0200D2A207 /* libboost_wave-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */; }; + 38D36F8C2053FFA600B964C1 /* CLMiner_kernel.cl in Copy Files */ = {isa = PBXBuildFile; fileRef = 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - 38638420204275AA00D2A207 /* CopyFiles */ = { + 38638420204275AA00D2A207 /* Copy Files */ = { isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; + buildActionMask = 12; + dstPath = ./CL; + dstSubfolderSpec = 6; files = ( + 38D36F8C2053FFA600B964C1 /* CLMiner_kernel.cl in Copy Files */, ); - runOnlyForDeploymentPostprocessing = 1; + name = "Copy Files"; + runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ @@ -555,7 +558,7 @@ buildPhases = ( 3863841E204275AA00D2A207 /* Sources */, 3863841F204275AA00D2A207 /* Frameworks */, - 38638420204275AA00D2A207 /* CopyFiles */, + 38638420204275AA00D2A207 /* Copy Files */, ); buildRules = ( ); @@ -740,11 +743,13 @@ 3863842A204275AA00D2A207 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( __MACOS, "DEBUG=0", ); + GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)\"", /usr/local/opt/boost/include/, @@ -753,7 +758,9 @@ /usr/local/opt/boost/lib/, /usr/local/Cellar/boost/1.66.0/lib, ); + OPENCL_COMPILER_VERSION = CL1.2; PRODUCT_NAME = "$(TARGET_NAME)"; + STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)\" /usr/local/opt/boost/include/"; }; name = Debug; @@ -761,8 +768,10 @@ 3863842B204275AA00D2A207 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = __MACOS; + GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)\"", /usr/local/opt/boost/include/, @@ -771,7 +780,9 @@ /usr/local/opt/boost/lib/, /usr/local/Cellar/boost/1.66.0/lib, ); + OPENCL_COMPILER_VERSION = CL1.2; PRODUCT_NAME = "$(TARGET_NAME)"; + STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)\" /usr/local/opt/boost/include/"; }; name = Release; diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index 17203a5..c0374ff 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -295,7 +295,7 @@ bool CLMiner::ConfigureGPU( _selectedPlatformId = platformId; _useOpenClCpu = useOpenClCpu; - localWorkSize = ((localWorkSize + 7) / 8) * 8; + localWorkSize = ((localWorkSize + 7) / 8) * 8; _sWorkgroupSize = localWorkSize; _sInitialGlobalWorkSize = globalWorkSizeMultiplier * localWorkSize; @@ -372,6 +372,10 @@ bool CLMiner::Initialize() else if(platformName == "Clover") { _platformId = OPENCL_PLATFORM_CLOVER; + } + else if(platformName == "Apple") + { + _platformId = OPENCL_PLATFORM_APPLE; } } @@ -385,7 +389,10 @@ bool CLMiner::Initialize() // use selected device uint32_t deviceId = _devices[_index] > -1 ? _devices[_index] : _index; - cl::Device& device = devices[std::min(deviceId, (uint32_t)devices.size() - 1)]; + cl::Device& device = devices[std::min(deviceId, (uint32_t)devices.size() - 1)]; + if(_useOpenClCpu) { + device = devices[std::min(deviceId, 0)]; + } std::string device_version = device.getInfo(); cl::string name = device.getInfo(); boost::trim_right(name); @@ -443,11 +450,15 @@ bool CLMiner::Initialize() if(_globalWorkSize % _workgroupSize != 0) { _globalWorkSize = ((_globalWorkSize / _workgroupSize) + 1) * _workgroupSize; - } - - //AddDefinition(_kernelCode, "PLATFORM", platformId); - AddDefinition(_kernelCode, "OUTPUT_SIZE", OUTPUT_SIZE); - AddDefinition(_kernelCode, "ITERATIONS_COUNT", KERNEL_ITERATIONS); + } + +#if defined (__APPLE__)|| defined (__MACOS) + AddDefinition(_kernelCode, "__MACOS", 1); +#endif + + //AddDefinition(_kernelCode, "PLATFORM", platformId); + AddDefinition(_kernelCode, "OUTPUT_SIZE", OUTPUT_SIZE); + AddDefinition(_kernelCode, "ITERATIONS_COUNT", KERNEL_ITERATIONS); if(hasBitAlign) { AddDefinition(_kernelCode, "BITALIGN", 1); @@ -462,9 +473,9 @@ bool CLMiner::Initialize() // create miner OpenCL program cl::Program::Sources sources { { _kernelCode.data(), _kernelCode.size() } }; - cl::Program program(_context, sources); + cl::Program program(_context, sources); try - { + { program.build({ device }, options); cllog << "Build info:" << program.getBuildInfo(device); } @@ -472,9 +483,23 @@ bool CLMiner::Initialize() { cwarn << "Build info:" << program.getBuildInfo(device); return false; - } - - _searchKernel = cl::Kernel(program, "search_nonce"); + } + + + _searchKernel = cl::Kernel(program, "search_nonce"); + +#if defined (__APPLE__) || defined (__MACOS) + size_t local; + + int err; + err = clGetKernelWorkGroupInfo(_searchKernel.get(), device.get(), CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); + if (err != CL_SUCCESS) { + fprintf(stdout, "Error: Failed to retrieve kernel work group info! err: %d\n", err); + return false; + } + + _workgroupSize = (uint32_t)local; +#endif // create buffer for initial hashing state XCL_LOG("Creating buffer for initial hashing state."); diff --git a/GpuMiner/MinerEngine/CLMiner.h b/GpuMiner/MinerEngine/CLMiner.h index 9396910..24ad92c 100644 --- a/GpuMiner/MinerEngine/CLMiner.h +++ b/GpuMiner/MinerEngine/CLMiner.h @@ -28,7 +28,8 @@ #define OPENCL_PLATFORM_UNKNOWN 0 #define OPENCL_PLATFORM_NVIDIA 1 #define OPENCL_PLATFORM_AMD 2 -#define OPENCL_PLATFORM_CLOVER 3 +#define OPENCL_PLATFORM_CLOVER 3 +#define OPENCL_PLATFORM_APPLE 4 #define MAX_CL_DEVICES 16 diff --git a/GpuMiner/Utils/PathUtils.cpp b/GpuMiner/Utils/PathUtils.cpp index d16f548..0d63938 100644 --- a/GpuMiner/Utils/PathUtils.cpp +++ b/GpuMiner/Utils/PathUtils.cpp @@ -3,7 +3,7 @@ #include #include #include -#elif __MACOS +#elif defined (__APPLE__)|| defined (__MACOS) #include #elif _WIN32 #include @@ -18,13 +18,8 @@ std::string PathUtils::GetModuleFolder() } else { return ""; } -#elif __MACOS -// char result[1024]; -// if (readlink("/proc/self/exe", result, 1024) > 0) { -// return std::string(dirname(result)).append("/"); -// } else { -// return ""; -// } +#elif defined (__APPLE__)|| defined (__MACOS) + //fixme: temporal return ./CL/ return "./CL/"; #elif _WIN32 char szPath[MAX_PATH]; @@ -41,7 +36,7 @@ std::string PathUtils::GetModuleFolder() bool PathUtils::FileExists(const std::string& fname) { -#if defined (__linux__) || defined (__MACOS) +#if defined (__linux__) || defined (__APPLE__)|| defined (__MACOS) return access(fname.c_str(), F_OK) != -1; #elif _WIN32 return PathFileExists(fname.c_str()) == TRUE; diff --git a/GpuMiner/XDagCore/XNetwork.cpp b/GpuMiner/XDagCore/XNetwork.cpp index acade47..b4583e2 100644 --- a/GpuMiner/XDagCore/XNetwork.cpp +++ b/GpuMiner/XDagCore/XNetwork.cpp @@ -8,7 +8,7 @@ #include #include #include -#elif __MACOS +#elif defined (__APPLE__)|| defined (__MACOS) #include #include #include diff --git a/GpuMiner/XDagCore/XNetwork.h b/GpuMiner/XDagCore/XNetwork.h index 8d06348..2ed677f 100644 --- a/GpuMiner/XDagCore/XNetwork.h +++ b/GpuMiner/XDagCore/XNetwork.h @@ -4,7 +4,7 @@ #include "netinet/in.h" #include "sys/socket.h" typedef int SOCKET; -#elif __MACOS +#elif defined (__APPLE__)|| defined (__MACOS) #include "netinet/in.h" #include "sys/socket.h" typedef int SOCKET; From 1228c055d7c44e3b370e83f53a879d17a2667cfa Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Sun, 11 Mar 2018 01:10:22 +0800 Subject: [PATCH 14/41] update README.md for mac port --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a9e88db..da69d1c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ Launch parameters: 2) GPU mining: ./xdag-gpu -G -a -p 3) CPU mining: ./xdag-gpu -cpu -a -p -t 8 +Mac OS: +Install Boost with brew. +Open XCode project to build Mac OS version. + Workaround on issue with high CPU usage with NVIDIA GPUs. There is an issue with NVIDIA GPUs leading to very high CPU usage. The reason is improper implementation of OpenCL by NVIDIA. When CPU thread waits for results from GPU, it does not stop, it spins in loop eating CPU resources for nothing. There was impemented a workaround on this issue: before reading results from GPU current thread sleeps during small calculated time. CPU usage was decreased in 90%. The change made optional, use launch parameter "-nvidia-fix" to enable it. The change can decrease hashrate a bit in some cases. But GPU rigs should gain increase of hashrate. So try it and choose to use or not to use it. From 3a6b297a92ad44968acd0b71ea2cbe2e9a09201c Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Sun, 11 Mar 2018 15:47:32 +0800 Subject: [PATCH 15/41] remove useless definition and adjust the calculation for _workgroupSize --- GpuMiner/MinerEngine/CLMiner.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index c0374ff..2f6c944 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -442,19 +442,7 @@ bool CLMiner::Initialize() // create context _context = cl::Context(std::vector(&device, &device + 1)); - _queue = cl::CommandQueue(_context, device); - - // make sure that global work size is evenly divisible by the local workgroup size - _workgroupSize = _sWorkgroupSize; - _globalWorkSize = _sInitialGlobalWorkSize; - if(_globalWorkSize % _workgroupSize != 0) - { - _globalWorkSize = ((_globalWorkSize / _workgroupSize) + 1) * _workgroupSize; - } - -#if defined (__APPLE__)|| defined (__MACOS) - AddDefinition(_kernelCode, "__MACOS", 1); -#endif + _queue = cl::CommandQueue(_context, device); //AddDefinition(_kernelCode, "PLATFORM", platformId); AddDefinition(_kernelCode, "OUTPUT_SIZE", OUTPUT_SIZE); @@ -485,7 +473,6 @@ bool CLMiner::Initialize() return false; } - _searchKernel = cl::Kernel(program, "search_nonce"); #if defined (__APPLE__) || defined (__MACOS) @@ -493,13 +480,23 @@ bool CLMiner::Initialize() int err; err = clGetKernelWorkGroupInfo(_searchKernel.get(), device.get(), CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); - if (err != CL_SUCCESS) { + if (err != CL_SUCCESS) + { fprintf(stdout, "Error: Failed to retrieve kernel work group info! err: %d\n", err); return false; } - _workgroupSize = (uint32_t)local; -#endif + _workgroupSize = std::min(_sWorkgroupSize,(uint32_t)local); + _globalWorkSize = _sInitialGlobalWorkSize; +#else + _workgroupSize = _sWorkgroupSize; + _globalWorkSize = _sInitialGlobalWorkSize; +#endif + // make sure that global work size is evenly divisible by the local workgroup size + if(_globalWorkSize % _workgroupSize != 0) + { + _globalWorkSize = ((_globalWorkSize / _workgroupSize) + 1) * _workgroupSize; + } // create buffer for initial hashing state XCL_LOG("Creating buffer for initial hashing state."); From e58165437d7cad8cd5a5ac75f254606082ca5377 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Sun, 11 Mar 2018 23:14:38 +0800 Subject: [PATCH 16/41] update .gitignore --- .gitignore | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index cde737f..04b70b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,16 @@ -/**/*.o -/**/*~ -/.vs/ -/GpuMiner.VC.db -/GpuMiner/x64/ -/packages/ -/x64/ -/GpuMiner.VC.VC.opendb -GpuMiner/GpuMiner.vcxproj.user -GpuMiner/version.aps -/params.txt -/GpuMiner/Release/ -/Release/ -/Debug/ -/GpuMiner/Debug/ +/**/*.o +/**/*~ +/.vs/ +/GpuMiner.VC.db +/GpuMiner/x64/ +/packages/ +/x64/ +/GpuMiner.VC.VC.opendb +GpuMiner/GpuMiner.vcxproj.user +GpuMiner/version.aps +/params.txt +/GpuMiner/Release/ +/Release/ +/Debug/ +/GpuMiner/Debug/ +GpuMiner/GpuMiner.xcodeproj/project.xcworkspace From 5e7b3603515096bf12662fe129e4277a2ccf71be Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Tue, 13 Mar 2018 17:15:48 +0300 Subject: [PATCH 17/41] Resetting of GPU, size of output buffer is changed. --- GpuMiner/CL/CLMiner_kernel.cl | 1 - GpuMiner/MinerEngine/CLMiner.cpp | 54 ++++++++++++++++++++++++++------ GpuMiner/MinerEngine/CLMiner.h | 1 + 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/GpuMiner/CL/CLMiner_kernel.cl b/GpuMiner/CL/CLMiner_kernel.cl index 5f9d70a..9c12d05 100644 --- a/GpuMiner/CL/CLMiner_kernel.cl +++ b/GpuMiner/CL/CLMiner_kernel.cl @@ -506,7 +506,6 @@ __kernel void search_nonce(ulong startNonce, } ++nonce; #endif - } if(minH < targetH || (minH == targetH && minG <= targetG)) diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index 78578cd..06e9fdc 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -12,7 +12,7 @@ using namespace XDag; -#define OUTPUT_SIZE 16 +#define OUTPUT_SIZE 15 //15 positions in output buffer + 1 position for flag #define KERNEL_ARG_NONCE 0 #define KERNEL_ARG_STATE 1 #define KERNEL_ARG_PRECALC_STATE 2 @@ -387,6 +387,10 @@ bool CLMiner::Initialize() // use selected device uint32_t deviceId = _devices[_index] > -1 ? _devices[_index] : _index; cl::Device& device = devices[std::min(deviceId, (uint32_t)devices.size() - 1)]; + if(_useOpenClCpu) + { + device = devices[std::min(deviceId, 0)]; + } std::string device_version = device.getInfo(); cl::string name = device.getInfo(); boost::trim_right(name); @@ -438,14 +442,6 @@ bool CLMiner::Initialize() _context = cl::Context(std::vector(&device, &device + 1)); _queue = cl::CommandQueue(_context, device); - // make sure that global work size is evenly divisible by the local workgroup size - _workgroupSize = _sWorkgroupSize; - _globalWorkSize = _sInitialGlobalWorkSize; - if(_globalWorkSize % _workgroupSize != 0) - { - _globalWorkSize = ((_globalWorkSize / _workgroupSize) + 1) * _workgroupSize; - } - //AddDefinition(_kernelCode, "PLATFORM", platformId); AddDefinition(_kernelCode, "OUTPUT_SIZE", OUTPUT_SIZE); AddDefinition(_kernelCode, "ITERATIONS_COUNT", KERNEL_ITERATIONS); @@ -478,6 +474,29 @@ bool CLMiner::Initialize() _searchKernel = cl::Kernel(program, "search_nonce"); +#if defined (__APPLE__) || defined (__MACOS) + size_t local; + + int err; + err = clGetKernelWorkGroupInfo(_searchKernel.get(), device.get(), CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); + if (err != CL_SUCCESS) + { + fprintf(stdout, "Error: Failed to retrieve kernel work group info! err: %d\n", err); + return false; + } + + _workgroupSize = std::min(_sWorkgroupSize,(uint32_t)local); + _globalWorkSize = _sInitialGlobalWorkSize; +#else + _workgroupSize = _sWorkgroupSize; + _globalWorkSize = _sInitialGlobalWorkSize; +#endif + // make sure that global work size is evenly divisible by the local workgroup size + if(_globalWorkSize % _workgroupSize != 0) + { + _globalWorkSize = ((_globalWorkSize / _workgroupSize) + 1) * _workgroupSize; + } + // create buffer for initial hashing state XCL_LOG("Creating buffer for initial hashing state."); _stateBuffer = cl::Buffer(_context, CL_MEM_READ_ONLY, 32); @@ -502,6 +521,20 @@ bool CLMiner::Initialize() return true; } +void CLMiner::Reset() +{ + // pause for 0.5 sec + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + + _stateBuffer = cl::Buffer(); + _precalcStateBuffer = cl::Buffer(); + _dataBuffer = cl::Buffer(); + _searchBuffer = cl::Buffer(); + _searchKernel = cl::Kernel(); + _queue = cl::CommandQueue(); + _context = cl::Context(); +} + void CLMiner::WorkLoop() { int errorCount = 0; @@ -518,6 +551,7 @@ void CLMiner::WorkLoop() if(++errorCount < MAX_GPU_ERROR_COUNT) { cwarn << "GPU will be restarted"; + Reset(); if(!Initialize()) { break; @@ -571,7 +605,7 @@ void CLMiner::InternalWorkLook(int& errorCount) ReadData(results); errorCount = 0; - //miner return an array with 17 64-bit values. If nonce for hash lower than target hash is found - it is written to array. + //miner return an array with 16 64-bit values. If nonce for hash lower than target hash is found - it is written to array. //the first value in array contains count of found solutions hasSolution = results[0] > 0; if(hasSolution) diff --git a/GpuMiner/MinerEngine/CLMiner.h b/GpuMiner/MinerEngine/CLMiner.h index 1fd51b4..6ddd74e 100644 --- a/GpuMiner/MinerEngine/CLMiner.h +++ b/GpuMiner/MinerEngine/CLMiner.h @@ -86,6 +86,7 @@ namespace XDag void SetMinShare(XTaskWrapper* taskWrapper, uint64_t* searchBuffer, cheatcoin_field& last); void WriteKernelArgs(XTaskWrapper* taskWrapper, uint64_t* zeroBuffer); void ReadData(uint64_t* results); + void Reset(); cl::Context _context; cl::CommandQueue _queue; From 1201db65c5c9c642c8aec227d17151dd9078a3c5 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Tue, 13 Mar 2018 22:25:10 +0800 Subject: [PATCH 18/41] add missing files after refactory --- GpuMiner/GpuMiner.xcodeproj/project.pbxproj | 24 +++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj index 9087bec..ad7843c 100644 --- a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj +++ b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 3863857F2042EE6200D2A207 /* XAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385462042EE6100D2A207 /* XAddress.cpp */; }; 386385802042EE6200D2A207 /* XBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385482042EE6100D2A207 /* XBlock.cpp */; }; 386385812042EE6200D2A207 /* XHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863854A2042EE6100D2A207 /* XHash.cpp */; }; - 386385822042EE6200D2A207 /* XNetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863854D2042EE6100D2A207 /* XNetwork.cpp */; }; 386385832042EE6200D2A207 /* XPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863854F2042EE6100D2A207 /* XPool.cpp */; }; 386385842042EE6200D2A207 /* XTaskProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385512042EE6100D2A207 /* XTaskProcessor.cpp */; }; 386385852042EE6200D2A207 /* XTaskWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385532042EE6100D2A207 /* XTaskWrapper.cpp */; }; @@ -97,6 +96,9 @@ 386386122042FD0200D2A207 /* libboost_date_time.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D22042FD0100D2A207 /* libboost_date_time.dylib */; }; 386386132042FD0200D2A207 /* libboost_math_tr1f-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */; }; 386386142042FD0200D2A207 /* libboost_wave-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */; }; + 386FE36520581655001B661C /* XConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36020581654001B661C /* XConnection.cpp */; }; + 386FE36620581655001B661C /* XGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36220581655001B661C /* XGlobal.cpp */; }; + 386FE36720581655001B661C /* XPoolConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36320581655001B661C /* XPoolConnection.cpp */; }; 38D36F8C2053FFA600B964C1 /* CLMiner_kernel.cl in Copy Files */ = {isa = PBXBuildFile; fileRef = 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */; }; /* End PBXBuildFile section */ @@ -139,8 +141,6 @@ 3863854A2042EE6100D2A207 /* XHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XHash.cpp; sourceTree = ""; }; 3863854B2042EE6100D2A207 /* XHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHash.h; sourceTree = ""; }; 3863854C2042EE6100D2A207 /* XHash.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = XHash.hpp; sourceTree = ""; }; - 3863854D2042EE6100D2A207 /* XNetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XNetwork.cpp; sourceTree = ""; }; - 3863854E2042EE6100D2A207 /* XNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XNetwork.h; sourceTree = ""; }; 3863854F2042EE6100D2A207 /* XPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPool.cpp; sourceTree = ""; }; 386385502042EE6100D2A207 /* XPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPool.h; sourceTree = ""; }; 386385512042EE6100D2A207 /* XTaskProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XTaskProcessor.cpp; sourceTree = ""; }; @@ -242,6 +242,12 @@ 386385D22042FD0100D2A207 /* libboost_date_time.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_date_time.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_date_time.dylib; sourceTree = ""; }; 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_tr1f-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1f-mt.dylib"; sourceTree = ""; }; 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_wave-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_wave-mt.dylib"; sourceTree = ""; }; + 386FE35F20581654001B661C /* XGlobal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XGlobal.h; sourceTree = ""; }; + 386FE36020581654001B661C /* XConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XConnection.cpp; sourceTree = ""; }; + 386FE36120581655001B661C /* XConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XConnection.h; sourceTree = ""; }; + 386FE36220581655001B661C /* XGlobal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XGlobal.cpp; sourceTree = ""; }; + 386FE36320581655001B661C /* XPoolConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPoolConnection.cpp; sourceTree = ""; }; + 386FE36420581655001B661C /* XPoolConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPoolConnection.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -384,6 +390,12 @@ 386385362042EE6100D2A207 /* XDagCore */ = { isa = PBXGroup; children = ( + 386FE36020581654001B661C /* XConnection.cpp */, + 386FE36120581655001B661C /* XConnection.h */, + 386FE36220581655001B661C /* XGlobal.cpp */, + 386FE35F20581654001B661C /* XGlobal.h */, + 386FE36320581655001B661C /* XPoolConnection.cpp */, + 386FE36420581655001B661C /* XPoolConnection.h */, 386385372042EE6100D2A207 /* dar */, 3863853A2042EE6100D2A207 /* dfstools */, 386385462042EE6100D2A207 /* XAddress.cpp */, @@ -393,8 +405,6 @@ 3863854A2042EE6100D2A207 /* XHash.cpp */, 3863854B2042EE6100D2A207 /* XHash.h */, 3863854C2042EE6100D2A207 /* XHash.hpp */, - 3863854D2042EE6100D2A207 /* XNetwork.cpp */, - 3863854E2042EE6100D2A207 /* XNetwork.h */, 3863854F2042EE6100D2A207 /* XPool.cpp */, 386385502042EE6100D2A207 /* XPool.h */, 386385512042EE6100D2A207 /* XTaskProcessor.cpp */, @@ -608,7 +618,6 @@ files = ( 3863857B2042EE6100D2A207 /* crc_c.cpp in Sources */, 3863857F2042EE6200D2A207 /* XAddress.cpp in Sources */, - 386385822042EE6200D2A207 /* XNetwork.cpp in Sources */, 386385872042EE6200D2A207 /* sha256_mod.cpp in Sources */, 386385912042EE6200D2A207 /* Worker.cpp in Sources */, 386385802042EE6200D2A207 /* XBlock.cpp in Sources */, @@ -630,6 +639,9 @@ 3863857C2042EE6100D2A207 /* dfslib_crypt.cpp in Sources */, 3863858B2042EE6200D2A207 /* Utils.cpp in Sources */, 386385862042EE6200D2A207 /* sha256.cpp in Sources */, + 386FE36720581655001B661C /* XPoolConnection.cpp in Sources */, + 386FE36620581655001B661C /* XGlobal.cpp in Sources */, + 386FE36520581655001B661C /* XConnection.cpp in Sources */, 386385882042EE6200D2A207 /* CpuInfo.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; From 1d9fda10ad5a7f32d101f93409ef7b85bb0c9cef Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Tue, 13 Mar 2018 22:25:28 +0800 Subject: [PATCH 19/41] clean cheatcoin in code --- GpuMiner/Core/MinerManager.cpp | 10 +++---- GpuMiner/MinerEngine/CLMiner.cpp | 12 ++++---- GpuMiner/MinerEngine/CLMiner.h | 2 +- GpuMiner/MinerEngine/XCpuMiner.cpp | 6 ++-- GpuMiner/XDagCore/XAddress.cpp | 8 +++--- GpuMiner/XDagCore/XAddress.h | 4 +-- GpuMiner/XDagCore/XBlock.cpp | 6 ++-- GpuMiner/XDagCore/XBlock.h | 40 +++++++++++++-------------- GpuMiner/XDagCore/XConnection.cpp | 2 +- GpuMiner/XDagCore/XHash.cpp | 10 +++---- GpuMiner/XDagCore/XHash.h | 14 +++++----- GpuMiner/XDagCore/XHash.hpp | 10 +++---- GpuMiner/XDagCore/XPool.cpp | 12 ++++---- GpuMiner/XDagCore/XPool.h | 6 ++-- GpuMiner/XDagCore/XPoolConnection.cpp | 40 +++++++++++++-------------- GpuMiner/XDagCore/XPoolConnection.h | 8 +++--- GpuMiner/XDagCore/XTaskWrapper.cpp | 18 ++++++------ GpuMiner/XDagCore/XTaskWrapper.h | 14 +++++----- GpuMiner/XDagCore/XTime.h | 6 ++-- 19 files changed, 114 insertions(+), 114 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index a2c42f1..eae8485 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -431,11 +431,11 @@ bool MinerManager::CheckMandatoryParams() void MinerManager::FillRandomTask(XTaskWrapper *taskWrapper) { - cheatcoin_field data[2]; - cheatcoin_hash_t addressHash; - CRandom::FillRandomArray((uint8_t*)(data[0].data), sizeof(cheatcoin_hash_t)); - CRandom::FillRandomArray((uint8_t*)(data[1].data), sizeof(cheatcoin_hash_t)); - CRandom::FillRandomArray((uint8_t*)addressHash, sizeof(cheatcoin_hash_t)); + xdag_field data[2]; + xdag_hash_t addressHash; + CRandom::FillRandomArray((uint8_t*)(data[0].data), sizeof(xdag_hash_t)); + CRandom::FillRandomArray((uint8_t*)(data[1].data), sizeof(xdag_hash_t)); + CRandom::FillRandomArray((uint8_t*)addressHash, sizeof(xdag_hash_t)); taskWrapper->FillAndPrecalc(data, addressHash); } diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index 29c590c..bc9c6e9 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -551,7 +551,7 @@ void CLMiner::WorkLoop() void CLMiner::InternalWorkLook(int& errorCount) { - cheatcoin_field last; + xdag_field last; uint64_t prevTaskIndex = 0; uint64_t nonce; uint32_t loopCounter = 0; @@ -580,7 +580,7 @@ void CLMiner::InternalWorkLook(int& errorCount) prevTaskIndex = taskWrapper->GetIndex(); loopCounter = 0; - memcpy(last.data, taskWrapper->GetTask()->nonce.data, sizeof(cheatcoin_hash_t)); + memcpy(last.data, taskWrapper->GetTask()->nonce.data, sizeof(xdag_hash_t)); nonce = last.amount + _index * 1000000000000;//TODO: think of nonce increment WriteKernelArgs(taskWrapper, zeroBuffer); @@ -743,10 +743,10 @@ bool CLMiner::LoadKernelCode() return false; } -void CLMiner::SetMinShare(XTaskWrapper* taskWrapper, uint64_t* searchBuffer, cheatcoin_field& last) +void CLMiner::SetMinShare(XTaskWrapper* taskWrapper, uint64_t* searchBuffer, xdag_field& last) { - cheatcoin_hash_t minHash; - cheatcoin_hash_t currentHash; + xdag_hash_t minHash; + xdag_hash_t currentHash; uint64_t minNonce = 0; uint32_t size = searchBuffer[0] < OUTPUT_SIZE ? (uint32_t)searchBuffer[0] : OUTPUT_SIZE; @@ -760,7 +760,7 @@ void CLMiner::SetMinShare(XTaskWrapper* taskWrapper, uint64_t* searchBuffer, che shamod::shasha(taskWrapper->GetTask()->ctx.state, taskWrapper->GetTask()->ctx.data, nonce, (uint8_t*)currentHash); if(!minNonce || XHash::CompareHashes(currentHash, minHash) < 0) { - memcpy(minHash, currentHash, sizeof(cheatcoin_hash_t)); + memcpy(minHash, currentHash, sizeof(xdag_hash_t)); minNonce = nonce; } } diff --git a/GpuMiner/MinerEngine/CLMiner.h b/GpuMiner/MinerEngine/CLMiner.h index 1b7e16c..7cc962e 100644 --- a/GpuMiner/MinerEngine/CLMiner.h +++ b/GpuMiner/MinerEngine/CLMiner.h @@ -84,7 +84,7 @@ namespace XDag private: void WorkLoop() override; bool LoadKernelCode(); - void SetMinShare(XTaskWrapper* taskWrapper, uint64_t* searchBuffer, cheatcoin_field& last); + void SetMinShare(XTaskWrapper* taskWrapper, uint64_t* searchBuffer, xdag_field& last); void WriteKernelArgs(XTaskWrapper* taskWrapper, uint64_t* zeroBuffer); void ReadData(uint64_t* results); diff --git a/GpuMiner/MinerEngine/XCpuMiner.cpp b/GpuMiner/MinerEngine/XCpuMiner.cpp index ce26954..65a0e86 100644 --- a/GpuMiner/MinerEngine/XCpuMiner.cpp +++ b/GpuMiner/MinerEngine/XCpuMiner.cpp @@ -16,8 +16,8 @@ XCpuMiner::~XCpuMiner() void XCpuMiner::WorkLoop() { - cheatcoin_hash_t hash; - cheatcoin_field last; + xdag_hash_t hash; + xdag_field last; uint64_t prevTaskIndex = 0; uint64_t nonce; int iterations = 256; @@ -36,7 +36,7 @@ void XCpuMiner::WorkLoop() if(taskWrapper->GetIndex() != prevTaskIndex) { prevTaskIndex = taskWrapper->GetIndex(); - memcpy(last.data, taskWrapper->GetTask()->nonce.data, sizeof(cheatcoin_hash_t)); + memcpy(last.data, taskWrapper->GetTask()->nonce.data, sizeof(xdag_hash_t)); nonce = last.amount + _index; } diff --git a/GpuMiner/XDagCore/XAddress.cpp b/GpuMiner/XDagCore/XAddress.cpp index 99a83c0..5226a64 100644 --- a/GpuMiner/XDagCore/XAddress.cpp +++ b/GpuMiner/XDagCore/XAddress.cpp @@ -1,4 +1,4 @@ -#include "XAddress.h" +#include "XAddress.h" #include static const uint8_t* bits2mime = (uint8_t*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -14,7 +14,7 @@ void XAddress::Init() } } -bool XAddress::AddressToHash(const char *address, cheatcoin_hash_t hash) +bool XAddress::AddressToHash(const char *address, xdag_hash_t hash) { uint8_t *fld = (uint8_t *)hash; int i, c, d, e, n; @@ -45,7 +45,7 @@ bool XAddress::AddressToHash(const char *address, cheatcoin_hash_t hash) return true; } -const char* XAddress::HashToAddress(const cheatcoin_hash_t hash) +const char* XAddress::HashToAddress(const xdag_hash_t hash) { static char bufs[4][33]; static int k = 0; @@ -65,4 +65,4 @@ const char* XAddress::HashToAddress(const cheatcoin_hash_t hash) } *ptr = 0; return buf; -} \ No newline at end of file +} diff --git a/GpuMiner/XDagCore/XAddress.h b/GpuMiner/XDagCore/XAddress.h index 247d83a..d6c6954 100644 --- a/GpuMiner/XDagCore/XAddress.h +++ b/GpuMiner/XDagCore/XAddress.h @@ -8,7 +8,7 @@ class XAddress static uint8_t _mime2bits[256]; public: static void Init(); - static bool AddressToHash(const char* address, cheatcoin_hash_t hash); - static const char* HashToAddress(const cheatcoin_hash_t hash); + static bool AddressToHash(const char* address, xdag_hash_t hash); + static const char* HashToAddress(const xdag_hash_t hash); }; diff --git a/GpuMiner/XDagCore/XBlock.cpp b/GpuMiner/XDagCore/XBlock.cpp index 978faae..1ca0d50 100644 --- a/GpuMiner/XDagCore/XBlock.cpp +++ b/GpuMiner/XDagCore/XBlock.cpp @@ -1,10 +1,10 @@ #include "XBlock.h" #include "XTime.h" -void XBlock::GenerateFakeBlock(cheatcoin_block *block) +void XBlock::GenerateFakeBlock(xdag_block *block) { - memset(block, 0, sizeof(struct cheatcoin_block)); - block->field[0].type = (int)cheatcoin_field_type::CHEATCOIN_FIELD_HEAD | (uint64_t)((int)cheatcoin_field_type::CHEATCOIN_FIELD_SIGN_OUT * 0x11) << 4; + memset(block, 0, sizeof(struct xdag_block)); + block->field[0].type = (int)xdag_field_type::XDAG_FIELD_HEAD | (uint64_t)((int)xdag_field_type::XDAG_FIELD_SIGN_OUT * 0x11) << 4; block->field[0].time = get_timestamp(); block->field[0].amount = 0; block->field[0].transport_header = 1; diff --git a/GpuMiner/XDagCore/XBlock.h b/GpuMiner/XDagCore/XBlock.h index 8f5303c..15f969e 100644 --- a/GpuMiner/XDagCore/XBlock.h +++ b/GpuMiner/XDagCore/XBlock.h @@ -3,23 +3,23 @@ #include "XHash.h" #include "XTime.h" -#define CHEATCOIN_BLOCK_FIELDS 16 +#define XDAG_BLOCK_FIELDS 16 -enum class cheatcoin_field_type +enum class xdag_field_type { - CHEATCOIN_FIELD_NONCE, - CHEATCOIN_FIELD_HEAD, - CHEATCOIN_FIELD_IN, - CHEATCOIN_FIELD_OUT, - CHEATCOIN_FIELD_SIGN_IN, - CHEATCOIN_FIELD_SIGN_OUT, - CHEATCOIN_FIELD_PUBLIC_KEY_0, - CHEATCOIN_FIELD_PUBLIC_KEY_1, + XDAG_FIELD_NONCE, + XDAG_FIELD_HEAD, + XDAG_FIELD_IN, + XDAG_FIELD_OUT, + XDAG_FIELD_SIGN_IN, + XDAG_FIELD_SIGN_OUT, + XDAG_FIELD_PUBLIC_KEY_0, + XDAG_FIELD_PUBLIC_KEY_1, }; -typedef uint64_t cheatcoin_amount_t; +typedef uint64_t xdag_amount_t; -struct cheatcoin_field +struct xdag_field { union { @@ -31,27 +31,27 @@ struct cheatcoin_field { uint64_t transport_header; uint64_t type; - cheatcoin_time_t time; + xdag_time_t time; }; - cheatcoin_hashlow_t hash; + xdag_hashlow_t hash; }; union { - cheatcoin_amount_t amount; - cheatcoin_time_t end_time; + xdag_amount_t amount; + xdag_time_t end_time; }; }; - cheatcoin_hash_t data; + xdag_hash_t data; }; }; -struct cheatcoin_block +struct xdag_block { - struct cheatcoin_field field[CHEATCOIN_BLOCK_FIELDS]; + struct xdag_field field[XDAG_BLOCK_FIELDS]; }; class XBlock { public: - static void GenerateFakeBlock(cheatcoin_block *block); + static void GenerateFakeBlock(xdag_block *block); }; diff --git a/GpuMiner/XDagCore/XConnection.cpp b/GpuMiner/XDagCore/XConnection.cpp index 0d5c00e..725de61 100644 --- a/GpuMiner/XDagCore/XConnection.cpp +++ b/GpuMiner/XDagCore/XConnection.cpp @@ -115,7 +115,7 @@ bool XConnection::Connect(const char *address) if(fcntl(_socket, F_SETFD, FD_CLOEXEC) == -1) { //TODO: log - //cheatcoin_err("pool : can't set FD_CLOEXEC flag on socket %d, %s\n", g_socket, strerror(errno)); + //xdag_err("pool : can't set FD_CLOEXEC flag on socket %d, %s\n", g_socket, strerror(errno)); } // Set the "LINGER" timeout to zero, to close the listen socket diff --git a/GpuMiner/XDagCore/XHash.cpp b/GpuMiner/XDagCore/XHash.cpp index d1018f0..fbb497e 100644 --- a/GpuMiner/XDagCore/XHash.cpp +++ b/GpuMiner/XDagCore/XHash.cpp @@ -3,27 +3,27 @@ #include "Utils/StringFormat.h" #include "Hash/sha256_mod.h" -void XHash::GetHash(void *data, size_t size, cheatcoin_hash_t hash) +void XHash::GetHash(void *data, size_t size, xdag_hash_t hash) { SHA256_CTX ctx; sha256_init(&ctx); sha256_update(&ctx, (uint8_t*)data, size); sha256_final(&ctx, (uint8_t *)hash); sha256_init(&ctx); - sha256_update(&ctx, (uint8_t *)hash, sizeof(cheatcoin_hash_t)); + sha256_update(&ctx, (uint8_t *)hash, sizeof(xdag_hash_t)); sha256_final(&ctx, (uint8_t *)hash); } -uint64_t XHash::SearchMinNonce(SHA256_CTX *ctx, uint64_t &nonce, int iterations, int step, cheatcoin_hash_t hash) +uint64_t XHash::SearchMinNonce(SHA256_CTX *ctx, uint64_t &nonce, int iterations, int step, xdag_hash_t hash) { - cheatcoin_hash_t currentHash; + xdag_hash_t currentHash; uint64_t minNonce = 0; for(int i = 0; i < iterations; ++i) { shamod::shasha(ctx->state, ctx->data, nonce, (uint8_t*)currentHash); if(!i || CompareHashes(currentHash, hash) < 0) { - memcpy(hash, currentHash, sizeof(cheatcoin_hash_t)); + memcpy(hash, currentHash, sizeof(xdag_hash_t)); minNonce = nonce; } nonce += step; diff --git a/GpuMiner/XDagCore/XHash.h b/GpuMiner/XDagCore/XHash.h index 4034816..126e195 100644 --- a/GpuMiner/XDagCore/XHash.h +++ b/GpuMiner/XDagCore/XHash.h @@ -7,21 +7,21 @@ #include #include "Hash/sha256.h" -typedef uint64_t cheatcoin_hash_t[4]; -typedef uint64_t cheatcoin_hashlow_t[3]; +typedef uint64_t xdag_hash_t[4]; +typedef uint64_t xdag_hashlow_t[3]; class XHash { public: - static void GetHash(void *data, size_t size, cheatcoin_hash_t hash); - static inline int CompareHashes(cheatcoin_hash_t l, cheatcoin_hash_t r); + static void GetHash(void *data, size_t size, xdag_hash_t hash); + static inline int CompareHashes(xdag_hash_t l, xdag_hash_t r); static int GetHashCtxSize() { return sizeof(SHA256_CTX); } static inline void HashInit(SHA256_CTX *ctx); static inline void HashUpdate(SHA256_CTX *ctx, void *data, size_t size); - static uint64_t SearchMinNonce(SHA256_CTX *ctx, uint64_t &nonce, int iterations, int step, cheatcoin_hash_t hash); - static inline void GetHashState(SHA256_CTX *ctxv, cheatcoin_hash_t state); - static inline void SetHashState(SHA256_CTX *ctxv, cheatcoin_hash_t state, size_t size); + static uint64_t SearchMinNonce(SHA256_CTX *ctx, uint64_t &nonce, int iterations, int step, xdag_hash_t hash); + static inline void GetHashState(SHA256_CTX *ctxv, xdag_hash_t state); + static inline void SetHashState(SHA256_CTX *ctxv, xdag_hash_t state, size_t size); }; #include "XHash.hpp" diff --git a/GpuMiner/XDagCore/XHash.hpp b/GpuMiner/XDagCore/XHash.hpp index b6079db..e5e446f 100644 --- a/GpuMiner/XDagCore/XHash.hpp +++ b/GpuMiner/XDagCore/XHash.hpp @@ -1,6 +1,6 @@ #include -int XHash::CompareHashes(cheatcoin_hash_t l, cheatcoin_hash_t r) +int XHash::CompareHashes(xdag_hash_t l, xdag_hash_t r) { for(int i = 3; i >= 0; --i) { @@ -22,14 +22,14 @@ void XHash::HashUpdate(SHA256_CTX *ctx, void *data, size_t size) sha256_update(ctx, (uint8_t*)data, size); } -inline void XHash::GetHashState(SHA256_CTX *ctx, cheatcoin_hash_t state) +inline void XHash::GetHashState(SHA256_CTX *ctx, xdag_hash_t state) { - memcpy(state, ctx->state, sizeof(cheatcoin_hash_t)); + memcpy(state, ctx->state, sizeof(xdag_hash_t)); } -inline void XHash::SetHashState(SHA256_CTX *ctx, cheatcoin_hash_t state, size_t size) +inline void XHash::SetHashState(SHA256_CTX *ctx, xdag_hash_t state, size_t size) { - memcpy(ctx->state, state, sizeof(cheatcoin_hash_t)); + memcpy(ctx->state, state, sizeof(xdag_hash_t)); ctx->datalen = 0; ctx->bitlen = size << 3; } diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index d8df4a2..d07c7d7 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -16,7 +16,7 @@ XPool::XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcess _taskTime = 0; _lastShareTime = 0; _currentConnection = NULL; - memset(_lastHash, 0, sizeof(cheatcoin_hash_t)); + memset(_lastHash, 0, sizeof(xdag_hash_t)); _connection.SetAddress(accountAddress); } @@ -61,10 +61,10 @@ bool XPool::Interract() bool XPool::CheckNewTasks() { - return _currentConnection->ReadTaskData([this](cheatcoin_field* data) { OnNewTask(data); }); + return _currentConnection->ReadTaskData([this](xdag_field* data) { OnNewTask(data); }); } -void XPool::OnNewTask(cheatcoin_field* data) +void XPool::OnNewTask(xdag_field* data) { XTaskWrapper* task = _taskProcessor->GetNextTask(); task->FillAndPrecalc(data, _currentConnection->GetAddressHash()); @@ -95,10 +95,10 @@ bool XPool::SendTaskResult() } return _currentConnection->WriteTaskData([this]() { - cheatcoin_pool_task *task = _taskProcessor->GetCurrentTask()->GetTask(); + xdag_pool_task *task = _taskProcessor->GetCurrentTask()->GetTask(); uint64_t *hash = task->minhash.data; _lastShareTime = time(0); - memcpy(_lastHash, hash, sizeof(cheatcoin_hash_t)); + memcpy(_lastHash, hash, sizeof(xdag_hash_t)); bool res = _currentConnection->SendToPool(&task->lastfield, 1); clog(XDag::LogChannel) << string_format("Share t=%llx res=%s\n%016llx%016llx%016llx%016llx", task->main_time << 16 | 0xffff, res ? "OK" : "Fail", hash[3], hash[2], hash[1], hash[0]); @@ -123,5 +123,5 @@ bool XPool::HasNewShare() return false; } //There is no sense to send the same results - return memcmp(_lastHash, _taskProcessor->GetCurrentTask()->GetTask()->minhash.data, sizeof(cheatcoin_hash_t)) != 0; + return memcmp(_lastHash, _taskProcessor->GetCurrentTask()->GetTask()->minhash.data, sizeof(xdag_hash_t)) != 0; } diff --git a/GpuMiner/XDagCore/XPool.h b/GpuMiner/XDagCore/XPool.h index 25e3d6a..b3402e6 100644 --- a/GpuMiner/XDagCore/XPool.h +++ b/GpuMiner/XDagCore/XPool.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "XPoolConnection.h" #include "XBlock.h" @@ -11,13 +11,13 @@ class XPool XPoolConnection _connection; XPoolConnection* _currentConnection; XTaskProcessor *_taskProcessor; - cheatcoin_hash_t _lastHash; + xdag_hash_t _lastHash; time_t _taskTime; time_t _lastShareTime; bool CheckNewTasks(); bool SendTaskResult(); - void OnNewTask(cheatcoin_field* data); + void OnNewTask(xdag_field* data); bool HasNewShare(); public: XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcessor *taskProcessor); diff --git a/GpuMiner/XDagCore/XPoolConnection.cpp b/GpuMiner/XDagCore/XPoolConnection.cpp index 06f7547..3af0b8e 100644 --- a/GpuMiner/XDagCore/XPoolConnection.cpp +++ b/GpuMiner/XDagCore/XPoolConnection.cpp @@ -9,7 +9,7 @@ #define SECTOR0_OFFSET 0x82e9d1b5u #define HEADER_WORD 0x3fca9e2bu #define MINERS_PWD "minersgonnamine" -#define DATA_SIZE (sizeof(struct cheatcoin_field) / sizeof(uint32_t)) +#define DATA_SIZE (sizeof(struct xdag_field) / sizeof(uint32_t)) XPoolConnection::XPoolConnection() { @@ -73,37 +73,37 @@ bool XPoolConnection::Connect(const char *address) _localMiner.nfield_in = 0; _localMiner.nfield_out = 0; _readDataSize = 0; - _readDataLimit = sizeof(struct cheatcoin_field); + _readDataLimit = sizeof(struct xdag_field); if(!XConnection::Connect(address)) { return false; } - cheatcoin_block block; + xdag_block block; XBlock::GenerateFakeBlock(&block); - if(!SendToPool(block.field, CHEATCOIN_BLOCK_FIELDS)) + if(!SendToPool(block.field, XDAG_BLOCK_FIELDS)) { return false; } return true; } -bool XPoolConnection::SendToPool(cheatcoin_field *fields, int fieldCount) +bool XPoolConnection::SendToPool(xdag_field *fields, int fieldCount) { - cheatcoin_field fieldsCopy[CHEATCOIN_BLOCK_FIELDS]; - cheatcoin_hash_t hash; - int todo = fieldCount * sizeof(struct cheatcoin_field), done = 0; + xdag_field fieldsCopy[XDAG_BLOCK_FIELDS]; + xdag_hash_t hash; + int todo = fieldCount * sizeof(struct xdag_field), done = 0; if(!IsConnected()) { return false; } memcpy(fieldsCopy, fields, todo); - if(fieldCount == CHEATCOIN_BLOCK_FIELDS) + if(fieldCount == XDAG_BLOCK_FIELDS) { uint32_t crc; fieldsCopy[0].transport_header = 0; - XHash::GetHash(fieldsCopy, sizeof(struct cheatcoin_block), hash); + XHash::GetHash(fieldsCopy, sizeof(struct xdag_block), hash); fieldsCopy[0].transport_header = HEADER_WORD; - crc = crc_of_array((uint8_t *)fieldsCopy, sizeof(struct cheatcoin_block)); + crc = crc_of_array((uint8_t *)fieldsCopy, sizeof(struct xdag_block)); fieldsCopy[0].transport_header |= (uint64_t)crc << 32; } for(int i = 0; i < fieldCount; ++i) @@ -132,9 +132,9 @@ bool XPoolConnection::SendToPool(cheatcoin_field *fields, int fieldCount) return true; } -bool XPoolConnection::ReadTaskData(std::function onNewTask) +bool XPoolConnection::ReadTaskData(std::function onNewTask) { - cheatcoin_field recievedTaskData[2]; + xdag_field recievedTaskData[2]; bool taskIsRecieved = false; do { @@ -158,25 +158,25 @@ bool XPoolConnection::ReadTaskData(std::function onNewTa _readDataSize += res; if(_readDataSize == _readDataLimit) { - cheatcoin_field *last = _dataBuffer + (_readDataSize / sizeof(struct cheatcoin_field) - 1); + xdag_field *last = _dataBuffer + (_readDataSize / sizeof(struct xdag_field) - 1); dfslib_uncrypt_array(_crypt, (uint32_t *)last->data, DATA_SIZE, _localMiner.nfield_in++); - if(!memcmp(last->data, _addressHash, sizeof(cheatcoin_hashlow_t))) + if(!memcmp(last->data, _addressHash, sizeof(xdag_hashlow_t))) { // if returned data contains hash of account address - pool sent information about incoming transfer // we just ignore it _readDataSize = 0; - _readDataLimit = sizeof(struct cheatcoin_field); + _readDataLimit = sizeof(struct xdag_field); } - else if(_readDataLimit == 2 * sizeof(struct cheatcoin_field)) + else if(_readDataLimit == 2 * sizeof(struct xdag_field)) { memcpy(recievedTaskData, _dataBuffer, _readDataLimit); taskIsRecieved = true; _readDataSize = 0; - _readDataLimit = sizeof(struct cheatcoin_field); + _readDataLimit = sizeof(struct xdag_field); } else { - _readDataLimit = 2 * sizeof(struct cheatcoin_field); + _readDataLimit = 2 * sizeof(struct xdag_field); } } } @@ -204,4 +204,4 @@ bool XPoolConnection::WriteTaskData(std::function onSendTask) } return onSendTask(); -} \ No newline at end of file +} diff --git a/GpuMiner/XDagCore/XPoolConnection.h b/GpuMiner/XDagCore/XPoolConnection.h index d3b8d6e..44aa764 100644 --- a/GpuMiner/XDagCore/XPoolConnection.h +++ b/GpuMiner/XDagCore/XPoolConnection.h @@ -15,12 +15,12 @@ struct dfslib_crypt; class XPoolConnection : public XConnection { private: - cheatcoin_hash_t _addressHash; + xdag_hash_t _addressHash; miner _localMiner; dfslib_crypt *_crypt; int _readDataSize, _readDataLimit; - cheatcoin_field _dataBuffer[2]; + xdag_field _dataBuffer[2]; bool InitCrypto(); public: @@ -33,8 +33,8 @@ class XPoolConnection : public XConnection virtual bool Connect(const char *address); uint64_t* GetAddressHash() { return _addressHash; } - bool ReadTaskData(std::function onNewTask); + bool ReadTaskData(std::function onNewTask); bool WriteTaskData(std::function onSendTask); - bool SendToPool(cheatcoin_field *fields, int fieldCount); + bool SendToPool(xdag_field *fields, int fieldCount); }; diff --git a/GpuMiner/XDagCore/XTaskWrapper.cpp b/GpuMiner/XDagCore/XTaskWrapper.cpp index 4f747cc..2514b84 100644 --- a/GpuMiner/XDagCore/XTaskWrapper.cpp +++ b/GpuMiner/XDagCore/XTaskWrapper.cpp @@ -16,17 +16,17 @@ XTaskWrapper::~XTaskWrapper() { } -void XTaskWrapper::FillAndPrecalc(cheatcoin_field* data, cheatcoin_hash_t addressHash) +void XTaskWrapper::FillAndPrecalc(xdag_field* data, xdag_hash_t addressHash) { _task.main_time = GetMainTime(); - XHash::SetHashState(&_task.ctx, data[0].data, sizeof(struct cheatcoin_block) - 2 * sizeof(struct cheatcoin_field)); + XHash::SetHashState(&_task.ctx, data[0].data, sizeof(struct xdag_block) - 2 * sizeof(struct xdag_field)); - XHash::HashUpdate(&_task.ctx, data[1].data, sizeof(struct cheatcoin_field)); - XHash::HashUpdate(&_task.ctx, addressHash, sizeof(cheatcoin_hashlow_t)); + XHash::HashUpdate(&_task.ctx, data[1].data, sizeof(struct xdag_field)); + XHash::HashUpdate(&_task.ctx, addressHash, sizeof(xdag_hashlow_t)); CRandom::FillRandomArray((uint8_t*)&_task.nonce.amount, sizeof(uint64_t)); - memcpy(_task.nonce.data, addressHash, sizeof(cheatcoin_hashlow_t)); - memcpy(_task.lastfield.data, _task.nonce.data, sizeof(cheatcoin_hash_t)); + memcpy(_task.nonce.data, addressHash, sizeof(xdag_hashlow_t)); + memcpy(_task.lastfield.data, _task.nonce.data, sizeof(xdag_hash_t)); //we manually set the initial target difficulty of shares memset(_task.minhash.data, 0xff, 24); @@ -40,15 +40,15 @@ void XTaskWrapper::FillAndPrecalc(cheatcoin_field* data, cheatcoin_hash_t addres } } -void XTaskWrapper::SetShare(cheatcoin_hash_t last, cheatcoin_hash_t hash) +void XTaskWrapper::SetShare(xdag_hash_t last, xdag_hash_t hash) { if(XHash::CompareHashes(hash, _task.minhash.data) < 0) { _shareMutex.lock(); if(XHash::CompareHashes(hash, _task.minhash.data) < 0) { - memcpy(_task.minhash.data, hash, sizeof(cheatcoin_hash_t)); - memcpy(_task.lastfield.data, last, sizeof(cheatcoin_hash_t)); + memcpy(_task.minhash.data, hash, sizeof(xdag_hash_t)); + memcpy(_task.lastfield.data, last, sizeof(xdag_hash_t)); _isShareFound = true; } _shareMutex.unlock(); diff --git a/GpuMiner/XDagCore/XTaskWrapper.h b/GpuMiner/XDagCore/XTaskWrapper.h index d111d8f..67aa7a9 100644 --- a/GpuMiner/XDagCore/XTaskWrapper.h +++ b/GpuMiner/XDagCore/XTaskWrapper.h @@ -6,10 +6,10 @@ #include //TODO: refactor -struct cheatcoin_pool_task +struct xdag_pool_task { - cheatcoin_field lastfield, minhash, nonce; - cheatcoin_time_t main_time; + xdag_field lastfield, minhash, nonce; + xdag_time_t main_time; SHA256_CTX ctx; }; @@ -19,7 +19,7 @@ class XTaskWrapper { friend class XTaskProcessor; private: - cheatcoin_pool_task _task; + xdag_pool_task _task; std::mutex _shareMutex; uint64_t _taskIndex; bool _isShareFound; @@ -30,9 +30,9 @@ class XTaskWrapper XTaskWrapper(); ~XTaskWrapper(); - void FillAndPrecalc(cheatcoin_field* data, cheatcoin_hash_t addressHash); - cheatcoin_pool_task* GetTask() { return &_task; } - void SetShare(cheatcoin_hash_t last, cheatcoin_hash_t hash); + void FillAndPrecalc(xdag_field* data, xdag_hash_t addressHash); + xdag_pool_task* GetTask() { return &_task; } + void SetShare(xdag_hash_t last, xdag_hash_t hash); uint64_t GetIndex() { return _taskIndex; } bool IsShareFound() { return _isShareFound; } diff --git a/GpuMiner/XDagCore/XTime.h b/GpuMiner/XDagCore/XTime.h index a90604a..0f36df1 100644 --- a/GpuMiner/XDagCore/XTime.h +++ b/GpuMiner/XDagCore/XTime.h @@ -6,10 +6,10 @@ #endif #include -#define CHEATCOIN_MAIN_ERA 0x16940000000ll +#define XDAG_MAIN_ERA 0x16940000000ll #define MAIN_TIME(t) ((t) >> 16) -typedef uint64_t cheatcoin_time_t; +typedef uint64_t xdag_time_t; inline uint64_t get_timestamp(void) { @@ -18,7 +18,7 @@ inline uint64_t get_timestamp(void) return (uint64_t)(unsigned long)tp.tv_sec << 10 | ((tp.tv_usec << 10) / 1000000); } -inline cheatcoin_time_t GetMainTime() +inline xdag_time_t GetMainTime() { return MAIN_TIME(get_timestamp()); } From a035714086a8c27dca3fc97f06c37559041fb547 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Tue, 13 Mar 2018 23:29:45 +0800 Subject: [PATCH 20/41] update xcode config --- GpuMiner/GpuMiner.xcodeproj/project.pbxproj | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj index ad7843c..8cb2fa7 100644 --- a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj +++ b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj @@ -332,7 +332,6 @@ 386385252042EE5F00D2A207 /* CL */, 386385652042EE6100D2A207 /* Core */, 386385562042EE6100D2A207 /* Hash */, - 386385282042EE6000D2A207 /* HashCL */, 3863852C2042EE6000D2A207 /* main.cpp */, 3863852F2042EE6100D2A207 /* MinerEngine */, 386385292042EE6000D2A207 /* resource.h */, @@ -360,13 +359,6 @@ path = CL; sourceTree = ""; }; - 386385282042EE6000D2A207 /* HashCL */ = { - isa = PBXGroup; - children = ( - ); - path = HashCL; - sourceTree = ""; - }; 3863852F2042EE6100D2A207 /* MinerEngine */ = { isa = PBXGroup; children = ( @@ -756,6 +748,9 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = NO; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( __MACOS, @@ -781,6 +776,9 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = NO; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = __MACOS; GCC_VERSION = ""; From ac7a8801adbf27db73e1cd55852f63038245495a Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Tue, 13 Mar 2018 23:30:14 +0800 Subject: [PATCH 21/41] initialize nonce --- GpuMiner/MinerEngine/CLMiner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index bc9c6e9..b5fb872 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -553,7 +553,7 @@ void CLMiner::InternalWorkLook(int& errorCount) { xdag_field last; uint64_t prevTaskIndex = 0; - uint64_t nonce; + uint64_t nonce = 0; uint32_t loopCounter = 0; uint64_t results[OUTPUT_SIZE + 1]; From 0cba978b77865701db82e3f8ba2f2c805796ddb6 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Tue, 13 Mar 2018 23:30:47 +0800 Subject: [PATCH 22/41] remove warnings by replace stol with stoi --- GpuMiner/Core/MinerManager.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index eae8485..c591394 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -33,7 +33,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _openclPlatform = stol(argv[++i]); + _openclPlatform = stoi(argv[++i]); } catch(...) { @@ -47,7 +47,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _openclDevices[_openclDeviceCount] = stol(argv[++i]); + _openclDevices[_openclDeviceCount] = stoi(argv[++i]); ++_openclDeviceCount; } catch(...) @@ -61,7 +61,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _globalWorkSizeMultiplier = stol(argv[++i]); + _globalWorkSizeMultiplier = stoi(argv[++i]); } catch(...) { @@ -73,7 +73,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _localWorkSize = stol(argv[++i]); + _localWorkSize = stoi(argv[++i]); } catch(...) { @@ -89,7 +89,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _benchmarkWarmup = stol(argv[++i]); + _benchmarkWarmup = stoi(argv[++i]); } catch(...) { @@ -101,7 +101,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _benchmarkTrial = stol(argv[++i]); + _benchmarkTrial = stoi(argv[++i]); } catch(...) { @@ -113,7 +113,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _benchmarkTrials = stol(argv[++i]); + _benchmarkTrials = stoi(argv[++i]); } catch(...) { @@ -133,7 +133,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _cpuMiningThreads = stol(argv[++i]); + _cpuMiningThreads = stoi(argv[++i]); } catch(...) { @@ -145,7 +145,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _openclMiningDevices = stol(argv[++i]); + _openclMiningDevices = stoi(argv[++i]); } catch(...) { @@ -172,7 +172,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _nvidiaSpeedDamp = stol(argv[i + 1]); + _nvidiaSpeedDamp = stoi(argv[i + 1]); ++i; } catch (...) @@ -425,7 +425,7 @@ void MinerManager::ConfigureCpu() bool MinerManager::CheckMandatoryParams() { return (_shouldListDevices && _minerType != MinerType::NotSet) - || _mode == OperationMode::Benchmark && _minerType == MinerType::CL + || (_mode == OperationMode::Benchmark && _minerType == MinerType::CL) || ((_minerType == MinerType::CPU || _minerType == MinerType::CL) && !_accountAddress.empty() && !_poolUrl.empty()); } From f64338628ac417d13bd58cc28a776cbe52bc1515 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Wed, 14 Mar 2018 00:46:34 +0800 Subject: [PATCH 23/41] remove 32bit support --- GpuMiner/GpuMiner.xcodeproj/project.pbxproj | 134 +------------------- 1 file changed, 4 insertions(+), 130 deletions(-) diff --git a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj index 8cb2fa7..e8bbd89 100644 --- a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj +++ b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj @@ -32,73 +32,10 @@ 386385902042EE6200D2A207 /* MinerManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385712042EE6100D2A207 /* MinerManager.cpp */; }; 386385912042EE6200D2A207 /* Worker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385742042EE6100D2A207 /* Worker.cpp */; }; 386385942042FC6400D2A207 /* OpenCL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385932042FC6300D2A207 /* OpenCL.framework */; }; - 386385D52042FD0100D2A207 /* libboost_atomic-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385952042FCFE00D2A207 /* libboost_atomic-mt.dylib */; }; - 386385D62042FD0100D2A207 /* libboost_log-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385962042FCFE00D2A207 /* libboost_log-mt.dylib */; }; - 386385D72042FD0100D2A207 /* libboost_locale-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385972042FCFE00D2A207 /* libboost_locale-mt.dylib */; }; - 386385D82042FD0100D2A207 /* libboost_program_options.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385982042FCFE00D2A207 /* libboost_program_options.dylib */; }; - 386385D92042FD0100D2A207 /* libboost_math_c99l-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385992042FCFE00D2A207 /* libboost_math_c99l-mt.dylib */; }; - 386385DA2042FD0100D2A207 /* libboost_graph.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859A2042FCFE00D2A207 /* libboost_graph.dylib */; }; - 386385DB2042FD0100D2A207 /* libboost_coroutine-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859B2042FCFE00D2A207 /* libboost_coroutine-mt.dylib */; }; - 386385DC2042FD0200D2A207 /* libboost_stacktrace_basic-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859C2042FCFE00D2A207 /* libboost_stacktrace_basic-mt.dylib */; }; - 386385DD2042FD0200D2A207 /* libboost_chrono-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859D2042FCFE00D2A207 /* libboost_chrono-mt.dylib */; }; - 386385DE2042FD0200D2A207 /* libboost_system-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859E2042FCFF00D2A207 /* libboost_system-mt.dylib */; }; - 386385DF2042FD0200D2A207 /* libboost_context-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3863859F2042FCFF00D2A207 /* libboost_context-mt.dylib */; }; - 386385E02042FD0200D2A207 /* libboost_math_tr1f.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A02042FCFF00D2A207 /* libboost_math_tr1f.dylib */; }; - 386385E12042FD0200D2A207 /* libboost_prg_exec_monitor.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A12042FCFF00D2A207 /* libboost_prg_exec_monitor.dylib */; }; - 386385E22042FD0200D2A207 /* libboost_random.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A22042FCFF00D2A207 /* libboost_random.dylib */; }; - 386385E32042FD0200D2A207 /* libboost_regex.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A32042FCFF00D2A207 /* libboost_regex.dylib */; }; - 386385E42042FD0200D2A207 /* libboost_serialization.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A42042FCFF00D2A207 /* libboost_serialization.dylib */; }; - 386385E52042FD0200D2A207 /* libboost_signals.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A52042FCFF00D2A207 /* libboost_signals.dylib */; }; - 386385E62042FD0200D2A207 /* libboost_stacktrace_noop-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A62042FCFF00D2A207 /* libboost_stacktrace_noop-mt.dylib */; }; - 386385E72042FD0200D2A207 /* libboost_log.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A72042FCFF00D2A207 /* libboost_log.dylib */; }; - 386385E82042FD0200D2A207 /* libboost_graph-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A82042FCFF00D2A207 /* libboost_graph-mt.dylib */; }; - 386385E92042FD0200D2A207 /* libboost_filesystem-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385A92042FCFF00D2A207 /* libboost_filesystem-mt.dylib */; }; - 386385EA2042FD0200D2A207 /* libboost_signals-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AA2042FCFF00D2A207 /* libboost_signals-mt.dylib */; }; - 386385EB2042FD0200D2A207 /* libboost_math_c99l.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AB2042FCFF00D2A207 /* libboost_math_c99l.dylib */; }; - 386385EC2042FD0200D2A207 /* libboost_regex-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AC2042FCFF00D2A207 /* libboost_regex-mt.dylib */; }; - 386385ED2042FD0200D2A207 /* libboost_math_c99f-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AD2042FCFF00D2A207 /* libboost_math_c99f-mt.dylib */; }; - 386385EE2042FD0200D2A207 /* libboost_stacktrace_basic.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AE2042FCFF00D2A207 /* libboost_stacktrace_basic.dylib */; }; - 386385EF2042FD0200D2A207 /* libboost_type_erasure.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385AF2042FD0000D2A207 /* libboost_type_erasure.dylib */; }; - 386385F02042FD0200D2A207 /* libboost_iostreams.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B02042FD0000D2A207 /* libboost_iostreams.dylib */; }; - 386385F12042FD0200D2A207 /* libboost_fiber-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B12042FD0000D2A207 /* libboost_fiber-mt.dylib */; }; - 386385F22042FD0200D2A207 /* libboost_math_c99.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B22042FD0000D2A207 /* libboost_math_c99.dylib */; }; - 386385F32042FD0200D2A207 /* libboost_log_setup-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B32042FD0000D2A207 /* libboost_log_setup-mt.dylib */; }; - 386385F42042FD0200D2A207 /* libboost_random-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B42042FD0000D2A207 /* libboost_random-mt.dylib */; }; - 386385F52042FD0200D2A207 /* libboost_wserialization-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B52042FD0000D2A207 /* libboost_wserialization-mt.dylib */; }; - 386385F62042FD0200D2A207 /* libboost_timer-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B62042FD0000D2A207 /* libboost_timer-mt.dylib */; }; - 386385F72042FD0200D2A207 /* libboost_math_tr1l.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B72042FD0000D2A207 /* libboost_math_tr1l.dylib */; }; - 386385F82042FD0200D2A207 /* libboost_log_setup.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B82042FD0000D2A207 /* libboost_log_setup.dylib */; }; - 386385F92042FD0200D2A207 /* libboost_coroutine.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385B92042FD0000D2A207 /* libboost_coroutine.dylib */; }; - 386385FA2042FD0200D2A207 /* libboost_math_c99f.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BA2042FD0000D2A207 /* libboost_math_c99f.dylib */; }; - 386385FB2042FD0200D2A207 /* libboost_math_tr1-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BB2042FD0000D2A207 /* libboost_math_tr1-mt.dylib */; }; - 386385FC2042FD0200D2A207 /* libboost_system.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BC2042FD0000D2A207 /* libboost_system.dylib */; }; - 386385FD2042FD0200D2A207 /* libboost_serialization-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BD2042FD0000D2A207 /* libboost_serialization-mt.dylib */; }; - 386385FE2042FD0200D2A207 /* libboost_filesystem.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BE2042FD0000D2A207 /* libboost_filesystem.dylib */; }; - 386385FF2042FD0200D2A207 /* libboost_container-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BF2042FD0000D2A207 /* libboost_container-mt.dylib */; }; - 386386002042FD0200D2A207 /* libboost_program_options-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C02042FD0000D2A207 /* libboost_program_options-mt.dylib */; }; - 386386012042FD0200D2A207 /* libboost_unit_test_framework.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C12042FD0000D2A207 /* libboost_unit_test_framework.dylib */; }; - 386386022042FD0200D2A207 /* libboost_math_tr1l-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C22042FD0000D2A207 /* libboost_math_tr1l-mt.dylib */; }; - 386386032042FD0200D2A207 /* libboost_chrono.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C32042FD0100D2A207 /* libboost_chrono.dylib */; }; - 386386042042FD0200D2A207 /* libboost_date_time-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C42042FD0100D2A207 /* libboost_date_time-mt.dylib */; }; - 386386052042FD0200D2A207 /* libboost_prg_exec_monitor-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C52042FD0100D2A207 /* libboost_prg_exec_monitor-mt.dylib */; }; - 386386062042FD0200D2A207 /* libboost_stacktrace_noop.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C62042FD0100D2A207 /* libboost_stacktrace_noop.dylib */; }; - 386386072042FD0200D2A207 /* libboost_thread-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C72042FD0100D2A207 /* libboost_thread-mt.dylib */; }; - 386386082042FD0200D2A207 /* libboost_unit_test_framework-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C82042FD0100D2A207 /* libboost_unit_test_framework-mt.dylib */; }; - 386386092042FD0200D2A207 /* libboost_math_c99-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385C92042FD0100D2A207 /* libboost_math_c99-mt.dylib */; }; - 3863860A2042FD0200D2A207 /* libboost_timer.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CA2042FD0100D2A207 /* libboost_timer.dylib */; }; - 3863860B2042FD0200D2A207 /* libboost_math_tr1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CB2042FD0100D2A207 /* libboost_math_tr1.dylib */; }; - 3863860C2042FD0200D2A207 /* libboost_wserialization.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CC2042FD0100D2A207 /* libboost_wserialization.dylib */; }; - 3863860D2042FD0200D2A207 /* libboost_stacktrace_addr2line-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CD2042FD0100D2A207 /* libboost_stacktrace_addr2line-mt.dylib */; }; - 3863860E2042FD0200D2A207 /* libboost_container.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CE2042FD0100D2A207 /* libboost_container.dylib */; }; - 3863860F2042FD0200D2A207 /* libboost_iostreams-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385CF2042FD0100D2A207 /* libboost_iostreams-mt.dylib */; }; - 386386102042FD0200D2A207 /* libboost_type_erasure-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D02042FD0100D2A207 /* libboost_type_erasure-mt.dylib */; }; - 386386112042FD0200D2A207 /* libboost_stacktrace_addr2line.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D12042FD0100D2A207 /* libboost_stacktrace_addr2line.dylib */; }; - 386386122042FD0200D2A207 /* libboost_date_time.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D22042FD0100D2A207 /* libboost_date_time.dylib */; }; - 386386132042FD0200D2A207 /* libboost_math_tr1f-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */; }; - 386386142042FD0200D2A207 /* libboost_wave-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */; }; 386FE36520581655001B661C /* XConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36020581654001B661C /* XConnection.cpp */; }; 386FE36620581655001B661C /* XGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36220581655001B661C /* XGlobal.cpp */; }; 386FE36720581655001B661C /* XPoolConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36320581655001B661C /* XPoolConnection.cpp */; }; + 386FE36820583768001B661C /* libboost_system.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BC2042FD0000D2A207 /* libboost_system.dylib */; }; 38D36F8C2053FFA600B964C1 /* CLMiner_kernel.cl in Copy Files */ = {isa = PBXBuildFile; fileRef = 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */; }; /* End PBXBuildFile section */ @@ -255,71 +192,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 386FE36820583768001B661C /* libboost_system.dylib in Frameworks */, 386385942042FC6400D2A207 /* OpenCL.framework in Frameworks */, - 386385D52042FD0100D2A207 /* libboost_atomic-mt.dylib in Frameworks */, - 386385D62042FD0100D2A207 /* libboost_log-mt.dylib in Frameworks */, - 386385D72042FD0100D2A207 /* libboost_locale-mt.dylib in Frameworks */, - 386385D82042FD0100D2A207 /* libboost_program_options.dylib in Frameworks */, - 386385D92042FD0100D2A207 /* libboost_math_c99l-mt.dylib in Frameworks */, - 386385DA2042FD0100D2A207 /* libboost_graph.dylib in Frameworks */, - 386385DB2042FD0100D2A207 /* libboost_coroutine-mt.dylib in Frameworks */, - 386385DC2042FD0200D2A207 /* libboost_stacktrace_basic-mt.dylib in Frameworks */, - 386385DD2042FD0200D2A207 /* libboost_chrono-mt.dylib in Frameworks */, - 386385DE2042FD0200D2A207 /* libboost_system-mt.dylib in Frameworks */, - 386385DF2042FD0200D2A207 /* libboost_context-mt.dylib in Frameworks */, - 386385E02042FD0200D2A207 /* libboost_math_tr1f.dylib in Frameworks */, - 386385E12042FD0200D2A207 /* libboost_prg_exec_monitor.dylib in Frameworks */, - 386385E22042FD0200D2A207 /* libboost_random.dylib in Frameworks */, - 386385E32042FD0200D2A207 /* libboost_regex.dylib in Frameworks */, - 386385E42042FD0200D2A207 /* libboost_serialization.dylib in Frameworks */, - 386385E52042FD0200D2A207 /* libboost_signals.dylib in Frameworks */, - 386385E62042FD0200D2A207 /* libboost_stacktrace_noop-mt.dylib in Frameworks */, - 386385E72042FD0200D2A207 /* libboost_log.dylib in Frameworks */, - 386385E82042FD0200D2A207 /* libboost_graph-mt.dylib in Frameworks */, - 386385E92042FD0200D2A207 /* libboost_filesystem-mt.dylib in Frameworks */, - 386385EA2042FD0200D2A207 /* libboost_signals-mt.dylib in Frameworks */, - 386385EB2042FD0200D2A207 /* libboost_math_c99l.dylib in Frameworks */, - 386385EC2042FD0200D2A207 /* libboost_regex-mt.dylib in Frameworks */, - 386385ED2042FD0200D2A207 /* libboost_math_c99f-mt.dylib in Frameworks */, - 386385EE2042FD0200D2A207 /* libboost_stacktrace_basic.dylib in Frameworks */, - 386385EF2042FD0200D2A207 /* libboost_type_erasure.dylib in Frameworks */, - 386385F02042FD0200D2A207 /* libboost_iostreams.dylib in Frameworks */, - 386385F12042FD0200D2A207 /* libboost_fiber-mt.dylib in Frameworks */, - 386385F22042FD0200D2A207 /* libboost_math_c99.dylib in Frameworks */, - 386385F32042FD0200D2A207 /* libboost_log_setup-mt.dylib in Frameworks */, - 386385F42042FD0200D2A207 /* libboost_random-mt.dylib in Frameworks */, - 386385F52042FD0200D2A207 /* libboost_wserialization-mt.dylib in Frameworks */, - 386385F62042FD0200D2A207 /* libboost_timer-mt.dylib in Frameworks */, - 386385F72042FD0200D2A207 /* libboost_math_tr1l.dylib in Frameworks */, - 386385F82042FD0200D2A207 /* libboost_log_setup.dylib in Frameworks */, - 386385F92042FD0200D2A207 /* libboost_coroutine.dylib in Frameworks */, - 386385FA2042FD0200D2A207 /* libboost_math_c99f.dylib in Frameworks */, - 386385FB2042FD0200D2A207 /* libboost_math_tr1-mt.dylib in Frameworks */, - 386385FC2042FD0200D2A207 /* libboost_system.dylib in Frameworks */, - 386385FD2042FD0200D2A207 /* libboost_serialization-mt.dylib in Frameworks */, - 386385FE2042FD0200D2A207 /* libboost_filesystem.dylib in Frameworks */, - 386385FF2042FD0200D2A207 /* libboost_container-mt.dylib in Frameworks */, - 386386002042FD0200D2A207 /* libboost_program_options-mt.dylib in Frameworks */, - 386386012042FD0200D2A207 /* libboost_unit_test_framework.dylib in Frameworks */, - 386386022042FD0200D2A207 /* libboost_math_tr1l-mt.dylib in Frameworks */, - 386386032042FD0200D2A207 /* libboost_chrono.dylib in Frameworks */, - 386386042042FD0200D2A207 /* libboost_date_time-mt.dylib in Frameworks */, - 386386052042FD0200D2A207 /* libboost_prg_exec_monitor-mt.dylib in Frameworks */, - 386386062042FD0200D2A207 /* libboost_stacktrace_noop.dylib in Frameworks */, - 386386072042FD0200D2A207 /* libboost_thread-mt.dylib in Frameworks */, - 386386082042FD0200D2A207 /* libboost_unit_test_framework-mt.dylib in Frameworks */, - 386386092042FD0200D2A207 /* libboost_math_c99-mt.dylib in Frameworks */, - 3863860A2042FD0200D2A207 /* libboost_timer.dylib in Frameworks */, - 3863860B2042FD0200D2A207 /* libboost_math_tr1.dylib in Frameworks */, - 3863860C2042FD0200D2A207 /* libboost_wserialization.dylib in Frameworks */, - 3863860D2042FD0200D2A207 /* libboost_stacktrace_addr2line-mt.dylib in Frameworks */, - 3863860E2042FD0200D2A207 /* libboost_container.dylib in Frameworks */, - 3863860F2042FD0200D2A207 /* libboost_iostreams-mt.dylib in Frameworks */, - 386386102042FD0200D2A207 /* libboost_type_erasure-mt.dylib in Frameworks */, - 386386112042FD0200D2A207 /* libboost_stacktrace_addr2line.dylib in Frameworks */, - 386386122042FD0200D2A207 /* libboost_date_time.dylib in Frameworks */, - 386386132042FD0200D2A207 /* libboost_math_tr1f-mt.dylib in Frameworks */, - 386386142042FD0200D2A207 /* libboost_wave-mt.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -747,7 +621,7 @@ 3863842A204275AA00D2A207 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = NO; CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; @@ -775,7 +649,7 @@ 3863842B204275AA00D2A207 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = NO; CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; From bb2ed48b75989f3b8e90eaa1afa233193c2f741d Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Wed, 14 Mar 2018 01:08:21 +0800 Subject: [PATCH 24/41] update README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da69d1c..5cbeeba 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This miner does not require files wallet.dat and dnet_key.dat. Storage folder is 3) by default GPU-miner uses all OpenCL devices on the selected platform. You can specify particular devices using parameter "-opencl-devices 0 1 3". Use your device numbers instead of "0 1 3". Also use can use parameter "-d " there is count of used devices. 4) if GPU-miner sees only one device, but you have several devices, try to specify platform. For example: "-opencl-platform 1". -The project supports Windows OS and Linux OS now. Mac OS is planned in the future. +The project supports Windows OS, Linux OS and Mac OS now. Mac OS binary file will be provided in the near future. How to compile the project yourself: The project has 3 dependencies: OpenCL, Boost and OpenSSL @@ -34,10 +34,15 @@ Launch parameters: 2) GPU mining: ./xdag-gpu -G -a -p 3) CPU mining: ./xdag-gpu -cpu -a -p -t 8 -Mac OS: +Mac OS: Install Boost with brew. Open XCode project to build Mac OS version. +Launch parameters: +1) GPU benchmark: ./xdag-gpu -G -M +2) GPU mining: ./xdag-gpu -G -a -p +3) CPU mining: ./xdag-gpu -cpu -a -p -t 8 + Workaround on issue with high CPU usage with NVIDIA GPUs. There is an issue with NVIDIA GPUs leading to very high CPU usage. The reason is improper implementation of OpenCL by NVIDIA. When CPU thread waits for results from GPU, it does not stop, it spins in loop eating CPU resources for nothing. There was impemented a workaround on this issue: before reading results from GPU current thread sleeps during small calculated time. CPU usage was decreased in 90%. The change made optional, use launch parameter "-nvidia-fix" to enable it. The change can decrease hashrate a bit in some cases. But GPU rigs should gain increase of hashrate. So try it and choose to use or not to use it. From cd98086cd2c22670ef1bfff5508f86368b29b116 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Wed, 14 Mar 2018 02:14:03 +0800 Subject: [PATCH 25/41] add thread sync guard for task processor for potential issue --- GpuMiner/XDagCore/XTaskProcessor.cpp | 14 +++++++++----- GpuMiner/XDagCore/XTaskProcessor.h | 8 +++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/GpuMiner/XDagCore/XTaskProcessor.cpp b/GpuMiner/XDagCore/XTaskProcessor.cpp index 5b6c426..12d3122 100644 --- a/GpuMiner/XDagCore/XTaskProcessor.cpp +++ b/GpuMiner/XDagCore/XTaskProcessor.cpp @@ -1,5 +1,5 @@ #include "XTaskProcessor.h" -#include "Core/Log.h" +#include "Core/Log.h" XTaskProcessor::XTaskProcessor() { @@ -11,12 +11,14 @@ XTaskProcessor::~XTaskProcessor() } XTaskWrapper* XTaskProcessor::GetNextTask() -{ +{ + Guard l(_lock); return &_tasks[(_taskCount + 1) & 1]; } XTaskWrapper* XTaskProcessor::GetCurrentTask() -{ +{ + Guard l(_lock); if(_taskCount <= 0) { return NULL; @@ -27,14 +29,16 @@ XTaskWrapper* XTaskProcessor::GetCurrentTask() void XTaskProcessor::SwitchTask() { - //TODO: do I need thread sync? + //TODO: do I need thread sync? + Guard l(_lock); ++_taskCount; _tasks[_taskCount & 1]._taskIndex = _taskCount; _tasks[_taskCount & 1]._isShareFound = false; } void XTaskProcessor::DumpTasks() -{ +{ + Guard l(_lock); clog(XDag::DebugChannel) << "Count of tasks: " << _taskCount << "task index: " << (_taskCount & 1); clog(XDag::DebugChannel) << "Task 0"; _tasks[0].DumpTask(); diff --git a/GpuMiner/XDagCore/XTaskProcessor.h b/GpuMiner/XDagCore/XTaskProcessor.h index 73efc9b..2299c2f 100644 --- a/GpuMiner/XDagCore/XTaskProcessor.h +++ b/GpuMiner/XDagCore/XTaskProcessor.h @@ -1,13 +1,15 @@ #pragma once -#include "XTaskWrapper.h" -#include +#include "XTaskWrapper.h" +#include "Core/Guards.h" class XTaskProcessor { private: XTaskWrapper _tasks[2]; - uint64_t _taskCount; + uint64_t _taskCount; + mutable Mutex _lock; + public: XTaskProcessor(); ~XTaskProcessor(); From 4b4deb226c3681b75cf05dfa5310646308806200 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Wed, 14 Mar 2018 19:39:24 +0800 Subject: [PATCH 26/41] fix intel integrated graphic card issue --- GpuMiner/GpuMiner.xcodeproj/project.pbxproj | 4 ++-- GpuMiner/MinerEngine/CLMiner.cpp | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj index e8bbd89..417a3a8 100644 --- a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj +++ b/GpuMiner/GpuMiner.xcodeproj/project.pbxproj @@ -35,7 +35,7 @@ 386FE36520581655001B661C /* XConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36020581654001B661C /* XConnection.cpp */; }; 386FE36620581655001B661C /* XGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36220581655001B661C /* XGlobal.cpp */; }; 386FE36720581655001B661C /* XPoolConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36320581655001B661C /* XPoolConnection.cpp */; }; - 386FE36820583768001B661C /* libboost_system.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BC2042FD0000D2A207 /* libboost_system.dylib */; }; + 386FE36820583768001B661C /* libboost_system.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BC2042FD0000D2A207 /* libboost_system.dylib */; settings = {ATTRIBUTES = (Required, ); }; }; 38D36F8C2053FFA600B964C1 /* CLMiner_kernel.cl in Copy Files */ = {isa = PBXBuildFile; fileRef = 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */; }; /* End PBXBuildFile section */ @@ -55,7 +55,7 @@ /* Begin PBXFileReference section */ 38638422204275AA00D2A207 /* GpuMiner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = GpuMiner; sourceTree = BUILT_PRODUCTS_DIR; }; - 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.opencl; path = CLMiner_kernel.cl; sourceTree = ""; }; + 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.opencl; lineEnding = 2; path = CLMiner_kernel.cl; sourceTree = ""; }; 386385292042EE6000D2A207 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = ""; }; 3863852C2042EE6000D2A207 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; 3863852E2042EE6100D2A207 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index b5fb872..332ef15 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -250,7 +250,19 @@ std::vector GetDevices(std::vector const& platforms, u cl_device_type type = useAllOpenCLCompatibleDevices ? CL_DEVICE_TYPE_ALL : CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR; - platforms[platform_num].getDevices(type, &devices); + platforms[platform_num].getDevices(type, &devices); + +#if defined (__APPLE) || defined (__MACOS) + auto iter = devices.begin(); + for (; iter != devices.end(); iter++) { + size_t maxParam = 0; + iter->getInfo(CL_DEVICE_MAX_PARAMETER_SIZE, &maxParam); + if (maxParam <= 1024) { //Tricky fix, that Intel integrate graphic card is not supported on Mac OS due to parameter size. + iter = devices.erase(iter); + iter --; + } + } +#endif } catch(cl::Error const& err) { From 5f08bfc8e0ea968c284081390cdf4ef263249ec3 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Wed, 21 Mar 2018 21:37:07 +0800 Subject: [PATCH 27/41] reconfigure xcode configuration for binary --- .gitignore | 1 + .../GpuMiner.xcodeproj/project.pbxproj | 189 ++++-------------- mac/libboost_system.a | Bin 0 -> 116504 bytes 3 files changed, 39 insertions(+), 151 deletions(-) rename {GpuMiner => mac}/GpuMiner.xcodeproj/project.pbxproj (56%) create mode 100644 mac/libboost_system.a diff --git a/.gitignore b/.gitignore index 04b70b3..0d2f020 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ GpuMiner/version.aps /Debug/ /GpuMiner/Debug/ GpuMiner/GpuMiner.xcodeproj/project.xcworkspace +mac/GpuMiner.xcodeproj/project.xcworkspace diff --git a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj b/mac/GpuMiner.xcodeproj/project.pbxproj similarity index 56% rename from GpuMiner/GpuMiner.xcodeproj/project.pbxproj rename to mac/GpuMiner.xcodeproj/project.pbxproj index 417a3a8..1c93047 100644 --- a/GpuMiner/GpuMiner.xcodeproj/project.pbxproj +++ b/mac/GpuMiner.xcodeproj/project.pbxproj @@ -35,7 +35,8 @@ 386FE36520581655001B661C /* XConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36020581654001B661C /* XConnection.cpp */; }; 386FE36620581655001B661C /* XGlobal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36220581655001B661C /* XGlobal.cpp */; }; 386FE36720581655001B661C /* XPoolConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386FE36320581655001B661C /* XPoolConnection.cpp */; }; - 386FE36820583768001B661C /* libboost_system.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 386385BC2042FD0000D2A207 /* libboost_system.dylib */; settings = {ATTRIBUTES = (Required, ); }; }; + 3887A2ED206295080093A1DF /* libboost_system.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3887A2EC206295080093A1DF /* libboost_system.a */; }; + 3887A2EF2062955D0093A1DF /* libboost_system.a in Resources */ = {isa = PBXBuildFile; fileRef = 3887A2EC206295080093A1DF /* libboost_system.a */; }; 38D36F8C2053FFA600B964C1 /* CLMiner_kernel.cl in Copy Files */ = {isa = PBXBuildFile; fileRef = 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */; }; /* End PBXBuildFile section */ @@ -56,9 +57,9 @@ /* Begin PBXFileReference section */ 38638422204275AA00D2A207 /* GpuMiner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = GpuMiner; sourceTree = BUILT_PRODUCTS_DIR; }; 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.opencl; lineEnding = 2; path = CLMiner_kernel.cl; sourceTree = ""; }; - 386385292042EE6000D2A207 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = ""; }; - 3863852C2042EE6000D2A207 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 3863852E2042EE6100D2A207 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; + 386385292042EE6000D2A207 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resource.h; path = ../GpuMiner/resource.h; sourceTree = ""; }; + 3863852C2042EE6000D2A207 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../GpuMiner/main.cpp; sourceTree = ""; }; + 3863852E2042EE6100D2A207 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = version.h; path = ../GpuMiner/version.h; sourceTree = ""; }; 386385312042EE6100D2A207 /* cl2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cl2.hpp; sourceTree = ""; }; 386385322042EE6100D2A207 /* CLMiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CLMiner.cpp; sourceTree = ""; }; 386385332042EE6100D2A207 /* CLMiner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLMiner.h; sourceTree = ""; }; @@ -115,76 +116,13 @@ 386385742042EE6100D2A207 /* Worker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Worker.cpp; sourceTree = ""; }; 386385752042EE6100D2A207 /* Worker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Worker.h; sourceTree = ""; }; 386385932042FC6300D2A207 /* OpenCL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenCL.framework; path = System/Library/Frameworks/OpenCL.framework; sourceTree = SDKROOT; }; - 386385952042FCFE00D2A207 /* libboost_atomic-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_atomic-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_atomic-mt.dylib"; sourceTree = ""; }; - 386385962042FCFE00D2A207 /* libboost_log-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_log-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log-mt.dylib"; sourceTree = ""; }; - 386385972042FCFE00D2A207 /* libboost_locale-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_locale-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_locale-mt.dylib"; sourceTree = ""; }; - 386385982042FCFE00D2A207 /* libboost_program_options.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_program_options.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_program_options.dylib; sourceTree = ""; }; - 386385992042FCFE00D2A207 /* libboost_math_c99l-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_c99l-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99l-mt.dylib"; sourceTree = ""; }; - 3863859A2042FCFE00D2A207 /* libboost_graph.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_graph.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_graph.dylib; sourceTree = ""; }; - 3863859B2042FCFE00D2A207 /* libboost_coroutine-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_coroutine-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_coroutine-mt.dylib"; sourceTree = ""; }; - 3863859C2042FCFE00D2A207 /* libboost_stacktrace_basic-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_stacktrace_basic-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_basic-mt.dylib"; sourceTree = ""; }; - 3863859D2042FCFE00D2A207 /* libboost_chrono-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_chrono-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_chrono-mt.dylib"; sourceTree = ""; }; - 3863859E2042FCFF00D2A207 /* libboost_system-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_system-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_system-mt.dylib"; sourceTree = ""; }; - 3863859F2042FCFF00D2A207 /* libboost_context-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_context-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_context-mt.dylib"; sourceTree = ""; }; - 386385A02042FCFF00D2A207 /* libboost_math_tr1f.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_tr1f.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1f.dylib; sourceTree = ""; }; - 386385A12042FCFF00D2A207 /* libboost_prg_exec_monitor.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_prg_exec_monitor.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_prg_exec_monitor.dylib; sourceTree = ""; }; - 386385A22042FCFF00D2A207 /* libboost_random.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_random.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_random.dylib; sourceTree = ""; }; - 386385A32042FCFF00D2A207 /* libboost_regex.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_regex.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_regex.dylib; sourceTree = ""; }; - 386385A42042FCFF00D2A207 /* libboost_serialization.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_serialization.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_serialization.dylib; sourceTree = ""; }; - 386385A52042FCFF00D2A207 /* libboost_signals.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_signals.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_signals.dylib; sourceTree = ""; }; - 386385A62042FCFF00D2A207 /* libboost_stacktrace_noop-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_stacktrace_noop-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_noop-mt.dylib"; sourceTree = ""; }; - 386385A72042FCFF00D2A207 /* libboost_log.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_log.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log.dylib; sourceTree = ""; }; - 386385A82042FCFF00D2A207 /* libboost_graph-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_graph-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_graph-mt.dylib"; sourceTree = ""; }; - 386385A92042FCFF00D2A207 /* libboost_filesystem-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_filesystem-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_filesystem-mt.dylib"; sourceTree = ""; }; - 386385AA2042FCFF00D2A207 /* libboost_signals-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_signals-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_signals-mt.dylib"; sourceTree = ""; }; - 386385AB2042FCFF00D2A207 /* libboost_math_c99l.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_c99l.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99l.dylib; sourceTree = ""; }; - 386385AC2042FCFF00D2A207 /* libboost_regex-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_regex-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_regex-mt.dylib"; sourceTree = ""; }; - 386385AD2042FCFF00D2A207 /* libboost_math_c99f-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_c99f-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99f-mt.dylib"; sourceTree = ""; }; - 386385AE2042FCFF00D2A207 /* libboost_stacktrace_basic.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_stacktrace_basic.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_basic.dylib; sourceTree = ""; }; - 386385AF2042FD0000D2A207 /* libboost_type_erasure.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_type_erasure.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_type_erasure.dylib; sourceTree = ""; }; - 386385B02042FD0000D2A207 /* libboost_iostreams.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_iostreams.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_iostreams.dylib; sourceTree = ""; }; - 386385B12042FD0000D2A207 /* libboost_fiber-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_fiber-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_fiber-mt.dylib"; sourceTree = ""; }; - 386385B22042FD0000D2A207 /* libboost_math_c99.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_c99.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99.dylib; sourceTree = ""; }; - 386385B32042FD0000D2A207 /* libboost_log_setup-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_log_setup-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log_setup-mt.dylib"; sourceTree = ""; }; - 386385B42042FD0000D2A207 /* libboost_random-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_random-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_random-mt.dylib"; sourceTree = ""; }; - 386385B52042FD0000D2A207 /* libboost_wserialization-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_wserialization-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_wserialization-mt.dylib"; sourceTree = ""; }; - 386385B62042FD0000D2A207 /* libboost_timer-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_timer-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_timer-mt.dylib"; sourceTree = ""; }; - 386385B72042FD0000D2A207 /* libboost_math_tr1l.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_tr1l.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1l.dylib; sourceTree = ""; }; - 386385B82042FD0000D2A207 /* libboost_log_setup.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_log_setup.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_log_setup.dylib; sourceTree = ""; }; - 386385B92042FD0000D2A207 /* libboost_coroutine.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_coroutine.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_coroutine.dylib; sourceTree = ""; }; - 386385BA2042FD0000D2A207 /* libboost_math_c99f.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_c99f.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99f.dylib; sourceTree = ""; }; - 386385BB2042FD0000D2A207 /* libboost_math_tr1-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_tr1-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1-mt.dylib"; sourceTree = ""; }; - 386385BC2042FD0000D2A207 /* libboost_system.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_system.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_system.dylib; sourceTree = ""; }; - 386385BD2042FD0000D2A207 /* libboost_serialization-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_serialization-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_serialization-mt.dylib"; sourceTree = ""; }; - 386385BE2042FD0000D2A207 /* libboost_filesystem.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_filesystem.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_filesystem.dylib; sourceTree = ""; }; - 386385BF2042FD0000D2A207 /* libboost_container-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_container-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_container-mt.dylib"; sourceTree = ""; }; - 386385C02042FD0000D2A207 /* libboost_program_options-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_program_options-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_program_options-mt.dylib"; sourceTree = ""; }; - 386385C12042FD0000D2A207 /* libboost_unit_test_framework.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_unit_test_framework.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_unit_test_framework.dylib; sourceTree = ""; }; - 386385C22042FD0000D2A207 /* libboost_math_tr1l-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_tr1l-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1l-mt.dylib"; sourceTree = ""; }; - 386385C32042FD0100D2A207 /* libboost_chrono.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_chrono.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_chrono.dylib; sourceTree = ""; }; - 386385C42042FD0100D2A207 /* libboost_date_time-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_date_time-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_date_time-mt.dylib"; sourceTree = ""; }; - 386385C52042FD0100D2A207 /* libboost_prg_exec_monitor-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_prg_exec_monitor-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_prg_exec_monitor-mt.dylib"; sourceTree = ""; }; - 386385C62042FD0100D2A207 /* libboost_stacktrace_noop.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_stacktrace_noop.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_noop.dylib; sourceTree = ""; }; - 386385C72042FD0100D2A207 /* libboost_thread-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_thread-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_thread-mt.dylib"; sourceTree = ""; }; - 386385C82042FD0100D2A207 /* libboost_unit_test_framework-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_unit_test_framework-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_unit_test_framework-mt.dylib"; sourceTree = ""; }; - 386385C92042FD0100D2A207 /* libboost_math_c99-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_c99-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_c99-mt.dylib"; sourceTree = ""; }; - 386385CA2042FD0100D2A207 /* libboost_timer.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_timer.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_timer.dylib; sourceTree = ""; }; - 386385CB2042FD0100D2A207 /* libboost_math_tr1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_math_tr1.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1.dylib; sourceTree = ""; }; - 386385CC2042FD0100D2A207 /* libboost_wserialization.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_wserialization.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_wserialization.dylib; sourceTree = ""; }; - 386385CD2042FD0100D2A207 /* libboost_stacktrace_addr2line-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_stacktrace_addr2line-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_addr2line-mt.dylib"; sourceTree = ""; }; - 386385CE2042FD0100D2A207 /* libboost_container.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_container.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_container.dylib; sourceTree = ""; }; - 386385CF2042FD0100D2A207 /* libboost_iostreams-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_iostreams-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_iostreams-mt.dylib"; sourceTree = ""; }; - 386385D02042FD0100D2A207 /* libboost_type_erasure-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_type_erasure-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_type_erasure-mt.dylib"; sourceTree = ""; }; - 386385D12042FD0100D2A207 /* libboost_stacktrace_addr2line.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_stacktrace_addr2line.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_stacktrace_addr2line.dylib; sourceTree = ""; }; - 386385D22042FD0100D2A207 /* libboost_date_time.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libboost_date_time.dylib; path = ../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_date_time.dylib; sourceTree = ""; }; - 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_math_tr1f-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_math_tr1f-mt.dylib"; sourceTree = ""; }; - 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_wave-mt.dylib"; path = "../../../../../../usr/local/Cellar/boost/1.66.0/lib/libboost_wave-mt.dylib"; sourceTree = ""; }; 386FE35F20581654001B661C /* XGlobal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XGlobal.h; sourceTree = ""; }; 386FE36020581654001B661C /* XConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XConnection.cpp; sourceTree = ""; }; 386FE36120581655001B661C /* XConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XConnection.h; sourceTree = ""; }; 386FE36220581655001B661C /* XGlobal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XGlobal.cpp; sourceTree = ""; }; 386FE36320581655001B661C /* XPoolConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPoolConnection.cpp; sourceTree = ""; }; 386FE36420581655001B661C /* XPoolConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPoolConnection.h; sourceTree = ""; }; + 3887A2EC206295080093A1DF /* libboost_system.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libboost_system.a; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -192,7 +130,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 386FE36820583768001B661C /* libboost_system.dylib in Frameworks */, + 3887A2ED206295080093A1DF /* libboost_system.a in Frameworks */, 386385942042FC6400D2A207 /* OpenCL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -230,7 +168,8 @@ children = ( 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */, ); - path = CL; + name = CL; + path = ../GpuMiner/CL; sourceTree = ""; }; 3863852F2042EE6100D2A207 /* MinerEngine */ = { @@ -242,7 +181,8 @@ 386385342042EE6100D2A207 /* XCpuMiner.cpp */, 386385352042EE6100D2A207 /* XCpuMiner.h */, ); - path = MinerEngine; + name = MinerEngine; + path = ../GpuMiner/MinerEngine; sourceTree = ""; }; 386385302042EE6100D2A207 /* CL */ = { @@ -279,7 +219,8 @@ 386385542042EE6100D2A207 /* XTaskWrapper.h */, 386385552042EE6100D2A207 /* XTime.h */, ); - path = XDagCore; + name = XDagCore; + path = ../GpuMiner/XDagCore; sourceTree = ""; }; 386385372042EE6100D2A207 /* dar */ = { @@ -311,7 +252,8 @@ 386385592042EE6100D2A207 /* sha256_mod.cpp */, 3863855A2042EE6100D2A207 /* sha256_mod.h */, ); - path = Hash; + name = Hash; + path = ../GpuMiner/Hash; sourceTree = ""; }; 3863855B2042EE6100D2A207 /* Utils */ = { @@ -327,7 +269,8 @@ 386385632042EE6100D2A207 /* Utils.cpp */, 386385642042EE6100D2A207 /* Utils.h */, ); - path = Utils; + name = Utils; + path = ../GpuMiner/Utils; sourceTree = ""; }; 386385652042EE6100D2A207 /* Core */ = { @@ -350,76 +293,14 @@ 386385742042EE6100D2A207 /* Worker.cpp */, 386385752042EE6100D2A207 /* Worker.h */, ); - path = Core; + name = Core; + path = ../GpuMiner/Core; sourceTree = ""; }; 386385922042FC6300D2A207 /* Frameworks */ = { isa = PBXGroup; children = ( - 386385952042FCFE00D2A207 /* libboost_atomic-mt.dylib */, - 3863859D2042FCFE00D2A207 /* libboost_chrono-mt.dylib */, - 386385C32042FD0100D2A207 /* libboost_chrono.dylib */, - 386385BF2042FD0000D2A207 /* libboost_container-mt.dylib */, - 386385CE2042FD0100D2A207 /* libboost_container.dylib */, - 3863859F2042FCFF00D2A207 /* libboost_context-mt.dylib */, - 3863859B2042FCFE00D2A207 /* libboost_coroutine-mt.dylib */, - 386385B92042FD0000D2A207 /* libboost_coroutine.dylib */, - 386385C42042FD0100D2A207 /* libboost_date_time-mt.dylib */, - 386385D22042FD0100D2A207 /* libboost_date_time.dylib */, - 386385B12042FD0000D2A207 /* libboost_fiber-mt.dylib */, - 386385A92042FCFF00D2A207 /* libboost_filesystem-mt.dylib */, - 386385BE2042FD0000D2A207 /* libboost_filesystem.dylib */, - 386385A82042FCFF00D2A207 /* libboost_graph-mt.dylib */, - 3863859A2042FCFE00D2A207 /* libboost_graph.dylib */, - 386385CF2042FD0100D2A207 /* libboost_iostreams-mt.dylib */, - 386385B02042FD0000D2A207 /* libboost_iostreams.dylib */, - 386385972042FCFE00D2A207 /* libboost_locale-mt.dylib */, - 386385B32042FD0000D2A207 /* libboost_log_setup-mt.dylib */, - 386385B82042FD0000D2A207 /* libboost_log_setup.dylib */, - 386385962042FCFE00D2A207 /* libboost_log-mt.dylib */, - 386385A72042FCFF00D2A207 /* libboost_log.dylib */, - 386385C92042FD0100D2A207 /* libboost_math_c99-mt.dylib */, - 386385B22042FD0000D2A207 /* libboost_math_c99.dylib */, - 386385AD2042FCFF00D2A207 /* libboost_math_c99f-mt.dylib */, - 386385BA2042FD0000D2A207 /* libboost_math_c99f.dylib */, - 386385992042FCFE00D2A207 /* libboost_math_c99l-mt.dylib */, - 386385AB2042FCFF00D2A207 /* libboost_math_c99l.dylib */, - 386385BB2042FD0000D2A207 /* libboost_math_tr1-mt.dylib */, - 386385CB2042FD0100D2A207 /* libboost_math_tr1.dylib */, - 386385D32042FD0100D2A207 /* libboost_math_tr1f-mt.dylib */, - 386385A02042FCFF00D2A207 /* libboost_math_tr1f.dylib */, - 386385C22042FD0000D2A207 /* libboost_math_tr1l-mt.dylib */, - 386385B72042FD0000D2A207 /* libboost_math_tr1l.dylib */, - 386385C52042FD0100D2A207 /* libboost_prg_exec_monitor-mt.dylib */, - 386385A12042FCFF00D2A207 /* libboost_prg_exec_monitor.dylib */, - 386385C02042FD0000D2A207 /* libboost_program_options-mt.dylib */, - 386385982042FCFE00D2A207 /* libboost_program_options.dylib */, - 386385B42042FD0000D2A207 /* libboost_random-mt.dylib */, - 386385A22042FCFF00D2A207 /* libboost_random.dylib */, - 386385AC2042FCFF00D2A207 /* libboost_regex-mt.dylib */, - 386385A32042FCFF00D2A207 /* libboost_regex.dylib */, - 386385BD2042FD0000D2A207 /* libboost_serialization-mt.dylib */, - 386385A42042FCFF00D2A207 /* libboost_serialization.dylib */, - 386385AA2042FCFF00D2A207 /* libboost_signals-mt.dylib */, - 386385A52042FCFF00D2A207 /* libboost_signals.dylib */, - 386385CD2042FD0100D2A207 /* libboost_stacktrace_addr2line-mt.dylib */, - 386385D12042FD0100D2A207 /* libboost_stacktrace_addr2line.dylib */, - 3863859C2042FCFE00D2A207 /* libboost_stacktrace_basic-mt.dylib */, - 386385AE2042FCFF00D2A207 /* libboost_stacktrace_basic.dylib */, - 386385A62042FCFF00D2A207 /* libboost_stacktrace_noop-mt.dylib */, - 386385C62042FD0100D2A207 /* libboost_stacktrace_noop.dylib */, - 3863859E2042FCFF00D2A207 /* libboost_system-mt.dylib */, - 386385BC2042FD0000D2A207 /* libboost_system.dylib */, - 386385C72042FD0100D2A207 /* libboost_thread-mt.dylib */, - 386385B62042FD0000D2A207 /* libboost_timer-mt.dylib */, - 386385CA2042FD0100D2A207 /* libboost_timer.dylib */, - 386385D02042FD0100D2A207 /* libboost_type_erasure-mt.dylib */, - 386385AF2042FD0000D2A207 /* libboost_type_erasure.dylib */, - 386385C82042FD0100D2A207 /* libboost_unit_test_framework-mt.dylib */, - 386385C12042FD0000D2A207 /* libboost_unit_test_framework.dylib */, - 386385D42042FD0100D2A207 /* libboost_wave-mt.dylib */, - 386385B52042FD0000D2A207 /* libboost_wserialization-mt.dylib */, - 386385CC2042FD0100D2A207 /* libboost_wserialization.dylib */, + 3887A2EC206295080093A1DF /* libboost_system.a */, 386385932042FC6300D2A207 /* OpenCL.framework */, ); name = Frameworks; @@ -435,6 +316,7 @@ 3863841E204275AA00D2A207 /* Sources */, 3863841F204275AA00D2A207 /* Frameworks */, 38638420204275AA00D2A207 /* Copy Files */, + 3887A2EE206295580093A1DF /* Resources */, ); buildRules = ( ); @@ -477,6 +359,17 @@ }; /* End PBXProject section */ +/* Begin PBXResourcesBuildPhase section */ + 3887A2EE206295580093A1DF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3887A2EF2062955D0093A1DF /* libboost_system.a in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 3863841E204275AA00D2A207 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -632,17 +525,14 @@ ); GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)\"", + "\"$(SRCROOT)/../GpuMiner\"", /usr/local/opt/boost/include/, ); - LIBRARY_SEARCH_PATHS = ( - /usr/local/opt/boost/lib/, - /usr/local/Cellar/boost/1.66.0/lib, - ); + LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)"; OPENCL_COMPILER_VERSION = CL1.2; PRODUCT_NAME = "$(TARGET_NAME)"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; - USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)\" /usr/local/opt/boost/include/"; + USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/..GpuMiner\" /usr/local/opt/boost/include/"; }; name = Debug; }; @@ -657,17 +547,14 @@ GCC_PREPROCESSOR_DEFINITIONS = __MACOS; GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)\"", + "\"$(SRCROOT)/../GpuMiner\"", /usr/local/opt/boost/include/, ); - LIBRARY_SEARCH_PATHS = ( - /usr/local/opt/boost/lib/, - /usr/local/Cellar/boost/1.66.0/lib, - ); + LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)"; OPENCL_COMPILER_VERSION = CL1.2; PRODUCT_NAME = "$(TARGET_NAME)"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; - USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)\" /usr/local/opt/boost/include/"; + USER_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/..GpuMiner\" /usr/local/opt/boost/include/"; }; name = Release; }; diff --git a/mac/libboost_system.a b/mac/libboost_system.a new file mode 100644 index 0000000000000000000000000000000000000000..231705b7fa044903f230bb0795e45aa4544b2a0c GIT binary patch literal 116504 zcmeFad3+Q_`afPXlVczufxrkDMiPP~$dQ9v5DXAVG@JoM4GxoJ0wcMYT;PF#C`M56 zzE&4qUGH<%b#+xdR$X^JS9f*Q^*-=g@Ac;Qex9o8?&+BcArt(3|M=yV?x*T`-p^A{ zJyl&*eN1=uG=Hdi_4M93h51DVS>|8igu-zXCrlbQaa>l`gn}Xnq`0u4VB+}kSy_eS zCM)>L-ag;hilgVvE}4^6v0(9%lGy@(x6=-P*Cz@wUeVQxo~`IzioT-g9z|z4q~3N# z-%@m{Q}VYe`jDbOC_33C<$gskQ1nlVzOASyLE;Wov|iCmKz+Vr=1-_Bb_#8rWY zKqy#kM;+OD{R;wXTZ3)>xJmDR}}aP3si_2YXT)f4#z&&2r45Jw2_9IU`w#E zp`^1LF48yz}-{7wgs8-%f z?8EdX)d!lJ{j0jxY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0cr12># z!*9Abw~M4_=vDmR@NZetGOjtEk1sP{)hfuoYx6Rj=8sgWYuq1jy+(zu;Tv4IvU3Qs zDp_TJ%BpYkkxALu#n$8Yy+-vPh&{_E+4br}uTkB)LDw!R4bQPBiH>X?@k}4xItg!Ij2fGoIGXPqLBkql=4Pef?VYTg+$8FLr&?tXSz2@`|G?P9xL6ehFVX#>y-_lIxR*@PI^6{)YWAd&DPw%; zJe`ahYj>`cbo2ZYP>jh<%1TbmN=Zve%1*JZEM?LtWvGVzy z!jwET{!r1%a`~NtmgO>}e_Skw>q$u?eG}rE<8!tTZ_}Zxn(zAIRl?C3b`^?S#*yhbq{KPSnCMDuE;_QrcyhEBZIdMWPzo7gVj}GP1 literal 0 HcmV?d00001 From d66cae8dbcaea579cb7c48d5937d254162ec23dc Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Thu, 7 Jun 2018 01:51:15 +0300 Subject: [PATCH 28/41] Worker names --- GpuMiner/Core/MinerManager.cpp | 11 ++++++++++- GpuMiner/Core/MinerManager.h | 3 ++- GpuMiner/XDagCore/XPool.cpp | 7 ++++++- GpuMiner/XDagCore/XPool.h | 3 ++- GpuMiner/XDagCore/XPoolConnection.cpp | 21 +++++++++++++++------ GpuMiner/XDagCore/XPoolConnection.h | 1 + 6 files changed, 36 insertions(+), 10 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index c591394..97764ad 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -180,6 +180,14 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) } } } + else if((arg == "-w" || arg == "-worker") && i + 1 < argc) + { + _workerName = argv[++i]; + if(_workerName.length() > 28) + { + _workerName.resize(28); + } + } else if(arg == "-vectors") { _useVectors = true; @@ -246,6 +254,7 @@ void MinerManager::StreamHelp(ostream& _out) << " -d Limit number of used GPU devices to n (default: use everything available on selected platform)." << endl << " -list-devices List the detected devices and exit. Should be combined with -G or -cpu flag." << endl << " -nvidia-fix Use workaround on high cpu usage with nvidia cards. n - optional value of thread sleep time, should be 0-95. (default: 90)" << endl + << " -w, -worker Allows to set a worker name." << endl << endl << " OpenCL configuration:" << endl << " -cl-local-work Set the OpenCL local work size. Default is " << CLMiner::_defaultLocalWorkSize << endl @@ -320,7 +329,7 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri { XGlobal::Init(); XTaskProcessor taskProcessor; - XPool pool(_accountAddress, remote, &taskProcessor); + XPool pool(_accountAddress, remote, _workerName, &taskProcessor); if(!pool.Connect()) { cerr << "Cannot connect to pool" << endl; diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index 73d62ed..376051f 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -43,7 +43,7 @@ class MinerManager Mining }; - MinerManager(OperationMode mode = OperationMode::None) : _mode(_mode) {} + MinerManager(OperationMode mode = OperationMode::None) : _mode(mode) {} bool InterpretOption(int& i, int argc, char** argv); bool CheckMandatoryParams(); @@ -89,6 +89,7 @@ class MinerManager unsigned _poolRecheckPeriod = 2000; bool _poolRecheckSet = false; std::string _accountAddress; + std::string _workerName; int _worktimeout = 180; bool _show_hwmonitors = false; diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index d07c7d7..ceb521d 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -9,9 +9,10 @@ #define FIRST_SHARE_SEND_TIMEOUT 10 #define BLOCK_TIME 64 -XPool::XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcessor *taskProcessor) +XPool::XPool(std::string& accountAddress, std::string& poolAddress, std::string& workerName, XTaskProcessor *taskProcessor) { strcpy(_poolAddress, poolAddress.c_str()); + strcpy(_workerName, workerName.c_str()); _taskProcessor = taskProcessor; _taskTime = 0; _lastShareTime = 0; @@ -36,6 +37,10 @@ bool XPool::Connect() { return false; } + if(strlen(_workerName) > 0) + { + _connection.SendWorkerName(_workerName); + } _currentConnection = &_connection; return true; } diff --git a/GpuMiner/XDagCore/XPool.h b/GpuMiner/XDagCore/XPool.h index b3402e6..05a69b0 100644 --- a/GpuMiner/XDagCore/XPool.h +++ b/GpuMiner/XDagCore/XPool.h @@ -8,6 +8,7 @@ class XPool { private: char _poolAddress[256]; + char _workerName[29]; XPoolConnection _connection; XPoolConnection* _currentConnection; XTaskProcessor *_taskProcessor; @@ -20,7 +21,7 @@ class XPool void OnNewTask(xdag_field* data); bool HasNewShare(); public: - XPool(std::string& accountAddress, std::string& poolAddress, XTaskProcessor *taskProcessor); + XPool(std::string& accountAddress, std::string& poolAddress, std::string& workerName, XTaskProcessor *taskProcessor); virtual ~XPool(); bool Connect(); diff --git a/GpuMiner/XDagCore/XPoolConnection.cpp b/GpuMiner/XDagCore/XPoolConnection.cpp index 3af0b8e..d4a67a4 100644 --- a/GpuMiner/XDagCore/XPoolConnection.cpp +++ b/GpuMiner/XDagCore/XPoolConnection.cpp @@ -5,11 +5,12 @@ #include "dfstools/dfslib_crypt.h" #include "dar/crc.h" -#define SECTOR0_BASE 0x1947f3acu -#define SECTOR0_OFFSET 0x82e9d1b5u -#define HEADER_WORD 0x3fca9e2bu -#define MINERS_PWD "minersgonnamine" -#define DATA_SIZE (sizeof(struct xdag_field) / sizeof(uint32_t)) +#define SECTOR0_BASE 0x1947f3acu +#define SECTOR0_OFFSET 0x82e9d1b5u +#define BLOCK_HEADER_WORD 0x3fca9e2bu +#define MINERS_PWD "minersgonnamine" +#define DATA_SIZE (sizeof(struct xdag_field) / sizeof(uint32_t)) +#define WORKERNAME_HEADER_WORD 0xf46b9853u XPoolConnection::XPoolConnection() { @@ -102,7 +103,7 @@ bool XPoolConnection::SendToPool(xdag_field *fields, int fieldCount) uint32_t crc; fieldsCopy[0].transport_header = 0; XHash::GetHash(fieldsCopy, sizeof(struct xdag_block), hash); - fieldsCopy[0].transport_header = HEADER_WORD; + fieldsCopy[0].transport_header = BLOCK_HEADER_WORD; crc = crc_of_array((uint8_t *)fieldsCopy, sizeof(struct xdag_block)); fieldsCopy[0].transport_header |= (uint64_t)crc << 32; } @@ -205,3 +206,11 @@ bool XPoolConnection::WriteTaskData(std::function onSendTask) return onSendTask(); } + +void XPoolConnection::SendWorkerName(const char* workerName) +{ + xdag_field workerField = {0}; + ((uint32_t*)workerField.data)[0] = WORKERNAME_HEADER_WORD; + memcpy(&((uint32_t*)workerField.data)[1], workerName, strlen(workerName)); + SendToPool(&workerField, 1); +} diff --git a/GpuMiner/XDagCore/XPoolConnection.h b/GpuMiner/XDagCore/XPoolConnection.h index 44aa764..b658e7b 100644 --- a/GpuMiner/XDagCore/XPoolConnection.h +++ b/GpuMiner/XDagCore/XPoolConnection.h @@ -32,6 +32,7 @@ class XPoolConnection : public XConnection virtual bool Initialize(); virtual bool Connect(const char *address); uint64_t* GetAddressHash() { return _addressHash; } + void SendWorkerName(const char* workerName); bool ReadTaskData(std::function onNewTask); bool WriteTaskData(std::function onSendTask); From 78040f59cb47fcba1abf47b9fb092c2d1dc7f629 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Tue, 12 Jun 2018 00:24:21 +0300 Subject: [PATCH 29/41] Fee logic is updated --- GpuMiner/Core/MinerManager.cpp | 2 +- GpuMiner/XDagCore/XFee.cpp | 20 +++++++++++--------- GpuMiner/XDagCore/XFee.h | 14 ++++++++------ GpuMiner/XDagCore/XPool.cpp | 11 ++++++++++- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index cc2b254..b7703fd 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -341,7 +341,7 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri cerr << "Cannot connect to pool" << endl; exit(-1); } - if(!_disableFee && fee.Connect()) + if(!_disableFee) { pool.SetFee(&fee); } diff --git a/GpuMiner/XDagCore/XFee.cpp b/GpuMiner/XDagCore/XFee.cpp index b2efa77..de4714b 100644 --- a/GpuMiner/XDagCore/XFee.cpp +++ b/GpuMiner/XDagCore/XFee.cpp @@ -2,8 +2,8 @@ #include "Core/Log.h" #ifdef _DEBUG -#define FEE_PERIOD 3 -const std::string GpuDevAddress = "kbmuCfnozm0dpMmatKhmfqAbcxGhtufm"; +#define FEE_PERIOD 4 +const std::string GpuDevAddress = "YMB0XWN1vxY5jLiZwSDeTDQTRO2NVEW9"; #else #define FEE_PERIOD 100 const std::string GpuDevAddress = "gKNRtSL1pUaTpzMuPMznKw49ILtP6qX3"; @@ -36,11 +36,7 @@ bool XFee::Connect() clog(XDag::LogChannel) << "Failed to initialize network connection"; return false; } - if(!_connection.Connect(_poolAddress)) - { - return false; - } - return true; + return _connection.Connect(_poolAddress); } void XFee::Disconnect() @@ -49,7 +45,7 @@ void XFee::Disconnect() } //increases internal tasks counter and once a 100 tasks switches connection and address for mining (duration - one task) -bool XFee::ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPoolConnection* basePoolConnection) +bool XFee::SwitchConnection(XPoolConnection** currentPoolConnection, XPoolConnection* basePoolConnection) { if(_connectionIsSwitched) { @@ -60,6 +56,8 @@ bool XFee::ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPool _taskCounter = 0; *currentPoolConnection = basePoolConnection; _connectionIsSwitched = false; + Disconnect(); + return true; } @@ -69,6 +67,10 @@ bool XFee::ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPool } _taskCounter = 0; + if(!Connect()) + { + return false; + } _connection.SetAddress(_addressList[_nextAddressIndex]); *currentPoolConnection = &_connection; _connectionIsSwitched = true; @@ -77,4 +79,4 @@ bool XFee::ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPool _nextAddressIndex = 0; } return true; -} \ No newline at end of file +} diff --git a/GpuMiner/XDagCore/XFee.h b/GpuMiner/XDagCore/XFee.h index eb9ea24..3931917 100644 --- a/GpuMiner/XDagCore/XFee.h +++ b/GpuMiner/XDagCore/XFee.h @@ -6,18 +6,20 @@ class XFee { private: - int _nextAddressIndex; - int _taskCounter; + uint32_t _nextAddressIndex; + uint32_t _taskCounter; bool _connectionIsSwitched; std::vector _addressList; char _poolAddress[256]; XPoolConnection _connection; + + bool Connect(); + void Disconnect(); public: XFee(std::string& poolAddress); ~XFee(); - - bool Connect(); - void Disconnect(); - bool ShouldSwitchConnection(XPoolConnection** currentPoolConnection, XPoolConnection* basePoolConnection); + + bool SwitchConnection(XPoolConnection** currentPoolConnection, XPoolConnection* basePoolConnection); + bool ConnectionIsSwitched() const { return _connectionIsSwitched; } }; diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index bed14d8..ebb5640 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -61,6 +61,15 @@ bool XPool::Interract() bool success = CheckNewTasks(); success = success && SendTaskResult(); + + //if fee is active - switch connection to main address and do not return error + if(!success && _fee != NULL && _fee->ConnectionIsSwitched()) + { + _fee->SwitchConnection(&_currentConnection, &_connection); + _taskProcessor->ResetTasks(); + return true; + } + return success; } @@ -72,7 +81,7 @@ bool XPool::CheckNewTasks() void XPool::OnNewTask(xdag_field* data) { //if fee connection is activated - we should recieve a new task from the fee connection - if(_fee != NULL && _fee->ShouldSwitchConnection(&_currentConnection, &_connection)) + if(_fee != NULL && _fee->SwitchConnection(&_currentConnection, &_connection)) { #ifdef _DEBUG std::cout << "Connection changed" << std::endl; From d2c45873175659ad1f8cdfa48b4cdd6279d7a8e4 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Mon, 25 Jun 2018 01:10:16 +0300 Subject: [PATCH 30/41] Merge fix. Several bugs caused by non-initialized variables are fixed. --- GpuMiner.sln | 4 ++-- GpuMiner/Core/MinerManager.cpp | 4 ++-- GpuMiner/Core/MinerManager.h | 2 +- GpuMiner/GpuMiner.vcxproj | 3 ++- GpuMiner/MinerEngine/CLMiner.cpp | 27 ++------------------------- GpuMiner/XDagCore/XPool.cpp | 3 ++- GpuMiner/XDagCore/XPoolConnection.cpp | 1 + 7 files changed, 12 insertions(+), 32 deletions(-) diff --git a/GpuMiner.sln b/GpuMiner.sln index 211f13d..3ac433c 100644 --- a/GpuMiner.sln +++ b/GpuMiner.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GpuMiner", "GpuMiner\GpuMiner.vcxproj", "{F28FA0B5-F3B9-45B1-9271-6D4B23A19695}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DaggerGpuMiner", "GpuMiner\GpuMiner.vcxproj", "{F28FA0B5-F3B9-45B1-9271-6D4B23A19695}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index b7703fd..84a358e 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -172,7 +172,7 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) { try { - _nvidiaSpeedDamp = stoi(argv[i + 1]); + _nvidiaSpinDamp = stoi(argv[i + 1]); ++i; } catch (...) @@ -428,7 +428,7 @@ void MinerManager::ConfigureGpu() } CLMiner::SetNumInstances(_openclMiningDevices); - CLMiner::SetUseNvidiaFix(_useNvidiaFix, _nvidiaSpeedDamp); + CLMiner::SetUseNvidiaFix(_useNvidiaFix, _nvidiaSpinDamp); CLMiner::SetUseVectors(_useVectors); } diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index bd6eea3..1c4c05d 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -75,7 +75,7 @@ class MinerManager unsigned _localWorkSize = CLMiner::_defaultLocalWorkSize; bool _useNvidiaFix = false; bool _disableFee = false; - uint32_t _nvidiaSpeedDamp = CLMiner::_defaultNvidiaSpinDamp; + uint32_t _nvidiaSpinDamp = CLMiner::_defaultNvidiaSpinDamp; bool _useVectors = false; /// Benchmarking params diff --git a/GpuMiner/GpuMiner.vcxproj b/GpuMiner/GpuMiner.vcxproj index 30f161d..d26268f 100644 --- a/GpuMiner/GpuMiner.vcxproj +++ b/GpuMiner/GpuMiner.vcxproj @@ -141,13 +141,14 @@ Speed Fast false + None true true $(OPENCL_SDK)\lib\x86_64 OpenCL.lib;shlwapi.lib;%(AdditionalDependencies) - No + false UseLinkTimeCodeGeneration diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index 46fdef3..e24c7c7 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -283,6 +283,7 @@ int CLMiner::_devices[MAX_CL_DEVICES] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 CLMiner::CLMiner(uint32_t index, XTaskProcessor* taskProcessor) :Miner("cl-", index, taskProcessor) { + _kernelExecutionMcs = 0; } CLMiner::~CLMiner() @@ -493,8 +494,7 @@ bool CLMiner::Initialize() #if defined (__APPLE__) || defined (__MACOS) size_t local; - int err; - err = clGetKernelWorkGroupInfo(_searchKernel.get(), device.get(), CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); + int err = clGetKernelWorkGroupInfo(_searchKernel.get(), device.get(), CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); if (err != CL_SUCCESS) { fprintf(stdout, "Error: Failed to retrieve kernel work group info! err: %d\n", err); @@ -513,29 +513,6 @@ bool CLMiner::Initialize() _globalWorkSize = ((_globalWorkSize / _workgroupSize) + 1) * _workgroupSize; } -#if defined (__APPLE__) || defined (__MACOS) - size_t local; - - int err; - err = clGetKernelWorkGroupInfo(_searchKernel.get(), device.get(), CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); - if (err != CL_SUCCESS) - { - fprintf(stdout, "Error: Failed to retrieve kernel work group info! err: %d\n", err); - return false; - } - - _workgroupSize = std::min(_sWorkgroupSize,(uint32_t)local); - _globalWorkSize = _sInitialGlobalWorkSize; -#else - _workgroupSize = _sWorkgroupSize; - _globalWorkSize = _sInitialGlobalWorkSize; -#endif - // make sure that global work size is evenly divisible by the local workgroup size - if(_globalWorkSize % _workgroupSize != 0) - { - _globalWorkSize = ((_globalWorkSize / _workgroupSize) + 1) * _workgroupSize; - } - // create buffer for initial hashing state XCL_LOG("Creating buffer for initial hashing state."); _stateBuffer = cl::Buffer(_context, CL_MEM_READ_ONLY, 32); diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index ebb5640..73ee16a 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -9,7 +9,7 @@ #define FIRST_SHARE_SEND_TIMEOUT 10 #define BLOCK_TIME 64 -XPool::XPool(std::string& accountAddress, std::string& poolAddress, std::string& workerName, XTaskProcessor *taskProcessor) +XPool::XPool(std::string& accountAddress, std::string& poolAddress, std::string& workerName, XTaskProcessor *taskProcessor) { strcpy(_poolAddress, poolAddress.c_str()); strcpy(_workerName, workerName.c_str()); @@ -17,6 +17,7 @@ XPool::XPool(std::string& accountAddress, std::string& poolAddress, std::string& _taskTime = 0; _lastShareTime = 0; _currentConnection = NULL; + _fee = NULL; memset(_lastHash, 0, sizeof(xdag_hash_t)); _connection.SetAddress(accountAddress); } diff --git a/GpuMiner/XDagCore/XPoolConnection.cpp b/GpuMiner/XDagCore/XPoolConnection.cpp index 136f5e9..1a04bfd 100644 --- a/GpuMiner/XDagCore/XPoolConnection.cpp +++ b/GpuMiner/XDagCore/XPoolConnection.cpp @@ -14,6 +14,7 @@ XPoolConnection::XPoolConnection() { + _crypt = NULL; _localMiner.nfield_in = 0; _localMiner.nfield_out = 0; } From 7df17b72fd4df62dc913bd68c55711e24974ce0c Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Tue, 26 Jun 2018 01:59:48 +0300 Subject: [PATCH 31/41] Fix for non-stop hashrate for dead cards --- GpuMiner/Core/Farm.cpp | 79 +++++++++++++++----------------- GpuMiner/Core/Farm.h | 11 +++-- GpuMiner/Core/Miner.cpp | 4 +- GpuMiner/Core/Miner.h | 10 ++-- GpuMiner/Core/MinerManager.cpp | 47 ++++++++++++++++++- GpuMiner/Core/MinerManager.h | 13 +++++- GpuMiner/Core/Worker.h | 2 +- GpuMiner/MinerEngine/CLMiner.cpp | 35 ++++++++------ GpuMiner/MinerEngine/CLMiner.h | 2 +- 9 files changed, 130 insertions(+), 73 deletions(-) diff --git a/GpuMiner/Core/Farm.cpp b/GpuMiner/Core/Farm.cpp index 8af3f80..b6b628a 100644 --- a/GpuMiner/Core/Farm.cpp +++ b/GpuMiner/Core/Farm.cpp @@ -12,6 +12,13 @@ using namespace XDag; +Farm::Farm(XTaskProcessor* taskProcessor, boost::asio::io_service &io_service) : + _io_strand(io_service), + _hashrateTimer(io_service) +{ + _taskProcessor = taskProcessor; +} + /** * @brief Start a number of miners. */ @@ -66,21 +73,12 @@ bool Farm::Start() // package. m->StartWorking(); } - _isMining = true; + _isMining.store(true, std::memory_order_relaxed); + _progressJustStarted = true; - if(!_hashrateTimer) - { - _hashrateTimer = new boost::asio::deadline_timer(_io_service, boost::posix_time::milliseconds(1000)); - _hashrateTimer->async_wait(boost::bind(&Farm::ProcessHashRate, this, boost::asio::placeholders::error)); - if(_serviceThread.joinable()) - { - _io_service.reset(); - } - else - { - _serviceThread = std::thread { boost::bind(&boost::asio::io_service::run, &_io_service) }; - } - } + // Start hashrate collector + _hashrateTimer.expires_from_now(boost::posix_time::milliseconds(1000)); + _hashrateTimer.async_wait(_io_strand.wrap(boost::bind(&Farm::ProcessHashRate, this, boost::asio::placeholders::error))); return true; } @@ -97,44 +95,34 @@ void Farm::Stop() m->StopWorking(); } _miners.clear(); - _isMining = false; - } - - _io_service.stop(); - if(_serviceThread.joinable()) - { - _serviceThread.join(); + _isMining.store(false, std::memory_order_relaxed); } - if(_hashrateTimer) - { - _hashrateTimer->cancel(); - _hashrateTimer = nullptr; - } + _hashrateTimer.cancel(); + _lastProgresses.clear(); } void Farm::CollectHashRate() { + auto now = std::chrono::steady_clock::now(); + + Guard l(_minerWorkLock); WorkingProgress p; - Guard l2(_minerWorkLock); - p.ms = std::chrono::duration_cast(std::chrono::steady_clock::now() - _lastStart).count(); - //Collect - for(auto const& i : _miners) + p.ms = std::chrono::duration_cast(now - _lastStart).count(); + _lastStart = now; + + // Collect & Reset + for(auto const& m : _miners) { - uint64_t minerHashCount = i->HashCount(); + uint64_t minerHashCount = m->HashCount(); + m->ResetHashCount(); p.hashes += minerHashCount; p.minersHashes.push_back(minerHashCount); } - //Reset - for(auto const& i : _miners) - { - i->ResetHashCount(); - } - _lastStart = std::chrono::steady_clock::now(); - - if(p.hashes > 0) + if(p.hashes > 0 || !_progressJustStarted) { + _progressJustStarted = false; _lastProgresses.push_back(p); } @@ -154,12 +142,17 @@ void Farm::ProcessHashRate(const boost::system::error_code& ec) { if(!ec) { + if(!IsMining()) + { + return; + } + CollectHashRate(); - } - // Restart timer - _hashrateTimer->expires_at(_hashrateTimer->expires_at() + boost::posix_time::milliseconds(1000)); - _hashrateTimer->async_wait(boost::bind(&Farm::ProcessHashRate, this, boost::asio::placeholders::error)); + // Resubmit timer only if actually mining + _hashrateTimer.expires_from_now(boost::posix_time::milliseconds(1000)); + _hashrateTimer.async_wait(_io_strand.wrap(boost::bind(&Farm::ProcessHashRate, this, boost::asio::placeholders::error))); + } } /** diff --git a/GpuMiner/Core/Farm.h b/GpuMiner/Core/Farm.h index b73bcb0..0d2f840 100644 --- a/GpuMiner/Core/Farm.h +++ b/GpuMiner/Core/Farm.h @@ -34,7 +34,7 @@ namespace XDag std::function Create; }; - Farm(XTaskProcessor* taskProcessor) { _taskProcessor = taskProcessor; } + Farm(XTaskProcessor* taskProcessor, boost::asio::io_service & io_service); ~Farm() { Stop(); @@ -63,7 +63,7 @@ namespace XDag bool IsMining() const { - return _isMining; + return _isMining.load(std::memory_order_relaxed); } /** @@ -106,10 +106,11 @@ namespace XDag std::chrono::steady_clock::time_point _lastStart; uint32_t _hashrateSmoothInterval = 10000; - std::thread _serviceThread; ///< The IO service thread. - boost::asio::io_service _io_service; - boost::asio::deadline_timer *_hashrateTimer = nullptr; + + boost::asio::io_service::strand _io_strand; + boost::asio::deadline_timer _hashrateTimer; std::vector _lastProgresses; + bool _progressJustStarted; std::chrono::steady_clock::time_point _farm_launched = std::chrono::steady_clock::now(); }; diff --git a/GpuMiner/Core/Miner.cpp b/GpuMiner/Core/Miner.cpp index fd031f5..8af2fe4 100644 --- a/GpuMiner/Core/Miner.cpp +++ b/GpuMiner/Core/Miner.cpp @@ -8,8 +8,8 @@ #include "Miner.h" -XDag::Miner::Miner(std::string const& _name, uint32_t index, XTaskProcessor* taskProcessor) : - Worker(_name + std::to_string(index)), +XDag::Miner::Miner(std::string const& name, uint32_t index, XTaskProcessor* taskProcessor) : + Worker(name + std::to_string(index)), _index(index), _taskProcessor(taskProcessor) { diff --git a/GpuMiner/Core/Miner.h b/GpuMiner/Core/Miner.h index 2eac091..cec4f7a 100644 --- a/GpuMiner/Core/Miner.h +++ b/GpuMiner/Core/Miner.h @@ -103,21 +103,21 @@ namespace XDag class Miner : public Worker { public: - Miner(std::string const& _name, uint32_t index, XTaskProcessor* taskProcessor); + Miner(std::string const& name, uint32_t index, XTaskProcessor* taskProcessor); virtual ~Miner() = default; - uint64_t HashCount() const { return _hashCount; } - void ResetHashCount() { _hashCount = 0; } + uint64_t HashCount() const { return _hashCount.load(std::memory_order_relaxed); } + void ResetHashCount() { _hashCount.store(0, std::memory_order_relaxed); } virtual HwMonitor Hwmon() = 0; virtual bool Initialize() = 0; protected: XTaskWrapper* GetTask() const { return _taskProcessor->GetCurrentTask(); } - void AddHashCount(uint64_t n) { _hashCount += n; } + void AddHashCount(uint64_t n) { _hashCount.fetch_add(n, std::memory_order_relaxed); } const uint32_t _index = 0; private: - uint64_t _hashCount = 0; + std::atomic _hashCount = { 0 }; XTaskProcessor* _taskProcessor; }; diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index 84a358e..6df15f4 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -21,6 +21,45 @@ using namespace std; using namespace XDag; +MinerManager::MinerManager(OperationMode mode) : + _mode(mode), + _io_work(_io_service), + _io_work_timer(_io_service), + _io_strand(_io_service) +{ + // Post first deadline timer to give io_service + // initial work + _io_work_timer.expires_from_now(boost::posix_time::seconds(60)); + _io_work_timer.async_wait(_io_strand.wrap(boost::bind(&MinerManager::IOWorkTimerHandler, this, boost::asio::placeholders::error))); + + // Start io_service in it's own thread + _io_thread = std::thread { boost::bind(&boost::asio::io_service::run, &_io_service) }; + + // Io service is now live and running + // All components using io_service should post to reference of m_io_service + // and should not start/stop or even join threads (which heavily time consuming) + + +} + +void MinerManager::IOWorkTimerHandler(const boost::system::error_code& ec) +{ + if(!ec) + { + // This does absolutely nothing aside resubmitting timer + // ensuring io_service's queue has always something to do + _io_work_timer.expires_from_now(boost::posix_time::seconds(120)); + _io_work_timer.async_wait(_io_strand.wrap(boost::bind(&MinerManager::IOWorkTimerHandler, this, boost::asio::placeholders::error))); + } +} + +void MinerManager::StopIOService() +{ + // Here we stop all io_service's related activities + _io_service.stop(); + _io_thread.join(); +} + bool MinerManager::InterpretOption(int& i, int argc, char** argv) { string arg = argv[i]; @@ -281,7 +320,7 @@ void MinerManager::DoBenchmark(MinerType type, unsigned warmupDuration, unsigned FillRandomTask(taskProcessor.GetNextTask()); taskProcessor.SwitchTask(); - Farm farm(&taskProcessor); + Farm farm(&taskProcessor, _io_service); farm.AddSeeker(Farm::SeekerDescriptor { &CLMiner::Instances, [](unsigned index, XTaskProcessor* taskProcessor) { return new CLMiner(index, taskProcessor); } }); string platformInfo = "CL"; @@ -327,6 +366,8 @@ void MinerManager::DoBenchmark(MinerType type, unsigned warmupDuration, unsigned innerMean /= (trials - 2); cout << "min/mean/max: " << results.begin()->second.Rate() << "/" << (mean / trials) << "/" << results.rbegin()->second.Rate() << " H/s" << endl; cout << "inner mean: " << innerMean << " H/s" << endl; + + StopIOService(); } void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeriod) @@ -348,7 +389,7 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri //wait a bit this_thread::sleep_for(chrono::milliseconds(200)); - Farm farm(&taskProcessor); + Farm farm(&taskProcessor, _io_service); if((type & MinerType::CL) == MinerType::CL) { @@ -377,6 +418,7 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri if(!farm.Start()) { cerr << "Failed to restart mining"; + StopIOService(); exit(-1); } } @@ -408,6 +450,7 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri ++iteration; } farm.Stop(); + StopIOService(); } void MinerManager::ConfigureGpu() diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index 1c4c05d..81a6127 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -18,6 +18,7 @@ #include #include #include +#include #include "Exceptions.h" #include "MinerEngine/CLMiner.h" @@ -43,7 +44,7 @@ class MinerManager Mining }; - MinerManager(OperationMode mode = OperationMode::None) : _mode(mode) {} + MinerManager(OperationMode mode = OperationMode::None); bool InterpretOption(int& i, int argc, char** argv); bool CheckMandatoryParams(); @@ -57,9 +58,19 @@ class MinerManager void ConfigureCpu(); void FillRandomTask(XTaskWrapper *taskWrapper); + void IOWorkTimerHandler(const boost::system::error_code& ec); + void StopIOService(); + /// Operating mode. OperationMode _mode; + /// Global boost's io_service + std::thread _io_thread; // The IO service thread + boost::asio::io_service _io_service; // The IO service itself + boost::asio::io_service::work _io_work; // The IO work which prevents io_service.run() to return on no work thus terminating thread + boost::asio::deadline_timer _io_work_timer; // A dummy timer to keep io_service with something to do and prevent io shutdown + boost::asio::io_service::strand _io_strand; // A strand to serialize posts in multithreaded environment + /// Mining options bool _running = true; MinerType _minerType = MinerType::NotSet; diff --git a/GpuMiner/Core/Worker.h b/GpuMiner/Core/Worker.h index 7978d58..3ec21be 100644 --- a/GpuMiner/Core/Worker.h +++ b/GpuMiner/Core/Worker.h @@ -28,7 +28,7 @@ namespace XDag class Worker { public: - Worker(std::string const& _name) : _name(_name) {} + Worker(std::string const& name) : _name(name) {} Worker(Worker const&) = delete; Worker& operator=(Worker const&) = delete; diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index e24c7c7..fe5ec71 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -537,18 +537,29 @@ bool CLMiner::Initialize() return true; } -void CLMiner::Reset() +bool CLMiner::Reset() { + cwarn << "GPU will be restarted"; + // pause for 0.5 sec std::this_thread::sleep_for(std::chrono::milliseconds(500)); - _stateBuffer = cl::Buffer(); - _precalcStateBuffer = cl::Buffer(); - _dataBuffer = cl::Buffer(); - _searchBuffer = cl::Buffer(); - _searchKernel = cl::Kernel(); - _queue = cl::CommandQueue(); - _context = cl::Context(); + try + { + _stateBuffer = cl::Buffer(); + _precalcStateBuffer = cl::Buffer(); + _dataBuffer = cl::Buffer(); + _searchBuffer = cl::Buffer(); + _searchKernel = cl::Kernel(); + _queue = cl::CommandQueue(); + _context = cl::Context(); + + return Initialize(); + } + catch(cl::Error const& _e) + { + } + return false; } void CLMiner::WorkLoop() @@ -565,13 +576,11 @@ void CLMiner::WorkLoop() { cwarn << XDagCLErrorHelper("OpenCL Error", _e); if(++errorCount < MAX_GPU_ERROR_COUNT) - { - cwarn << "GPU will be restarted"; - Reset(); - if(!Initialize()) + { + if(!Reset()) { break; - } + } } } } diff --git a/GpuMiner/MinerEngine/CLMiner.h b/GpuMiner/MinerEngine/CLMiner.h index e20dd9e..2666b1f 100644 --- a/GpuMiner/MinerEngine/CLMiner.h +++ b/GpuMiner/MinerEngine/CLMiner.h @@ -87,7 +87,7 @@ namespace XDag void SetMinShare(XTaskWrapper* taskWrapper, uint64_t* searchBuffer, xdag_field& last); void WriteKernelArgs(XTaskWrapper* taskWrapper, uint64_t* zeroBuffer); void ReadData(uint64_t* results); - void Reset(); + bool Reset(); cl::Context _context; cl::CommandQueue _queue; From dc73c7d582184519e41c1ae7c4d53f8988cebc62 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Tue, 26 Jun 2018 02:02:39 +0300 Subject: [PATCH 32/41] Version is updated to 0.3.0 --- GpuMiner/XDagCore/XFee.cpp | 2 +- GpuMiner/version.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GpuMiner/XDagCore/XFee.cpp b/GpuMiner/XDagCore/XFee.cpp index de4714b..5d0fc1b 100644 --- a/GpuMiner/XDagCore/XFee.cpp +++ b/GpuMiner/XDagCore/XFee.cpp @@ -6,7 +6,7 @@ const std::string GpuDevAddress = "YMB0XWN1vxY5jLiZwSDeTDQTRO2NVEW9"; #else #define FEE_PERIOD 100 -const std::string GpuDevAddress = "gKNRtSL1pUaTpzMuPMznKw49ILtP6qX3"; +const std::string GpuDevAddress = "kllHUGcgV3lWjAcgM1o9JZreqeSshnfk"; const std::string CommunityAddress = "FQglVQtb60vQv2DOWEUL7yh3smtj7g1s"; #endif diff --git a/GpuMiner/version.h b/GpuMiner/version.h index 55bc940..acbefd0 100644 --- a/GpuMiner/version.h +++ b/GpuMiner/version.h @@ -2,8 +2,8 @@ #define STRINGIZE(s) STRINGIZE2(s) #define VERSION_MAJOR 0 -#define VERSION_MINOR 2 -#define VERSION_REVISION 4 +#define VERSION_MINOR 3 +#define VERSION_REVISION 0 #define VER_FILE_DESCRIPTION_STR "Standalone GPU/CPU miner for Dagger coin" #define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION From 377d573935480c1faba2eb1b18416eb12f618b37 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Thu, 5 Jul 2018 00:37:15 +0300 Subject: [PATCH 33/41] Gpu miner - protection against non-printable characters --- GpuMiner/Core/MinerManager.cpp | 26 ++++++++++++++++++++++---- GpuMiner/Core/MinerManager.h | 1 + GpuMiner/Utils/Utils.cpp | 16 ++++++++++++++++ GpuMiner/Utils/Utils.h | 2 ++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index 6df15f4..0cda126 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -17,6 +17,9 @@ #include "XDagCore/XGlobal.h" #include "Utils/CpuInfo.h" #include "Utils/Random.h" +#include "Utils/Utils.h" + +#define WORKER_NAME_MAX_LENGTH 28 using namespace std; using namespace XDag; @@ -38,8 +41,6 @@ MinerManager::MinerManager(OperationMode mode) : // Io service is now live and running // All components using io_service should post to reference of m_io_service // and should not start/stop or even join threads (which heavily time consuming) - - } void MinerManager::IOWorkTimerHandler(const boost::system::error_code& ec) @@ -222,9 +223,9 @@ bool MinerManager::InterpretOption(int& i, int argc, char** argv) else if((arg == "-w" || arg == "-worker") && i + 1 < argc) { _workerName = argv[++i]; - if(_workerName.length() > 28) + if(_workerName.length() > WORKER_NAME_MAX_LENGTH) { - _workerName.resize(28); + _workerName.resize(WORKER_NAME_MAX_LENGTH); } } else if(arg == "-vectors") @@ -372,6 +373,7 @@ void MinerManager::DoBenchmark(MinerType type, unsigned warmupDuration, unsigned void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeriod) { + ValidateWorkerName(); XGlobal::Init(); XTaskProcessor taskProcessor; @@ -501,3 +503,19 @@ void MinerManager::FillRandomTask(XTaskWrapper *taskWrapper) taskWrapper->FillAndPrecalc(data, addressHash); } + +void MinerManager::ValidateWorkerName() +{ + if(_workerName.empty()) + { + return; + } + + char buf[WORKER_NAME_MAX_LENGTH + 1]; + strcpy(buf, _workerName.c_str()); + if(ReplaceNonPrintableCharacters(buf, '_')) + { + cwarn << "Worker name contains invalid characters. All occurences will be replaced with '_'"; + _workerName = buf; + } +} \ No newline at end of file diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index 81a6127..ac1bf2e 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -57,6 +57,7 @@ class MinerManager void ConfigureGpu(); void ConfigureCpu(); void FillRandomTask(XTaskWrapper *taskWrapper); + void ValidateWorkerName(); void IOWorkTimerHandler(const boost::system::error_code& ec); void StopIOService(); diff --git a/GpuMiner/Utils/Utils.cpp b/GpuMiner/Utils/Utils.cpp index 472a655..250ef93 100644 --- a/GpuMiner/Utils/Utils.cpp +++ b/GpuMiner/Utils/Utils.cpp @@ -40,4 +40,20 @@ std::string HashToHexString(const uint64_t* hash) { std::string hex = string_format("%016llx%016llx%016llx%016llx", hash[3], hash[2], hash[1], hash[0]); return hex; +} + +bool ReplaceNonPrintableCharacters(char* string, char newSymbol) +{ + bool replaced = false; + int index = 0; + while(string[index] != 0) + { + if(string[index] < 33 || string[index] > 126) + { + string[index] = newSymbol; + replaced = true; + } + ++index; + } + return replaced; } \ No newline at end of file diff --git a/GpuMiner/Utils/Utils.h b/GpuMiner/Utils/Utils.h index 7e4fa46..c775e37 100644 --- a/GpuMiner/Utils/Utils.h +++ b/GpuMiner/Utils/Utils.h @@ -4,3 +4,5 @@ void DumpHex(const uint8_t* byteArray, int lenght, bool oneLine = true); std::string ToHexString(const unsigned char *byteArray, int length); std::string HashToHexString(const uint64_t* hash); + +bool ReplaceNonPrintableCharacters(char* string, char newSymbol); From d0fc889218ad2e88b54729e46003d5b0d390b013 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Thu, 5 Jul 2018 00:46:11 +0300 Subject: [PATCH 34/41] Makefile is updated with last changes in source files --- GpuMiner/Makefile | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/GpuMiner/Makefile b/GpuMiner/Makefile index 040cb03..fc5138e 100644 --- a/GpuMiner/Makefile +++ b/GpuMiner/Makefile @@ -2,12 +2,33 @@ CC = g++ -O CPPFLAGS = -std=c++11 -I. -I/opt/AMDAPPSDK-3.0/include/ LDFLAGS = -L/opt/AMDAPPSDK-3.0/lib/x86_64/sdk -SRCS = Core/CommonData.cpp Core/Farm.cpp Core/Log.cpp Core/Miner.cpp Core/MinerManager.cpp Core/Worker.cpp \ - Hash/sha256.cpp Hash/sha256_mod.cpp MinerEngine/CLMiner.cpp MinerEngine/XCpuMiner.cpp \ - Utils/CpuInfo.cpp Utils/PathUtils.cpp Utils/Random.cpp Utils/Utils.cpp \ - XDagCore/XAddress.cpp XDagCore/XHash.cpp XDagCore/XNetwork.cpp XDagCore/XBlock.cpp \ - XDagCore/XPool.cpp XDagCore/XTaskProcessor.cpp XDagCore/XTaskWrapper.cpp \ - XDagCore/dar/crc_c.cpp XDagCore/dfstools/dfslib_crypt.cpp XDagCore/dfstools/dfslib_string.cpp +SRCS = + Core/CommonData.cpp \ + Core/Farm.cpp \ + Core/Log.cpp \ + Core/Miner.cpp \ + Core/MinerManager.cpp \ + Core/Worker.cpp \ + Hash/sha256.cpp \ + Hash/sha256_mod.cpp \ + MinerEngine/CLMiner.cpp \ + MinerEngine/XCpuMiner.cpp \ + Utils/CpuInfo.cpp \ + Utils/PathUtils.cpp \ + Utils/Random.cpp \ + Utils/Utils.cpp \ + XDagCore/XAddress.cpp \ + XDagCore/XGlobal.cpp \ + XDagCore/XHash.cpp \ + XDagCore/XConnection.cpp \ + XDagCore/XPoolConnection.cpp \ + XDagCore/XBlock.cpp \ + XDagCore/XPool.cpp \ + XDagCore/XTaskProcessor.cpp \ + XDagCore/XTaskWrapper.cpp \ + XDagCore/dar/crc_c.cpp \ + XDagCore/dfstools/dfslib_crypt.cpp \ + XDagCore/dfstools/dfslib_string.cpp \ OBJS = $(SRCS:.cpp=.o) From e43420da416cf698cfbff4cf8273ce5f877d21e0 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Thu, 5 Jul 2018 01:08:46 +0300 Subject: [PATCH 35/41] Warnings and compilation error are fixed --- GpuMiner/Core/Farm.cpp | 2 -- GpuMiner/Core/MinerManager.cpp | 2 -- GpuMiner/Makefile | 3 ++- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/GpuMiner/Core/Farm.cpp b/GpuMiner/Core/Farm.cpp index b6b628a..186a94e 100644 --- a/GpuMiner/Core/Farm.cpp +++ b/GpuMiner/Core/Farm.cpp @@ -6,8 +6,6 @@ * 2018 */ -#pragma once - #include "Farm.h" using namespace XDag; diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index 0cda126..5a64a78 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -6,8 +6,6 @@ * 2018 */ -#pragma once - #include #include "MinerManager.h" #include "Farm.h" diff --git a/GpuMiner/Makefile b/GpuMiner/Makefile index fc5138e..4f53cfd 100644 --- a/GpuMiner/Makefile +++ b/GpuMiner/Makefile @@ -2,7 +2,7 @@ CC = g++ -O CPPFLAGS = -std=c++11 -I. -I/opt/AMDAPPSDK-3.0/include/ LDFLAGS = -L/opt/AMDAPPSDK-3.0/lib/x86_64/sdk -SRCS = +SRCS = \ Core/CommonData.cpp \ Core/Farm.cpp \ Core/Log.cpp \ @@ -19,6 +19,7 @@ SRCS = Utils/Utils.cpp \ XDagCore/XAddress.cpp \ XDagCore/XGlobal.cpp \ + XDagCore/XFee.cpp \ XDagCore/XHash.cpp \ XDagCore/XConnection.cpp \ XDagCore/XPoolConnection.cpp \ From af6cfb82a9ec858203275ee03144f773fb9ac67f Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Thu, 5 Jul 2018 22:56:05 +0300 Subject: [PATCH 36/41] Crash with list-devices is fixed. --- GpuMiner/Core/MinerManager.cpp | 79 +++++++++++++++++----------------- GpuMiner/Core/MinerManager.h | 1 + 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index 5a64a78..3cac849 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -22,41 +22,46 @@ using namespace std; using namespace XDag; -MinerManager::MinerManager(OperationMode mode) : - _mode(mode), - _io_work(_io_service), - _io_work_timer(_io_service), - _io_strand(_io_service) -{ - // Post first deadline timer to give io_service - // initial work - _io_work_timer.expires_from_now(boost::posix_time::seconds(60)); - _io_work_timer.async_wait(_io_strand.wrap(boost::bind(&MinerManager::IOWorkTimerHandler, this, boost::asio::placeholders::error))); - - // Start io_service in it's own thread - _io_thread = std::thread { boost::bind(&boost::asio::io_service::run, &_io_service) }; - - // Io service is now live and running - // All components using io_service should post to reference of m_io_service - // and should not start/stop or even join threads (which heavily time consuming) -} - -void MinerManager::IOWorkTimerHandler(const boost::system::error_code& ec) -{ - if(!ec) - { - // This does absolutely nothing aside resubmitting timer - // ensuring io_service's queue has always something to do - _io_work_timer.expires_from_now(boost::posix_time::seconds(120)); - _io_work_timer.async_wait(_io_strand.wrap(boost::bind(&MinerManager::IOWorkTimerHandler, this, boost::asio::placeholders::error))); - } -} - -void MinerManager::StopIOService() -{ - // Here we stop all io_service's related activities - _io_service.stop(); - _io_thread.join(); +MinerManager::MinerManager(OperationMode mode) : + _mode(mode), + _io_work(_io_service), + _io_work_timer(_io_service), + _io_strand(_io_service) +{ + // Post first deadline timer to give io_service + // initial work + _io_work_timer.expires_from_now(boost::posix_time::seconds(60)); + _io_work_timer.async_wait(_io_strand.wrap(boost::bind(&MinerManager::IOWorkTimerHandler, this, boost::asio::placeholders::error))); + + // Start io_service in it's own thread + _io_thread = std::thread { boost::bind(&boost::asio::io_service::run, &_io_service) }; + + // Io service is now live and running + // All components using io_service should post to reference of m_io_service + // and should not start/stop or even join threads (which heavily time consuming) +} + +MinerManager::~MinerManager() +{ + StopIOService(); +} + +void MinerManager::IOWorkTimerHandler(const boost::system::error_code& ec) +{ + if(!ec) + { + // This does absolutely nothing aside resubmitting timer + // ensuring io_service's queue has always something to do + _io_work_timer.expires_from_now(boost::posix_time::seconds(120)); + _io_work_timer.async_wait(_io_strand.wrap(boost::bind(&MinerManager::IOWorkTimerHandler, this, boost::asio::placeholders::error))); + } +} + +void MinerManager::StopIOService() +{ + // Here we stop all io_service's related activities + _io_service.stop(); + _io_thread.join(); } bool MinerManager::InterpretOption(int& i, int argc, char** argv) @@ -365,8 +370,6 @@ void MinerManager::DoBenchmark(MinerType type, unsigned warmupDuration, unsigned innerMean /= (trials - 2); cout << "min/mean/max: " << results.begin()->second.Rate() << "/" << (mean / trials) << "/" << results.rbegin()->second.Rate() << " H/s" << endl; cout << "inner mean: " << innerMean << " H/s" << endl; - - StopIOService(); } void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeriod) @@ -418,7 +421,6 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri if(!farm.Start()) { cerr << "Failed to restart mining"; - StopIOService(); exit(-1); } } @@ -450,7 +452,6 @@ void MinerManager::DoMining(MinerType type, string& remote, unsigned recheckPeri ++iteration; } farm.Stop(); - StopIOService(); } void MinerManager::ConfigureGpu() diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index ac1bf2e..2680c74 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -45,6 +45,7 @@ class MinerManager }; MinerManager(OperationMode mode = OperationMode::None); + ~MinerManager(); bool InterpretOption(int& i, int argc, char** argv); bool CheckMandatoryParams(); From 88da7af29a56216bc0b8d8fe7e0868725f474340 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Sat, 7 Jul 2018 00:01:58 +0300 Subject: [PATCH 37/41] License information --- GpuMiner/Core/Common.h | 15 ++--- GpuMiner/Core/CommonData.cpp | 25 ++++++-- GpuMiner/Core/CommonData.h | 27 +++++++-- GpuMiner/Core/Exceptions.h | 25 ++++++-- GpuMiner/Core/Farm.cpp | 21 +++++-- GpuMiner/Core/Farm.h | 25 ++++++-- GpuMiner/Core/Guards.h | 25 ++++++-- GpuMiner/Core/Log.cpp | 21 +++++-- GpuMiner/Core/Log.h | 33 ++++++++--- GpuMiner/Core/Miner.cpp | 13 ++--- GpuMiner/Core/Miner.h | 29 +++++++--- GpuMiner/Core/MinerManager.cpp | 21 +++++-- GpuMiner/Core/MinerManager.h | 21 +++++-- GpuMiner/Core/Terminal.h | 13 ++--- GpuMiner/Core/Worker.cpp | 25 ++++++-- GpuMiner/Core/Worker.h | 25 ++++++-- GpuMiner/Hash/sha256_mod.cpp | 6 ++ GpuMiner/Hash/sha256_mod.h | 6 ++ GpuMiner/MinerEngine/CLMiner.cpp | 28 ++++----- GpuMiner/MinerEngine/CLMiner.h | 4 +- GpuMiner/MinerEngine/XCpuMiner.cpp | 6 ++ GpuMiner/MinerEngine/XCpuMiner.h | 6 ++ GpuMiner/Utils/CpuInfo.cpp | 5 ++ GpuMiner/Utils/CpuInfo.h | 5 ++ GpuMiner/Utils/PathUtils.cpp | 5 ++ GpuMiner/Utils/PathUtils.h | 5 ++ GpuMiner/Utils/Random.cpp | 5 ++ GpuMiner/Utils/Random.h | 5 ++ GpuMiner/Utils/StringFormat.h | 5 ++ GpuMiner/Utils/Utils.cpp | 85 +++++++++++++++------------- GpuMiner/Utils/Utils.h | 5 ++ GpuMiner/XDagCore/XAddress.cpp | 6 ++ GpuMiner/XDagCore/XAddress.h | 6 ++ GpuMiner/XDagCore/XBlock.cpp | 5 ++ GpuMiner/XDagCore/XBlock.h | 6 ++ GpuMiner/XDagCore/XConnection.cpp | 10 +++- GpuMiner/XDagCore/XConnection.h | 8 ++- GpuMiner/XDagCore/XFee.cpp | 10 +++- GpuMiner/XDagCore/XFee.h | 6 ++ GpuMiner/XDagCore/XGlobal.cpp | 6 ++ GpuMiner/XDagCore/XGlobal.h | 7 +++ GpuMiner/XDagCore/XHash.cpp | 6 ++ GpuMiner/XDagCore/XHash.h | 6 +- GpuMiner/XDagCore/XHash.hpp | 6 ++ GpuMiner/XDagCore/XPool.cpp | 6 ++ GpuMiner/XDagCore/XPool.h | 6 ++ GpuMiner/XDagCore/XPoolConnection.h | 6 ++ GpuMiner/XDagCore/XTaskProcessor.cpp | 6 ++ GpuMiner/XDagCore/XTaskProcessor.h | 6 ++ GpuMiner/XDagCore/XTaskWrapper.cpp | 6 ++ GpuMiner/XDagCore/XTaskWrapper.h | 6 ++ GpuMiner/XDagCore/XTime.h | 6 ++ GpuMiner/main.cpp | 5 ++ 53 files changed, 533 insertions(+), 153 deletions(-) diff --git a/GpuMiner/Core/Common.h b/GpuMiner/Core/Common.h index 60ea583..97a74b3 100644 --- a/GpuMiner/Core/Common.h +++ b/GpuMiner/Core/Common.h @@ -1,10 +1,11 @@ -/* - This file is taken from ethminer project. -*/ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +// ethminer -- Ethereum miner with OpenCL, CUDA and stratum support. +// Copyright 2018 ethminer Authors. +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + +/// @file +/// Very common stuff (i.e. that every other header needs except vector_ref.h). + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/CommonData.cpp b/GpuMiner/Core/CommonData.cpp index 5667d9e..71e0298 100644 --- a/GpuMiner/Core/CommonData.cpp +++ b/GpuMiner/Core/CommonData.cpp @@ -1,10 +1,25 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/** @file CommonData.cpp +* @author Gav Wood +* @date 2014 +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #include "CommonData.h" #include diff --git a/GpuMiner/Core/CommonData.h b/GpuMiner/Core/CommonData.h index 3170bd7..25c2d55 100644 --- a/GpuMiner/Core/CommonData.h +++ b/GpuMiner/Core/CommonData.h @@ -1,12 +1,27 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. - Shared algorithms and data types. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/** @file CommonData.h +* @author Gav Wood +* @date 2014 +* +* Shared algorithms and data types. +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/Exceptions.h b/GpuMiner/Core/Exceptions.h index ef1d304..20a4bea 100644 --- a/GpuMiner/Core/Exceptions.h +++ b/GpuMiner/Core/Exceptions.h @@ -1,10 +1,25 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/** @file Exceptions.h +* @author Gav Wood +* @date 2014 +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/Farm.cpp b/GpuMiner/Core/Farm.cpp index 186a94e..64e6b72 100644 --- a/GpuMiner/Core/Farm.cpp +++ b/GpuMiner/Core/Farm.cpp @@ -1,10 +1,21 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ + +// Modified by Evgeniy Sukhomlinov 2018 #include "Farm.h" diff --git a/GpuMiner/Core/Farm.h b/GpuMiner/Core/Farm.h index 0d2f840..de27e46 100644 --- a/GpuMiner/Core/Farm.h +++ b/GpuMiner/Core/Farm.h @@ -1,10 +1,25 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/** @file Farm.h +* @author Gav Wood +* @date 2015 +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/Guards.h b/GpuMiner/Core/Guards.h index d8866f6..1063c5e 100644 --- a/GpuMiner/Core/Guards.h +++ b/GpuMiner/Core/Guards.h @@ -1,10 +1,25 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/** @file Guards.h +* @author Gav Wood +* @date 2014 +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/Log.cpp b/GpuMiner/Core/Log.cpp index 5295bf9..1052c9d 100644 --- a/GpuMiner/Core/Log.cpp +++ b/GpuMiner/Core/Log.cpp @@ -1,10 +1,21 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ + +// Modified by Evgeniy Sukhomlinov 2018 #include "Log.h" #include diff --git a/GpuMiner/Core/Log.h b/GpuMiner/Core/Log.h index fc3b58b..af9addb 100644 --- a/GpuMiner/Core/Log.h +++ b/GpuMiner/Core/Log.h @@ -1,12 +1,27 @@ -/* - This file is taken from ethminer project. - - The logging subsystem. -*/ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Log.h +* @author Gav Wood +* @date 2014 +* +* The logging subsystem. +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/Miner.cpp b/GpuMiner/Core/Miner.cpp index 8af2fe4..fec742d 100644 --- a/GpuMiner/Core/Miner.cpp +++ b/GpuMiner/Core/Miner.cpp @@ -1,10 +1,9 @@ -/* - This file is taken from ethminer project. -*/ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/* + This file is part of ethminer project. +*/ +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + +// Modified by Evgeniy Sukhomlinov 2018 #include "Miner.h" diff --git a/GpuMiner/Core/Miner.h b/GpuMiner/Core/Miner.h index cec4f7a..446e03c 100644 --- a/GpuMiner/Core/Miner.h +++ b/GpuMiner/Core/Miner.h @@ -1,10 +1,25 @@ -/* - This file is taken from ethminer project. -*/ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Miner.h +* @author Gav Wood +* @date 2015 +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/MinerManager.cpp b/GpuMiner/Core/MinerManager.cpp index 3cac849..a378acc 100644 --- a/GpuMiner/Core/MinerManager.cpp +++ b/GpuMiner/Core/MinerManager.cpp @@ -1,10 +1,21 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ + +// Modified by Evgeniy Sukhomlinov 2018 #include #include "MinerManager.h" diff --git a/GpuMiner/Core/MinerManager.h b/GpuMiner/Core/MinerManager.h index 2680c74..e907cd5 100644 --- a/GpuMiner/Core/MinerManager.h +++ b/GpuMiner/Core/MinerManager.h @@ -1,10 +1,21 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/Terminal.h b/GpuMiner/Core/Terminal.h index f05abb7..6895150 100644 --- a/GpuMiner/Core/Terminal.h +++ b/GpuMiner/Core/Terminal.h @@ -1,10 +1,9 @@ -/* - This file is taken from ethminer project. -*/ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/* + This file is part of ethminer project. +*/ +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Core/Worker.cpp b/GpuMiner/Core/Worker.cpp index eb8aa64..4959381 100644 --- a/GpuMiner/Core/Worker.cpp +++ b/GpuMiner/Core/Worker.cpp @@ -1,10 +1,25 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/** @file Worker.cpp +* @author Gav Wood +* @date 2014 +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #include "Worker.h" diff --git a/GpuMiner/Core/Worker.h b/GpuMiner/Core/Worker.h index 3ec21be..f7242cf 100644 --- a/GpuMiner/Core/Worker.h +++ b/GpuMiner/Core/Worker.h @@ -1,10 +1,25 @@ /* - This file is taken from ethminer project. + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ -/* - * Evgeniy Sukhomlinov - * 2018 - */ +/** @file Worker.h +* @author Gav Wood +* @date 2014 +*/ + +// Modified by Evgeniy Sukhomlinov 2018 #pragma once diff --git a/GpuMiner/Hash/sha256_mod.cpp b/GpuMiner/Hash/sha256_mod.cpp index 3bed792..64df2af 100644 --- a/GpuMiner/Hash/sha256_mod.cpp +++ b/GpuMiner/Hash/sha256_mod.cpp @@ -1,3 +1,9 @@ +// Implementation of SHA256 optimized for XDAG +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include #include #include "sha256_mod.h" diff --git a/GpuMiner/Hash/sha256_mod.h b/GpuMiner/Hash/sha256_mod.h index eef00eb..f52e936 100644 --- a/GpuMiner/Hash/sha256_mod.h +++ b/GpuMiner/Hash/sha256_mod.h @@ -1,3 +1,9 @@ +// Implementation of SHA256 optimized for XDAG +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index fe5ec71..a8bd56e 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -3,6 +3,8 @@ /// @file /// @copyright GNU General Public License +// Modified by Evgeniy Sukhomlinov 2018 + #include "CLMiner.h" #include "Utils/PathUtils.h" #include @@ -250,18 +252,18 @@ std::vector GetDevices(std::vector const& platforms, u cl_device_type type = useAllOpenCLCompatibleDevices ? CL_DEVICE_TYPE_ALL : CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR; - platforms[platform_num].getDevices(type, &devices); - -#if defined (__APPLE) || defined (__MACOS) - auto iter = devices.begin(); - for (; iter != devices.end(); iter++) { - size_t maxParam = 0; - iter->getInfo(CL_DEVICE_MAX_PARAMETER_SIZE, &maxParam); - if (maxParam <= 1024) { //Tricky fix, that Intel integrate graphic card is not supported on Mac OS due to parameter size. - iter = devices.erase(iter); - iter --; - } - } + platforms[platform_num].getDevices(type, &devices); + +#if defined (__APPLE) || defined (__MACOS) + auto iter = devices.begin(); + for (; iter != devices.end(); iter++) { + size_t maxParam = 0; + iter->getInfo(CL_DEVICE_MAX_PARAMETER_SIZE, &maxParam); + if (maxParam <= 1024) { //Tricky fix, that Intel integrate graphic card is not supported on Mac OS due to parameter size. + iter = devices.erase(iter); + iter --; + } + } #endif } catch(cl::Error const& err) @@ -556,7 +558,7 @@ bool CLMiner::Reset() return Initialize(); } - catch(cl::Error const& _e) + catch(...) { } return false; diff --git a/GpuMiner/MinerEngine/CLMiner.h b/GpuMiner/MinerEngine/CLMiner.h index 2666b1f..fa0a1b9 100644 --- a/GpuMiner/MinerEngine/CLMiner.h +++ b/GpuMiner/MinerEngine/CLMiner.h @@ -3,6 +3,8 @@ /// @file /// @copyright GNU General Public License +// Modified by Evgeniy Sukhomlinov 2018 + #pragma once #include "Core/Worker.h" @@ -28,7 +30,7 @@ #define OPENCL_PLATFORM_UNKNOWN 0 #define OPENCL_PLATFORM_NVIDIA 1 #define OPENCL_PLATFORM_AMD 2 -#define OPENCL_PLATFORM_CLOVER 3 +#define OPENCL_PLATFORM_CLOVER 3 #define OPENCL_PLATFORM_APPLE 4 #define MAX_CL_DEVICES 16 diff --git a/GpuMiner/MinerEngine/XCpuMiner.cpp b/GpuMiner/MinerEngine/XCpuMiner.cpp index 65a0e86..19d5575 100644 --- a/GpuMiner/MinerEngine/XCpuMiner.cpp +++ b/GpuMiner/MinerEngine/XCpuMiner.cpp @@ -1,3 +1,9 @@ +// Implementation of CPU-mining +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XCpuMiner.h" #include #include "Core/Log.h" diff --git a/GpuMiner/MinerEngine/XCpuMiner.h b/GpuMiner/MinerEngine/XCpuMiner.h index 40e29c0..566730d 100644 --- a/GpuMiner/MinerEngine/XCpuMiner.h +++ b/GpuMiner/MinerEngine/XCpuMiner.h @@ -1,3 +1,9 @@ +// Implementation of CPU-mining +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include "Core/Miner.h" diff --git a/GpuMiner/Utils/CpuInfo.cpp b/GpuMiner/Utils/CpuInfo.cpp index e600761..6568910 100644 --- a/GpuMiner/Utils/CpuInfo.cpp +++ b/GpuMiner/Utils/CpuInfo.cpp @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "CpuInfo.h" #include diff --git a/GpuMiner/Utils/CpuInfo.h b/GpuMiner/Utils/CpuInfo.h index 6be260a..d44e4a6 100644 --- a/GpuMiner/Utils/CpuInfo.h +++ b/GpuMiner/Utils/CpuInfo.h @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once class CpuInfo diff --git a/GpuMiner/Utils/PathUtils.cpp b/GpuMiner/Utils/PathUtils.cpp index 0d63938..06a8321 100644 --- a/GpuMiner/Utils/PathUtils.cpp +++ b/GpuMiner/Utils/PathUtils.cpp @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "PathUtils.h" #ifdef __linux__ #include diff --git a/GpuMiner/Utils/PathUtils.h b/GpuMiner/Utils/PathUtils.h index f806dab..383bb76 100644 --- a/GpuMiner/Utils/PathUtils.h +++ b/GpuMiner/Utils/PathUtils.h @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include diff --git a/GpuMiner/Utils/Random.cpp b/GpuMiner/Utils/Random.cpp index 9535b3e..87619a5 100644 --- a/GpuMiner/Utils/Random.cpp +++ b/GpuMiner/Utils/Random.cpp @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "Random.h" #include diff --git a/GpuMiner/Utils/Random.h b/GpuMiner/Utils/Random.h index 066a490..ffab1f6 100644 --- a/GpuMiner/Utils/Random.h +++ b/GpuMiner/Utils/Random.h @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include diff --git a/GpuMiner/Utils/StringFormat.h b/GpuMiner/Utils/StringFormat.h index f082981..fbe1693 100644 --- a/GpuMiner/Utils/StringFormat.h +++ b/GpuMiner/Utils/StringFormat.h @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include #include #include diff --git a/GpuMiner/Utils/Utils.cpp b/GpuMiner/Utils/Utils.cpp index 250ef93..fba0271 100644 --- a/GpuMiner/Utils/Utils.cpp +++ b/GpuMiner/Utils/Utils.cpp @@ -1,30 +1,35 @@ -#include "Utils.h" -#include -#include -#include -#include "StringFormat.h" - -void DumpHex(const uint8_t* byteArray, int length, bool oneLine) -{ - int width = 0; - for(const unsigned char* p = byteArray; length > 0; ++p) - { - if(!oneLine && width >= 16) - { - putchar('\n'); - width = 0; - } - printf("%02x", *p); - if(!oneLine) - { - putchar(' '); - } - --length; - ++width; - } - putchar('\n'); -} - +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + +#include "Utils.h" +#include +#include +#include +#include "StringFormat.h" + +void DumpHex(const uint8_t* byteArray, int length, bool oneLine) +{ + int width = 0; + for(const unsigned char* p = byteArray; length > 0; ++p) + { + if(!oneLine && width >= 16) + { + putchar('\n'); + width = 0; + } + printf("%02x", *p); + if(!oneLine) + { + putchar(' '); + } + --length; + ++width; + } + putchar('\n'); +} + std::string ToHexString(const unsigned char *byteArray, int length) { std::stringstream ss; @@ -34,17 +39,17 @@ std::string ToHexString(const unsigned char *byteArray, int length) ss << (int)byteArray[i]; } return ss.str(); -} - -std::string HashToHexString(const uint64_t* hash) -{ - std::string hex = string_format("%016llx%016llx%016llx%016llx", hash[3], hash[2], hash[1], hash[0]); - return hex; -} - -bool ReplaceNonPrintableCharacters(char* string, char newSymbol) -{ - bool replaced = false; +} + +std::string HashToHexString(const uint64_t* hash) +{ + std::string hex = string_format("%016llx%016llx%016llx%016llx", hash[3], hash[2], hash[1], hash[0]); + return hex; +} + +bool ReplaceNonPrintableCharacters(char* string, char newSymbol) +{ + bool replaced = false; int index = 0; while(string[index] != 0) { @@ -54,6 +59,6 @@ bool ReplaceNonPrintableCharacters(char* string, char newSymbol) replaced = true; } ++index; - } - return replaced; + } + return replaced; } \ No newline at end of file diff --git a/GpuMiner/Utils/Utils.h b/GpuMiner/Utils/Utils.h index c775e37..7ee2c97 100644 --- a/GpuMiner/Utils/Utils.h +++ b/GpuMiner/Utils/Utils.h @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include diff --git a/GpuMiner/XDagCore/XAddress.cpp b/GpuMiner/XDagCore/XAddress.cpp index 5226a64..361b3ac 100644 --- a/GpuMiner/XDagCore/XAddress.cpp +++ b/GpuMiner/XDagCore/XAddress.cpp @@ -1,3 +1,9 @@ +// Implementation of conversion between hash and XDAG address +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XAddress.h" #include diff --git a/GpuMiner/XDagCore/XAddress.h b/GpuMiner/XDagCore/XAddress.h index d6c6954..fb69fb7 100644 --- a/GpuMiner/XDagCore/XAddress.h +++ b/GpuMiner/XDagCore/XAddress.h @@ -1,3 +1,9 @@ +// Implementation of conversion between hash and XDAG address +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include "XHash.h" diff --git a/GpuMiner/XDagCore/XBlock.cpp b/GpuMiner/XDagCore/XBlock.cpp index 1ca0d50..0bc80e3 100644 --- a/GpuMiner/XDagCore/XBlock.cpp +++ b/GpuMiner/XDagCore/XBlock.cpp @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XBlock.h" #include "XTime.h" diff --git a/GpuMiner/XDagCore/XBlock.h b/GpuMiner/XDagCore/XBlock.h index 15f969e..710889d 100644 --- a/GpuMiner/XDagCore/XBlock.h +++ b/GpuMiner/XDagCore/XBlock.h @@ -1,3 +1,9 @@ +// Common types of block parts +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include "XHash.h" diff --git a/GpuMiner/XDagCore/XConnection.cpp b/GpuMiner/XDagCore/XConnection.cpp index b4fdfc4..aebef5b 100644 --- a/GpuMiner/XDagCore/XConnection.cpp +++ b/GpuMiner/XDagCore/XConnection.cpp @@ -1,3 +1,9 @@ +// Base network logic +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XConnection.h" #include #include @@ -50,7 +56,7 @@ bool XConnection::Initialize() return true; } -bool XConnection::ValidatePoolAddress(const char *address, sockaddr_in &peerAddr) +bool XConnection::ValidateAddress(const char *address, sockaddr_in &peerAddr) { char *lasts; char buf[0x100] = {0}; @@ -101,7 +107,7 @@ bool XConnection::Connect(const char *address) linger lingerOpt = { 1, 0 }; // Linger active, timeout 0 sockaddr_in peerAddr; - if(!ValidatePoolAddress(address, peerAddr)) + if(!ValidateAddress(address, peerAddr)) { return false; } diff --git a/GpuMiner/XDagCore/XConnection.h b/GpuMiner/XDagCore/XConnection.h index ad3509a..5bec32e 100644 --- a/GpuMiner/XDagCore/XConnection.h +++ b/GpuMiner/XDagCore/XConnection.h @@ -1,3 +1,9 @@ +// Base network logic +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #ifdef __linux__ @@ -25,7 +31,7 @@ class XConnection private: SOCKET _socket; - static bool ValidatePoolAddress(const char *address, sockaddr_in &_peerAddr); + static bool ValidateAddress(const char *address, sockaddr_in &_peerAddr); public: XConnection(); virtual ~XConnection(); diff --git a/GpuMiner/XDagCore/XFee.cpp b/GpuMiner/XDagCore/XFee.cpp index 5d0fc1b..b45d105 100644 --- a/GpuMiner/XDagCore/XFee.cpp +++ b/GpuMiner/XDagCore/XFee.cpp @@ -1,3 +1,9 @@ +// Implementation of fee +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XFee.h" #include "Core/Log.h" @@ -6,8 +12,8 @@ const std::string GpuDevAddress = "YMB0XWN1vxY5jLiZwSDeTDQTRO2NVEW9"; #else #define FEE_PERIOD 100 -const std::string GpuDevAddress = "kllHUGcgV3lWjAcgM1o9JZreqeSshnfk"; -const std::string CommunityAddress = "FQglVQtb60vQv2DOWEUL7yh3smtj7g1s"; +const std::string GpuDevAddress = "kllHUGcgV3lWjAcgM1o9JZreqeSshnfk"; //developer's address +const std::string CommunityAddress = "FQglVQtb60vQv2DOWEUL7yh3smtj7g1s"; //community fund #endif XFee::XFee(std::string& poolAddress) diff --git a/GpuMiner/XDagCore/XFee.h b/GpuMiner/XDagCore/XFee.h index 3931917..1ec49b8 100644 --- a/GpuMiner/XDagCore/XFee.h +++ b/GpuMiner/XDagCore/XFee.h @@ -1,3 +1,9 @@ +// Implementation of fee +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include diff --git a/GpuMiner/XDagCore/XGlobal.cpp b/GpuMiner/XDagCore/XGlobal.cpp index 9d93f85..0c0f857 100644 --- a/GpuMiner/XDagCore/XGlobal.cpp +++ b/GpuMiner/XDagCore/XGlobal.cpp @@ -1,3 +1,9 @@ +// Some global initializations +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XGlobal.h" #include "XAddress.h" #include "dar/crc.h" diff --git a/GpuMiner/XDagCore/XGlobal.h b/GpuMiner/XDagCore/XGlobal.h index e8cdebe..155d51d 100644 --- a/GpuMiner/XDagCore/XGlobal.h +++ b/GpuMiner/XDagCore/XGlobal.h @@ -1,4 +1,11 @@ +// Some global initializations +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once + class XGlobal { public: diff --git a/GpuMiner/XDagCore/XHash.cpp b/GpuMiner/XDagCore/XHash.cpp index fbb497e..535c4f9 100644 --- a/GpuMiner/XDagCore/XHash.cpp +++ b/GpuMiner/XDagCore/XHash.cpp @@ -1,3 +1,9 @@ +// Hashing operations +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include #include "XHash.h" #include "Utils/StringFormat.h" diff --git a/GpuMiner/XDagCore/XHash.h b/GpuMiner/XDagCore/XHash.h index 126e195..51bf0ab 100644 --- a/GpuMiner/XDagCore/XHash.h +++ b/GpuMiner/XDagCore/XHash.h @@ -1,4 +1,8 @@ -/* хеш-функция, T13.654-T13.775 $DVS:time$ */ +// Hashing operations +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. #ifndef XDAG_HASH_H #define XDAG_HASH_H diff --git a/GpuMiner/XDagCore/XHash.hpp b/GpuMiner/XDagCore/XHash.hpp index e5e446f..d0b85a1 100644 --- a/GpuMiner/XDagCore/XHash.hpp +++ b/GpuMiner/XDagCore/XHash.hpp @@ -1,3 +1,9 @@ +// Hashing operations +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include int XHash::CompareHashes(xdag_hash_t l, xdag_hash_t r) diff --git a/GpuMiner/XDagCore/XPool.cpp b/GpuMiner/XDagCore/XPool.cpp index 73ee16a..1a7dde0 100644 --- a/GpuMiner/XDagCore/XPool.cpp +++ b/GpuMiner/XDagCore/XPool.cpp @@ -1,3 +1,9 @@ +// Communication between pool and miner +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XPool.h" #include #include "XTime.h" diff --git a/GpuMiner/XDagCore/XPool.h b/GpuMiner/XDagCore/XPool.h index 68b5116..8e3b3b5 100644 --- a/GpuMiner/XDagCore/XPool.h +++ b/GpuMiner/XDagCore/XPool.h @@ -1,3 +1,9 @@ +// This class manages pool operations +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include "XPoolConnection.h" diff --git a/GpuMiner/XDagCore/XPoolConnection.h b/GpuMiner/XDagCore/XPoolConnection.h index 53a587f..7ebeb34 100644 --- a/GpuMiner/XDagCore/XPoolConnection.h +++ b/GpuMiner/XDagCore/XPoolConnection.h @@ -1,3 +1,9 @@ +// Communication between pool and miner +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include "XConnection.h" diff --git a/GpuMiner/XDagCore/XTaskProcessor.cpp b/GpuMiner/XDagCore/XTaskProcessor.cpp index 5bdead3..ca9c1eb 100644 --- a/GpuMiner/XDagCore/XTaskProcessor.cpp +++ b/GpuMiner/XDagCore/XTaskProcessor.cpp @@ -1,3 +1,9 @@ +// Operates with current task data +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XTaskProcessor.h" #include "Core/Log.h" diff --git a/GpuMiner/XDagCore/XTaskProcessor.h b/GpuMiner/XDagCore/XTaskProcessor.h index 1357a55..e04b671 100644 --- a/GpuMiner/XDagCore/XTaskProcessor.h +++ b/GpuMiner/XDagCore/XTaskProcessor.h @@ -1,3 +1,9 @@ +// Operates with current task data +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include "XTaskWrapper.h" diff --git a/GpuMiner/XDagCore/XTaskWrapper.cpp b/GpuMiner/XDagCore/XTaskWrapper.cpp index 2514b84..c9d2d6f 100644 --- a/GpuMiner/XDagCore/XTaskWrapper.cpp +++ b/GpuMiner/XDagCore/XTaskWrapper.cpp @@ -1,3 +1,9 @@ +// Task data +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #include "XTaskWrapper.h" #include "Core/Log.h" #include "Utils/Utils.h" diff --git a/GpuMiner/XDagCore/XTaskWrapper.h b/GpuMiner/XDagCore/XTaskWrapper.h index 67aa7a9..ba61178 100644 --- a/GpuMiner/XDagCore/XTaskWrapper.h +++ b/GpuMiner/XDagCore/XTaskWrapper.h @@ -1,3 +1,9 @@ +// Task data +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #include "XTime.h" diff --git a/GpuMiner/XDagCore/XTime.h b/GpuMiner/XDagCore/XTime.h index 0f36df1..453bb29 100644 --- a/GpuMiner/XDagCore/XTime.h +++ b/GpuMiner/XDagCore/XTime.h @@ -1,3 +1,9 @@ +// Implementation of operation with time +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #pragma once #ifdef _WIN32 #include "win\sys\time.h" diff --git a/GpuMiner/main.cpp b/GpuMiner/main.cpp index ecdd1ed..1479516 100644 --- a/GpuMiner/main.cpp +++ b/GpuMiner/main.cpp @@ -1,3 +1,8 @@ +// Author: Evgeniy Sukhomlinov +// 2018 + +// Licensed under GNU General Public License, Version 3. See the LICENSE file. + #ifdef _WIN32 #include #endif From c95e283dc959d25b7d26b2d4256d9df624cd5ef5 Mon Sep 17 00:00:00 2001 From: Rui Xie Date: Sun, 8 Jul 2018 04:13:50 +0800 Subject: [PATCH 38/41] fix Mac compilation --- GpuMiner/main.cpp | 10 ++++++++-- mac/GpuMiner.xcodeproj/project.pbxproj | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/GpuMiner/main.cpp b/GpuMiner/main.cpp index 1479516..251813a 100644 --- a/GpuMiner/main.cpp +++ b/GpuMiner/main.cpp @@ -68,8 +68,14 @@ int main(int argc, char** argv) miner.Execute(); #ifdef _DEBUG - //pause and wait - _getch(); + //pause and wait +#if defined (__linux__) || defined (__APPLE__)|| defined (__MACOS) + char c; + fgets(&c, 1, stdin); +#else + _getch(); +#endif +# #endif return 0; } diff --git a/mac/GpuMiner.xcodeproj/project.pbxproj b/mac/GpuMiner.xcodeproj/project.pbxproj index 1c93047..d53b425 100644 --- a/mac/GpuMiner.xcodeproj/project.pbxproj +++ b/mac/GpuMiner.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 383BF92E20F1523000316853 /* XFee.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 383BF92C20F1523000316853 /* XFee.cpp */; }; 386385782042EE6100D2A207 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3863852C2042EE6000D2A207 /* main.cpp */; }; 386385792042EE6100D2A207 /* CLMiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385322042EE6100D2A207 /* CLMiner.cpp */; }; 3863857A2042EE6100D2A207 /* XCpuMiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386385342042EE6100D2A207 /* XCpuMiner.cpp */; }; @@ -55,6 +56,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 383BF92C20F1523000316853 /* XFee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XFee.cpp; sourceTree = ""; }; + 383BF92D20F1523000316853 /* XFee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XFee.h; sourceTree = ""; }; 38638422204275AA00D2A207 /* GpuMiner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = GpuMiner; sourceTree = BUILT_PRODUCTS_DIR; }; 386385262042EE5F00D2A207 /* CLMiner_kernel.cl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.opencl; lineEnding = 2; path = CLMiner_kernel.cl; sourceTree = ""; }; 386385292042EE6000D2A207 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resource.h; path = ../GpuMiner/resource.h; sourceTree = ""; }; @@ -196,6 +199,8 @@ 386385362042EE6100D2A207 /* XDagCore */ = { isa = PBXGroup; children = ( + 383BF92C20F1523000316853 /* XFee.cpp */, + 383BF92D20F1523000316853 /* XFee.h */, 386FE36020581654001B661C /* XConnection.cpp */, 386FE36120581655001B661C /* XConnection.h */, 386FE36220581655001B661C /* XGlobal.cpp */, @@ -400,6 +405,7 @@ 386385862042EE6200D2A207 /* sha256.cpp in Sources */, 386FE36720581655001B661C /* XPoolConnection.cpp in Sources */, 386FE36620581655001B661C /* XGlobal.cpp in Sources */, + 383BF92E20F1523000316853 /* XFee.cpp in Sources */, 386FE36520581655001B661C /* XConnection.cpp in Sources */, 386385882042EE6200D2A207 /* CpuInfo.cpp in Sources */, ); @@ -516,12 +522,14 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( __MACOS, "DEBUG=0", + _DEBUG, ); GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( @@ -541,6 +549,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CODE_SIGN_STYLE = Automatic; From 2df00efa35dfd47dc44790715faad1de9e4ee06d Mon Sep 17 00:00:00 2001 From: Frozen Date: Sun, 8 Jul 2018 04:18:13 +0800 Subject: [PATCH 39/41] change __MACOS to __MACOS__ --- GpuMiner/Core/Log.cpp | 2 +- GpuMiner/Core/Terminal.h | 2 +- GpuMiner/MinerEngine/CL/cl2.hpp | 10 +++++----- GpuMiner/MinerEngine/CLMiner.cpp | 4 ++-- GpuMiner/Utils/PathUtils.cpp | 6 +++--- GpuMiner/XDagCore/XConnection.cpp | 2 +- GpuMiner/XDagCore/XConnection.h | 2 +- GpuMiner/main.cpp | 2 +- mac/GpuMiner.xcodeproj/project.pbxproj | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/GpuMiner/Core/Log.cpp b/GpuMiner/Core/Log.cpp index 1052c9d..db6443d 100644 --- a/GpuMiner/Core/Log.cpp +++ b/GpuMiner/Core/Log.cpp @@ -25,7 +25,7 @@ #include using std::type_info; #endif -#if defined (__APPLE__) || defined (__MACOS) +#if defined (__APPLE__) || defined (__MACOS__) #include using std::type_info; #endif diff --git a/GpuMiner/Core/Terminal.h b/GpuMiner/Core/Terminal.h index 6895150..5fee0ac 100644 --- a/GpuMiner/Core/Terminal.h +++ b/GpuMiner/Core/Terminal.h @@ -7,7 +7,7 @@ #pragma once -#if defined (_WIN32) || defined (__MACOS) +#if defined (_WIN32) || defined (__MACOS__) #define EthReset "" // Text Reset diff --git a/GpuMiner/MinerEngine/CL/cl2.hpp b/GpuMiner/MinerEngine/CL/cl2.hpp index 97292d3..4f27338 100644 --- a/GpuMiner/MinerEngine/CL/cl2.hpp +++ b/GpuMiner/MinerEngine/CL/cl2.hpp @@ -498,7 +498,7 @@ #include #endif -#if defined(__APPLE__) || defined(__MACOSX) +#if defined(__APPLE__) || defined(__MACOS__X) #include #else #include @@ -2588,15 +2588,15 @@ class Context try #endif { -#if !defined(__APPLE__) && !defined(__MACOS) +#if !defined(__APPLE__) && !defined(__MACOS__) const Platform &p = Platform::getDefault(); cl_platform_id defaultPlatform = p(); cl_context_properties properties[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties)defaultPlatform, 0 }; -#else // #if !defined(__APPLE__) && !defined(__MACOS) +#else // #if !defined(__APPLE__) && !defined(__MACOS__) cl_context_properties *properties = nullptr; -#endif // #if !defined(__APPLE__) && !defined(__MACOS) +#endif // #if !defined(__APPLE__) && !defined(__MACOS__) default_ = Context( CL_DEVICE_TYPE_DEFAULT, @@ -2713,7 +2713,7 @@ class Context { cl_int error; -#if !defined(__APPLE__) && !defined(__MACOS) +#if !defined(__APPLE__) && !defined(__MACOS__) cl_context_properties prop[4] = {CL_CONTEXT_PLATFORM, 0, 0, 0 }; if (properties == NULL) { diff --git a/GpuMiner/MinerEngine/CLMiner.cpp b/GpuMiner/MinerEngine/CLMiner.cpp index a8bd56e..34f052a 100644 --- a/GpuMiner/MinerEngine/CLMiner.cpp +++ b/GpuMiner/MinerEngine/CLMiner.cpp @@ -254,7 +254,7 @@ std::vector GetDevices(std::vector const& platforms, u : CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR; platforms[platform_num].getDevices(type, &devices); -#if defined (__APPLE) || defined (__MACOS) +#if defined (__APPLE) || defined (__MACOS__) auto iter = devices.begin(); for (; iter != devices.end(); iter++) { size_t maxParam = 0; @@ -493,7 +493,7 @@ bool CLMiner::Initialize() _searchKernel = cl::Kernel(program, "search_nonce"); -#if defined (__APPLE__) || defined (__MACOS) +#if defined (__APPLE__) || defined (__MACOS__) size_t local; int err = clGetKernelWorkGroupInfo(_searchKernel.get(), device.get(), CL_KERNEL_WORK_GROUP_SIZE, sizeof(local), &local, NULL); diff --git a/GpuMiner/Utils/PathUtils.cpp b/GpuMiner/Utils/PathUtils.cpp index 06a8321..ac7c664 100644 --- a/GpuMiner/Utils/PathUtils.cpp +++ b/GpuMiner/Utils/PathUtils.cpp @@ -8,7 +8,7 @@ #include #include #include -#elif defined (__APPLE__)|| defined (__MACOS) +#elif defined (__APPLE__)|| defined (__MACOS__) #include #elif _WIN32 #include @@ -23,7 +23,7 @@ std::string PathUtils::GetModuleFolder() } else { return ""; } -#elif defined (__APPLE__)|| defined (__MACOS) +#elif defined (__APPLE__)|| defined (__MACOS__) //fixme: temporal return ./CL/ return "./CL/"; #elif _WIN32 @@ -41,7 +41,7 @@ std::string PathUtils::GetModuleFolder() bool PathUtils::FileExists(const std::string& fname) { -#if defined (__linux__) || defined (__APPLE__)|| defined (__MACOS) +#if defined (__linux__) || defined (__APPLE__)|| defined (__MACOS__) return access(fname.c_str(), F_OK) != -1; #elif _WIN32 return PathFileExists(fname.c_str()) == TRUE; diff --git a/GpuMiner/XDagCore/XConnection.cpp b/GpuMiner/XDagCore/XConnection.cpp index aebef5b..e4d12e2 100644 --- a/GpuMiner/XDagCore/XConnection.cpp +++ b/GpuMiner/XDagCore/XConnection.cpp @@ -14,7 +14,7 @@ #include #include #include -#elif defined (__APPLE__)|| defined (__MACOS) +#elif defined (__APPLE__)|| defined (__MACOS__) #include #include #include diff --git a/GpuMiner/XDagCore/XConnection.h b/GpuMiner/XDagCore/XConnection.h index 5bec32e..68c8d22 100644 --- a/GpuMiner/XDagCore/XConnection.h +++ b/GpuMiner/XDagCore/XConnection.h @@ -10,7 +10,7 @@ #include "netinet/in.h" #include "sys/socket.h" typedef int SOCKET; -#elif defined (__APPLE__)|| defined (__MACOS) +#elif defined (__APPLE__)|| defined (__MACOS__) #include "netinet/in.h" #include "sys/socket.h" typedef int SOCKET; diff --git a/GpuMiner/main.cpp b/GpuMiner/main.cpp index 251813a..004e1a2 100644 --- a/GpuMiner/main.cpp +++ b/GpuMiner/main.cpp @@ -69,7 +69,7 @@ int main(int argc, char** argv) #ifdef _DEBUG //pause and wait -#if defined (__linux__) || defined (__APPLE__)|| defined (__MACOS) +#if defined (__linux__) || defined (__APPLE__)|| defined (__MACOS__) char c; fgets(&c, 1, stdin); #else diff --git a/mac/GpuMiner.xcodeproj/project.pbxproj b/mac/GpuMiner.xcodeproj/project.pbxproj index d53b425..68e958b 100644 --- a/mac/GpuMiner.xcodeproj/project.pbxproj +++ b/mac/GpuMiner.xcodeproj/project.pbxproj @@ -527,7 +527,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CODE_SIGN_STYLE = Automatic; GCC_PREPROCESSOR_DEFINITIONS = ( - __MACOS, + __MACOS__, "DEBUG=0", _DEBUG, ); @@ -553,7 +553,7 @@ CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CODE_SIGN_STYLE = Automatic; - GCC_PREPROCESSOR_DEFINITIONS = __MACOS; + GCC_PREPROCESSOR_DEFINITIONS = __MACOS__; GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../GpuMiner\"", From 06864caf8f88e38e69b81565b163cdaf9a6254a7 Mon Sep 17 00:00:00 2001 From: Frozen Date: Sun, 8 Jul 2018 04:45:48 +0800 Subject: [PATCH 40/41] update README.md --- README.md | 93 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5cbeeba..c74e5bc 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,85 @@ # DaggerGpuMiner -Stand-alone GPU/CPU miner for Dagger coin +Stand-alone GPU/CPU miner for XDAG (Dagger coin) This miner does not require files wallet.dat and dnet_key.dat. Storage folder is still necessary. -Launch parameters: -1) GPU benchmark: DaggerGpuMiner.exe -G -M -2) GPU mining: DaggerGpuMiner.exe -G -a -p -3) CPU mining: DaggerGpuMiner.exe -cpu -a -p -t 8 +**Launch parameters:** -Different features and optional parameters: -1) "-h" - show help -2) you can list all available devices using parameters "-list-devices -G". You can check what platform ids and device numbers they have. -3) by default GPU-miner uses all OpenCL devices on the selected platform. You can specify particular devices using parameter "-opencl-devices 0 1 3". Use your device numbers instead of "0 1 3". Also use can use parameter "-d " there is count of used devices. -4) if GPU-miner sees only one device, but you have several devices, try to specify platform. For example: "-opencl-platform 1". + 1) GPU benchmark: DaggerGpuMiner.exe -G -M + + 2) GPU mining: DaggerGpuMiner.exe -G -a -p + + 3) CPU mining: DaggerGpuMiner.exe -cpu -a -p -t 8 + +**Different features and optional parameters:** -The project supports Windows OS, Linux OS and Mac OS now. Mac OS binary file will be provided in the near future. + 1) "-h" - show help + + 2) you can list all available devices using parameters "-list-devices -G". + You can check what platform ids and device numbers they have. + + 3) by default GPU-miner uses all OpenCL devices on the selected platform. + You can specify particular devices using parameter "-opencl-devices 0 1 3". + Use your device numbers instead of "0 1 3". + Also use can use parameter "-d " there is count of used devices. + + 4) if GPU-miner sees only one device, but you have several devices, try to specify platform. + For example: "-opencl-platform 1". + + +**The project supports Windows, Linux and Mac OS now.** +**Binary file available for Window and Mac OS** +[Download](https://github.com/jonano614/DaggerGpuMiner/releases) -How to compile the project yourself: + +## How to build + +## Windows: The project has 3 dependencies: OpenCL, Boost and OpenSSL -Windows: OpenCL SDK can be downloaded by link https://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/. Also you can try another OpenCL SDK vendors. Path to intalled SDK should be written to a new environment variable OPENCL_SDK. Boost and OpenSSL libraries are included by Nuget Manager and should be downloaded automatically. -Linux: -AMD driver / SDK link https://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/ -Nvidia driver / SDK link https://developer.nvidia.com/cuda-downloads +### Launch parameters: + + 1) GPU benchmark: DaggerGpuMiner.exe -G -M + + 2) GPU mining: DaggerGpuMiner.exe -G -a -p + + 3) CPU mining: DaggerGpuMiner.exe -cpu -a -p -t 8 + + +## Linux: +AMD driver / SDK link https://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/ ***(deprecated)*** +Nvidia driver / SDK link https://developer.nvidia.com/cuda-downloads Check dependencies: libboost-dev, libboost-system-dev, openssl. Download this source code, then cd to source folder. In GpuMiner folder run command $make all, it will generate xdag-gpu. -Launch parameters: -1) GPU benchmark: ./xdag-gpu -G -M -2) GPU mining: ./xdag-gpu -G -a -p -3) CPU mining: ./xdag-gpu -cpu -a -p -t 8 -Mac OS: -Install Boost with brew. -Open XCode project to build Mac OS version. +### Launch parameters: + + 1) GPU benchmark: ./xdag-gpu -G -M + + 2) GPU mining: ./xdag-gpu -G -a -p + + 3) CPU mining: ./xdag-gpu -cpu -a -p -t 8 + + +## Mac: +Install Boost with brew. +Open XCode project to build Mac OS version. + +### Launch parameters: + 1) GPU benchmark: ./xdag-gpu -G -M + + 2) GPU mining: ./xdag-gpu -G -a -p + + 3) CPU mining: ./xdag-gpu -cpu -a -p -t 8 + -Launch parameters: -1) GPU benchmark: ./xdag-gpu -G -M -2) GPU mining: ./xdag-gpu -G -a -p -3) CPU mining: ./xdag-gpu -cpu -a -p -t 8 +**Workaround on issue with high CPU usage with NVIDIA GPUs.** -Workaround on issue with high CPU usage with NVIDIA GPUs. There is an issue with NVIDIA GPUs leading to very high CPU usage. The reason is improper implementation of OpenCL by NVIDIA. When CPU thread waits for results from GPU, it does not stop, it spins in loop eating CPU resources for nothing. There was impemented a workaround on this issue: before reading results from GPU current thread sleeps during small calculated time. CPU usage was decreased in 90%. The change made optional, use launch parameter "-nvidia-fix" to enable it. The change can decrease hashrate a bit in some cases. But GPU rigs should gain increase of hashrate. So try it and choose to use or not to use it. -You can support author: XDAG gKNRtSL1pUaTpzMuPMznKw49ILtP6qX3 +You can support author: XDAG **gKNRtSL1pUaTpzMuPMznKw49ILtP6qX3** From 1c4b9484ce89d1777db594f7fca10c0aa59a345e Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Tue, 10 Jul 2018 01:15:04 +0300 Subject: [PATCH 41/41] Crash caused by disconnection is fixed. --- GpuMiner/Core/Farm.cpp | 10 +++++----- GpuMiner/Core/Miner.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/GpuMiner/Core/Farm.cpp b/GpuMiner/Core/Farm.cpp index 64e6b72..79cfdd3 100644 --- a/GpuMiner/Core/Farm.cpp +++ b/GpuMiner/Core/Farm.cpp @@ -129,7 +129,7 @@ void Farm::CollectHashRate() p.minersHashes.push_back(minerHashCount); } - if(p.hashes > 0 || !_progressJustStarted) + if((p.hashes > 0 || !_progressJustStarted) && IsMining()) { _progressJustStarted = false; _lastProgresses.push_back(p); @@ -192,10 +192,10 @@ WorkingProgress const& Farm::MiningProgress(bool hwmon) const for(auto const& i : _miners) { p.minersHashes.push_back(0); - if(hwmon) - { - p.minerMonitors.push_back(i->Hwmon()); - } + //if(hwmon) + //{ + // p.minerMonitors.push_back(i->Hwmon()); + //} } for(auto const& cp : _lastProgresses) diff --git a/GpuMiner/Core/Miner.h b/GpuMiner/Core/Miner.h index 446e03c..174e449 100644 --- a/GpuMiner/Core/Miner.h +++ b/GpuMiner/Core/Miner.h @@ -88,7 +88,7 @@ namespace XDag uint64_t Rate() const { return ms == 0 ? 0 : hashes * 1000 / ms; } std::vector minersHashes; - std::vector minerMonitors; + //std::vector minerMonitors; uint64_t MinerRate(const uint64_t hashCount) const { return ms == 0 ? 0 : hashCount * 1000 / ms; } }; @@ -103,8 +103,8 @@ namespace XDag { mh = _p.MinerRate(_p.minersHashes[i]) / 1000000.0f; _out << "u/" << i << " " << EthTeal << std::fixed << std::setw(5) << std::setprecision(2) << mh << EthReset; - if(_p.minerMonitors.size() == _p.minersHashes.size()) - _out << " " << EthTeal << _p.minerMonitors[i] << EthReset; + //if(_p.minerMonitors.size() == _p.minersHashes.size()) + // _out << " " << EthTeal << _p.minerMonitors[i] << EthReset; _out << " "; }