Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit ccf737b

Browse files
committedMar 26, 2020
Fix a couple of bugs in AMD split buffer mode
- FASTEXIT only works well on AMD, disable it for non-AMD GPUs. - Seems the number DAG entries is not always even! - Reduce GPU memory footprint where possible.
1 parent 3ef76aa commit ccf737b

39 files changed

+22
-5
lines changed
 

‎libethash-cl/CLMiner.cpp

+20-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace eth
2222
// WARNING: Do not change the value of the following constant
2323
// unless you are prepared to make the neccessary adjustments
2424
// to the assembly code for the binary kernels.
25-
const size_t c_maxSearchResults = 15;
25+
const size_t c_maxSearchResults = 4;
2626

2727
struct CLChannel : public LogChannel
2828
{
@@ -625,6 +625,11 @@ bool CLMiner::initDevice()
625625
cllog << "Unrecognized Platform";
626626
return false;
627627
}
628+
if (!m_settings.noExit && (m_hwmoninfo.deviceType != HwMonitorInfoType::AMD))
629+
{
630+
m_settings.noExit = true;
631+
cllog << "no exit option enabled for non AMD opencl device";
632+
}
628633

629634
if (m_deviceDescriptor.clPlatformVersionMajor == 1 &&
630635
(m_deviceDescriptor.clPlatformVersionMinor == 0 ||
@@ -839,8 +844,20 @@ bool CLMiner::initEpoch_internal()
839844
<< dev::getFormattedMemory(
840845
(double)(m_deviceDescriptor.totalMemory - RequiredMemory));
841846
m_dag.clear();
842-
m_dag.push_back(cl::Buffer(m_context[0], CL_MEM_READ_ONLY, m_epochContext.dagSize / 2));
843-
m_dag.push_back(cl::Buffer(m_context[0], CL_MEM_READ_ONLY, m_epochContext.dagSize / 2));
847+
if (m_epochContext.dagNumItems & 1)
848+
{
849+
m_dag.push_back(
850+
cl::Buffer(m_context[0], CL_MEM_READ_ONLY, m_epochContext.dagSize / 2 + 64));
851+
m_dag.push_back(
852+
cl::Buffer(m_context[0], CL_MEM_READ_ONLY, m_epochContext.dagSize / 2 - 64));
853+
}
854+
else
855+
{
856+
m_dag.push_back(
857+
cl::Buffer(m_context[0], CL_MEM_READ_ONLY, (m_epochContext.dagSize) / 2));
858+
m_dag.push_back(
859+
cl::Buffer(m_context[0], CL_MEM_READ_ONLY, (m_epochContext.dagSize) / 2));
860+
}
844861
cllog << "Loading kernels";
845862

846863
// If we have a binary kernel to use, let's try it
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

‎libethash-cl/kernels/isa/GCN3_ethash_search.isa

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
.arg target, "ulong", ulong
3232
.text
3333

34-
MAX_SEARCH_RESULTS = 15
34+
MAX_SEARCH_RESULTS = 4
3535
result_count_offset = (MAX_SEARCH_RESULTS * 64)
3636

3737
mix0 = %v24

‎libethash-cl/kernels/isa/GCN5_ethash_search.isa

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
.arg target, "ulong", ulong
3232
.text
3333

34-
MAX_SEARCH_RESULTS = 15
34+
MAX_SEARCH_RESULTS = 4
3535
result_count_offset = (MAX_SEARCH_RESULTS * 64)
3636

3737
mix0 = %v24

0 commit comments

Comments
 (0)
This repository has been archived.