Funding request: add GPU OpenCL support to Monero solo minin[...]
What I want to do?
Now there is only CPU mining in the Monero solo mining function.
I want to add GPU mining. I will start from OpenCL. CUDA is not supported now.
Why do I want to develop it?
There are several reasons that I want to do it,
Reason 1, I have done some GPU hash calculating work related to Monero in a non-public project. I have more than 2000 lines of C++ code related to GPU/CPU based hash calculating. So it's easier to put the code into Monero than from scratch. Note 1, I only wrote all the C++ code, I didn't write the OpenCL code (though I changed it a little bit), the OpenCL code is from Wolf's work, https://github.com/OhGodAPet/wolf-xmr-miner . Note 2, The existing code needs to be modified (for both coding style and functions) to put into Monero.
Reason 2, Though there are already several very good standalone pool based mining tools, better solo mining in the official wallet can increase the interesting for casual miner and as well for more people mining for safeguard the network rather than profit.
Reason 3, Seems there are some future uses for the solo mining for the whole Monero ecosystem. Here is an interesting discussion, https://github.com/monero-project/monero/issues/3049
Reason 4, Though I'm new to cryptocurrency, Monero is the project I respect (for its technology) and I want to do more work on it. The GPU feature is a good first step.
Who am I?
I'm Wang Qi, from Beijing, China. I'm new to cryptocurrency but I'm a veteran developer with near 20 years experience.
Currently I've quit my daily job. I plan to live on my savings for 1~2 years to do something I'm really interested in (it's cryptocurrency and blockchain). It will be ideal if I can earn some money to extend my "free" time so I can do more things.
I got to know some Monero core developer then I worked on some stuff in recent months, now it's time for me to work on Monero.
I've done a lot of work on my open source projects, quite independently. I can say it's my first time to contribute to a large community (Monero) seriously.
My open source projects,
- I developed cpgf library. It's a very complicated open source cross platform C++ library that adds reflection, serialization and script binding to standard C++.
- I developed Gincu library. It's an open source 2D cross platform game engine written in C++ and cpgf.
The goals I want to achieve
- Refactor Monero mining code to support different back ends (CPU, OpenCL, and maybe CUDA in the future), note when I say CPU, it's always pure CPU mining, not the CPU device in OpenCL.
- Make the back ends support calculating on both "raw data" (such as thousands of block data) and "nonce" (such as one block data plus thousands of nonce). Working on nonce will be optimal for mining, while working on raw data may be useful for blockchain syncing (I'm not sure).
- Keep current existing "background mining" feature and make it supporting GPU as well.
- Add necessary options to the CLI.
- Back the miner with tests/unit tests.
- Refactor the overall miner code, remove the code smells, such as the in-class global functions, platform dependent preprocessor conditions (#ifdef _WIN32, etc).
Other stuff I may like to do in the future (the time is not included in this proposal, and I may or may not be able to do them during this proposal),
- Change the UI and add options about the GPU/CPU to the GUI (I have plenty of experience on Qt, though mostly are in console app)
- Make the blockchain syncing using GPU too. For this part I'm not quite sure if it's possible or necessary, either I need to look deeper into the related code or some one may guide me.
How much and how long
With current XMR price $212 from http://moneropric.es/, I would ask 0.2 XMR per hour. It's a little lower than my hourly rate being a freelancer but I'm fine with it.
The total time I expect is about 80 hours. So the total is 80 * 0.2 = 16 XMR.
Though 80 hours are only two weeks full time, since I may also work on other stuff so I can only work part time, I can only guarantee that I can finish it at latest by the end of June. Though most likely I will do much faster than it.
- Build the basic working version with GPU enable, hard coded parameters. 50 hours.
- Refactor the code to better, add CLI options, tests, and performance improvement. 30 hours.
- Optional. Add options to the GUI. I'm not sure if I'm allowed to do it or there are dedicated GUI developers.