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

Commit 232b216

Browse files
committedJul 22, 2018
CL mining overhaul
- Replace stable and experimental opencl kernel with jawawawa ethash.cl - Restore original jawawawa result reporting array - Delete --cl-kernel parameter. Try binary, if not fall back to opencl - Support up to 255 solutions per pass (more than one) - Shave some time off dag gen - Properly delete old cl::Buffers when allocating new ones - Binary kernel installation optional via cmake parameter - Update relevant docs
1 parent 2b14f35 commit 232b216

29 files changed

+655
-1179
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
- API responses return "ethminer-" as version prefix. [#1300](https://github.com/ethereum-mining/ethminer/pull/1300).
1414
- Stratum mode autodetection. No need to specify stratum+tcp or stratum1+tcp or stratum2+tcp
1515
- Connection failed due to login errors (wrong address or worker) are marked Unrecoverable and no longer used
16+
- Replaced opencl kernel with opensource jawawawa opencl kernel
17+
- Added support for jawawawa AMD binary kernels
18+
- AMD auto kernel selection. Try bin first, if not fall back to opencl.
1619

1720
## 0.15.0rc1
1821

‎CMakeLists.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ option(ETHASHCL "Build with OpenCL mining" ON)
2828
option(ETHASHCUDA "Build with CUDA mining" ON)
2929
option(ETHDBUS "Build with D-Bus support" OFF)
3030
option(APICORE "Build with API Server support" ON)
31+
option(BINKERN "Install AMD binary kernels" ON)
3132

3233
# propagates CMake configuration options to the compiler
3334
function(configureProject)
@@ -43,6 +44,9 @@ function(configureProject)
4344
if (APICORE)
4445
add_definitions(-DAPI_CORE)
4546
endif()
47+
if (BINKERN)
48+
add_definitions(-DBIN_KERN)
49+
endif()
4650
endfunction()
4751

4852
hunter_add_package(Boost COMPONENTS system filesystem)
@@ -70,6 +74,7 @@ message("-- ETHASHCL Build OpenCL components ${ETHASHCL
7074
message("-- ETHASHCUDA Build CUDA components ${ETHASHCUDA}")
7175
message("-- ETHDBUS Build D-Bus components ${ETHDBUS}")
7276
message("-- APICORE Build API Server components ${APICORE}")
77+
message("-- BINKERN Install AMD binary kernels ${BINKERN}")
7378
message("------------------------------------------------------------------------")
7479
message("")
7580

@@ -88,7 +93,9 @@ add_subdirectory(libpoolprotocols)
8893

8994
if (ETHASHCL)
9095
add_subdirectory(libethash-cl)
91-
add_subdirectory(libethash-cl/kernels)
96+
if (BINKERN)
97+
add_subdirectory(libethash-cl/kernels)
98+
endif()
9299
endif ()
93100
if (ETHASHCUDA)
94101
add_subdirectory(libethash-cuda)

‎docs/BUILD.md

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF
139139
* `-DETHASHCUDA=ON` - enable CUDA mining, `ON` by default.
140140
* `-DAPICORE=ON` - enable API Server, `ON` by default.
141141
* `-DETHDBUS=ON` - enable D-Bus support, `OFF` by default.
142+
* `-DBINKERN=ON` - install AMD binary kernels, `ON` by default.
142143
143144
## Disable Hunter
144145

‎ethminer/main.cpp

+15-23
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@ class MinerCLI
331331

332332
#if ETH_ETHASHCL
333333

334+
app.add_option("--cl-kernel", m_clKernel,
335+
"Ignored parameter. Kernel is auto-selected.", true)
336+
->group(OpenCLGroup)
337+
->check(CLI::Range(2));
338+
339+
334340
app.add_option("--opencl-platform", m_openclPlatform,
335341
"Use OpenCL platform n", true)
336342
->group(OpenCLGroup);
@@ -340,27 +346,21 @@ class MinerCLI
340346
->group(OpenCLGroup);
341347

342348
app.add_set("--cl-parallel-hash", m_openclThreadsPerHash, {1, 2, 4, 8},
343-
"Set the number of threads per hash", true)
349+
"ignored parameter", true)
344350
->group(OpenCLGroup);
345351

346-
app.add_option("--cl-kernel", m_openclSelectedKernel,
347-
"Select kernel. 0 stable kernel, 1 experimental kernel, 2 binary kernel", true)
348-
->group(OpenCLGroup)
349-
->check(CLI::Range(2));
350-
351352
app.add_option("--cl-iterations", m_openclIterations,
352353
"Number of outer iterations to perform before enqeueing on a new nonce", true)
353354
->group(OpenCLGroup)
354355
->check(CLI::Range(1,99999));
355356

356357
app.add_option("--cl-global-work", m_globalWorkSizeMultiplier,
357-
"Set the global work size multipler. Specify negative value for automatic scaling based on # of compute units", true)
358+
"Set the global work size multipler.", true)
358359
->group(OpenCLGroup);
359360

