Fix and improve the OpenCL implementation #124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview of Changes:
OpenCL Compatibility: Updated both the OpenCL library and its API bindings, ensuring miner compatibility with both the latest and older AMD drivers.
DAG Generation: Modified the OpenCL DAG generation to support coins with a DAG size exceeding 4GB.
ProgPow Loop Optimization: Integrated the ProgPow loop directly into the search function for both OpenCL and CUDA, this improves the hashrate for OpenCL. The changes were also done to CUDA to avoid overcomplicating the ProgPow.cpp file.
Kernel Warnings & Compute Definition Fixes: Addressed kernel warnings and fixed the compute definitions for Nvidia GPUs when mining via OpenCL.
Acknowledgment:
Many of these enhancements and fixes were inspired or taken from xmrig, so a huge thanks to them.
Results & Observations:
After these modifications, the miner now seems to work seamlessly with both older and newer AMD drivers. Additionally, the OpenCL miner is now also operational for Nvidia cards when CUDA mining is disabled for that card. In terms of hashrate improvements on some or all cards, when testing with an AMD Radeon RX 6700 XT, there's a significant improvement in the hashrate - from approximately 2 MH/s to around 22 MH/s.
Future Scope:
While these updates address crucial areas, there are still facets I've left untouched - like fast exiting. My aim was to introduce just enough changes to make the current OpenCL implementation work well without changing too much of the existing codebase.