From 4a59ff1a4ed35c15ecf3c233af316c00ca595a21 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 26 Oct 2018 18:44:00 -0400
Subject: [PATCH] P4 to Git Change 1624807 by gandryey@gera-w8 on 2018/10/26
18:35:39
SWDEV-167970 - Ethereum mining (EthDcrMiner64.exe) App crashed while running Claymore Mining over VI,AI ,CI ASIC families
- Fix a regression after CL#1608975. Use amdil complib instance to query the binary options. The logic in the abstraction layer attempts to validate the binary options and for some reason Ethereum binary isn't compatible with the HSAIL complib instance. It's a workaround for now, since the app doesn't allow debugger and printf debugging is quite time consuming.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#322 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#169 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#97 edit
[ROCm/clr commit: e8ca159b624c2953fd2b218cb9c9e92229ab43a0]
---
projects/clr/rocclr/runtime/device/device.hpp | 1 +
projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp | 1 +
projects/clr/rocclr/runtime/platform/program.cpp | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/device.hpp b/projects/clr/rocclr/runtime/device/device.hpp
index e03c49931c..4ba5ba0bac 100644
--- a/projects/clr/rocclr/runtime/device/device.hpp
+++ b/projects/clr/rocclr/runtime/device/device.hpp
@@ -1124,6 +1124,7 @@ class Device : public RuntimeObject {
};
virtual Compiler* compiler() const = 0;
+ virtual Compiler* binCompiler() const { return compiler(); }
Device();
virtual ~Device();
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp
index cf5cc8b59b..9d89880962 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.hpp
@@ -42,6 +42,7 @@ class NullDevice : public amd::Device {
aclCompiler* amdilCompiler() const { return compiler_; }
aclCompiler* hsaCompiler() const { return hsaCompiler_; }
aclCompiler* compiler() const { return hsaCompiler_; }
+ Compiler* binCompiler() const { return amdilCompiler(); }
static bool init(void);
diff --git a/projects/clr/rocclr/runtime/platform/program.cpp b/projects/clr/rocclr/runtime/platform/program.cpp
index 336c95a805..6dd40e50aa 100644
--- a/projects/clr/rocclr/runtime/platform/program.cpp
+++ b/projects/clr/rocclr/runtime/platform/program.cpp
@@ -89,7 +89,7 @@ cl_int Program::addDeviceProgram(Device& device, const void* image, size_t lengt
assert(symbol && "symbol not found");
std::string symName = std::string(symbol->str[bif::PRE]) + std::string(symbol->str[bif::POST]);
size_t symSize = 0;
- const void* opts = aclExtractSymbol(device.compiler(), binary, &symSize, aclCOMMENT,
+ const void* opts = aclExtractSymbol(device.binCompiler(), binary, &symSize, aclCOMMENT,
symName.c_str(), &errorCode);
// if we have options from binary and input options was not specified
if (opts != NULL && emptyOptions) {