360-
app.add_option("--cl-local-work", m_localWorkSize,
361+
app.add_set("--cl-local-work", m_localWorkSize, {64, 128, 192, 256},
361362
"Set the local work size", true)
362-
->group(OpenCLGroup)
363-
->check(CLI::Range(64, 256));
363+
->group(OpenCLGroup);
364364

365365
#endif
366366

@@ -564,14 +564,6 @@ class MinerCLI
564564
}
565565

566566
#if ETH_ETHASHCL
567-
if ((m_localWorkSize != 64) &&
568-
(m_localWorkSize != 128) &&
569-
(m_localWorkSize != 192) &&
570-
(m_localWorkSize != 256))
571-
{
572-
cerr << endl << "opencl local work must be 64, 128, 192 or 256." << "\n\n";
573-
exit(-1);
574-
}
575567
m_openclDeviceCount = m_openclDevices.size();
576568
#endif
577569

@@ -629,7 +621,6 @@ class MinerCLI
629621
m_miningThreads = m_openclDeviceCount;
630622
}
631623

632-
CLMiner::setCLKernel(m_openclSelectedKernel);
633624
CLMiner::setNumberIterations(m_openclIterations);
634625
CLMiner::setThreadsPerHash(m_openclThreadsPerHash);
635626

@@ -641,7 +632,8 @@ class MinerCLI
641632
m_dagLoadMode,
642633
m_dagCreateDevice,
643634
m_noEval,
644-
m_exit
635+
m_exit,
636+
m_clKernel
645637
)) {
646638
stop_io_service();
647639
exit(1);
@@ -904,13 +896,13 @@ class MinerCLI
904896
unsigned m_miningThreads = UINT_MAX;
905897
bool m_shouldListDevices = false;
906898
#if ETH_ETHASHCL
907-
unsigned m_openclSelectedKernel = 0; ///< A numeric value for the selected OpenCL kernel
908899
unsigned m_openclIterations = 1; ///< A numeric value for the number of iterations
909900
unsigned m_openclDeviceCount = 0;
910901
vector<unsigned> m_openclDevices;
911-
unsigned m_openclThreadsPerHash = 8;
912-
int m_globalWorkSizeMultiplier = CLMiner::c_defaultGlobalWorkSizeMultiplier;
902+
int m_openclThreadsPerHash = -1;
903+
unsigned m_globalWorkSizeMultiplier = CLMiner::c_defaultGlobalWorkSizeMultiplier;
913904
unsigned m_localWorkSize = CLMiner::c_defaultLocalWorkSize;
905+
int m_clKernel = -1;
914906
#endif
915907
#if ETH_ETHASHCUDA
916908
unsigned m_cudaDeviceCount = 0;

0 commit comments

Comments
 (0)
This repository has been archived.