Skip to content

Commit

Permalink
Merge pull request #1834 from psychocrypt/topic-avoidOpenCLBinaryMism…
Browse files Browse the repository at this point in the history
…atch

avoid OpenCL binary missmatch
  • Loading branch information
fireice-uk authored Sep 19, 2018
2 parents bde9ea7 + 2742ef0 commit 55cfa2d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xmrstak/backend/amd/amd_gpu/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "xmrstak/jconf.hpp"
#include "xmrstak/picosha2/picosha2.hpp"
#include "xmrstak/params.hpp"
#include "xmrstak/version.hpp"

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -375,6 +376,13 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
return ERR_OCL_API;
}

std::vector<char> openCLDriverVer(1024);
if(ret = clGetDeviceInfo(ctx->DeviceID, CL_DRIVER_VERSION, openCLDriverVer.size(), openCLDriverVer.data(), NULL) != CL_SUCCESS)
{
printer::inst()->print_msg(L1,"WARNING: %s when calling clGetDeviceInfo to get CL_DRIVER_VERSION for device %u.", err_to_str(ret),ctx->deviceIdx );
return ERR_OCL_API;
}

xmrstak_algo miner_algo[2] = {
::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgo(),
::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgoRoot()
Expand Down Expand Up @@ -407,6 +415,9 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
std::string src_str(source_code);
src_str += options;
src_str += devNameVec.data();
src_str += get_version_str();
src_str += openCLDriverVer.data();

std::string hash_hex_str;
picosha2::hash256_hex_string(src_str, hash_hex_str);

Expand Down

0 comments on commit 55cfa2d

Please sign in to comment.