-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Optimise work updates on CUDA, was Branch#359 #361
Optimise work updates on CUDA, was Branch#359 #361
Conversation
How is it going? |
I am working on it, but i don't have a suitable gpu to test my changes |
If you need a tester, i'm availoable. I have gtx 1060 3gb and 6 gb and also gtx 1070 to test it. LE: I'm using windows 10 64bit 1073 version if this has any relevance for you |
I could test it too with 1060 and CUDA 9 on Linux -- if someone can tell me how to patch ethminer from git with these changes. |
Travis ci: |
Yes, something changed in Travis/macOS, but it is not related. I will try to fix it soon. |
travis fixed in master branch |
Can you rebase this? Is this ready? |
This is not ready! |
Yes this is not ready, it gets stuck at generating DAG C:\ethminer>ethminer.exe --farm-recheck 5000 -U -S eu1.ethermine.org:4444 -FS eu1.ethermine.org:14444 -O 0x.................. --cuda-parallel-hash 4 --api-port 3333 |
Thats propably because of a previous bug, I'm going to rebase it later, but thanks for testing 👍 |
No problem, i will test everything because i can't use 12 final version. It seams it is worst than 12.rc1 on nvidia miners. To much hash drops like other reported already. Now everything seems it is on your shoulders to find out were is the problem and if i can help, i do it gladly. |
1e282d2
to
a816f1c
Compare
I rebased it now, can you retest it? |
Sorry the same, it can't pass the generation of DAG. It generat's it until 97% and it starst again. ethminer -U -S eu1.ethermine.org:4444 -O 0xY.............. --cuda-parallel-hash 4 i 00:57:45|CUDA5 No work. Pause for 3 s. i 00:57:45|CUDA6 No work. Pause for 3 s. cu 00:57:47|CUDA0 Using device: GeForce GTX 1070 (Compute 6.1) |
|
it looks like it is working, but i don't know how and the rate, no other info than this LE: it's not submitting anything. On Ethermine.org the miner apears offline! 13:43:15|CUDA2 No work. Pause for 3 s. |
@ZiDanRO from you logs it looks like something is broken in the logic in the miner and it does not see the work updates. |
I see that Appveyor can't build so that i could test the new kernel. When is ready i will try it. |
Oh man, I really hate it... I'm going to invest my Christmas money into buying a GPU to test that stuff myself. I'm really sorry. Can you run valgrind/gdb or something over it? |
in windows is ok. no errors until now |
Under Ubuntu 16.04 LTS problem is with hwmon. Runs fine without -HWMON option. Code crashes trying to display per card temp and fan speed data. Not seeing performance improvement, perhaps even slight performance loss. Will monitor for an hour for stale rate. |
I will test the hwmon stuff. soon |
This continues to work well when the hardware monitor is disabled. I'd get rid of the per card "Set work;" logs. They present identical information for all GPUs, information already provided by the single stratum log. |
Also now works with hwmon enabled (-HWMON) ??? Where'd that get fixed? NOTE: I deleted the cnote << "set work;"... log in my local build, but that shouldn't have anything to do with it. |
libethash-cuda/CUDAMiner.cpp
Outdated
@@ -17,6 +17,8 @@ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. | |||
/** @file CUDAMiner.cpp | |||
* @author Gav Wood <[email protected]> | |||
* @date 2014 | |||
* @author MariusVanDerWijden |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to remove entire comment. Git should be enough to find contributors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
libethash-cuda/CUDAMiner.cpp
Outdated
@@ -113,75 +115,87 @@ void CUDAMiner::report(uint64_t _nonce) | |||
void CUDAMiner::kickOff() | |||
{ | |||
m_hook->reset(); | |||
startWorking(); | |||
//startWorking(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the commented out part
libethash-cuda/CUDAMiner.cpp
Outdated
delete m_miner; | ||
//delete m_miner; | ||
//m_miner = new ethash_cuda_miner; | ||
if(!m_miner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just embed ethash_cuda_miner in CUDAMiner. I will remove it anyway later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I will fix it later.
libethash-cuda/CUDAMiner.cpp
Outdated
bytesConstRef lightData = light->data(); | ||
EthashAux::LightType light; | ||
light = EthashAux::light(seed); | ||
//bytesConstRef dagData = dag->data(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what you mean
current.seed = h256{1u}; | ||
try | ||
{ | ||
while(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this loop ends?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, fixed it
libethash-cuda/CUDAMiner.cpp
Outdated
@@ -194,7 +208,7 @@ void CUDAMiner::workLoop() | |||
void CUDAMiner::pause() | |||
{ | |||
m_hook->abort(); | |||
stopWorking(); | |||
//stopWorking(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
libethash-cuda/ethash_cuda_miner.cpp
Outdated
@@ -17,6 +17,8 @@ | |||
/** @file ethash_cuda_miner.cpp | |||
* @author Genoil <[email protected]> | |||
* @date 2015 | |||
* @author MariusVanDerWijden |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove entire comment.
libethash-cuda/ethash_cuda_miner.cpp
Outdated
@@ -63,6 +65,11 @@ ethash_cuda_miner::search_hook::~search_hook() {} | |||
|
|||
ethash_cuda_miner::ethash_cuda_miner() | |||
{ | |||
int devicesCount = getNumDevices(); | |||
m_light = new hash64_t*[devicesCount]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WTF? Use std::vector<hash64_t*>(deviceCount)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only have a fixed no. of devices, i use this as a lookup whether a device has a light-struct already allocated. Since the number of devices during an execution doesn't change its save to use an array and index it by device_num
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::vector will do the same (single allocation once) and you will not have to fill it with nullptrs manually and delete in the end.
libethash-cuda/ethash_cuda_miner.cpp
Outdated
m_light = new hash64_t*[devicesCount]; | ||
for(int i = 0; i < devicesCount; i++) | ||
m_light[i] = nullptr; | ||
m_dag = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Init m_dag
in declaration.
libethash-cuda/ethash_cuda_miner.h
Outdated
@@ -58,7 +58,14 @@ class ethash_cuda_miner | |||
uint64_t m_starting_nonce; | |||
uint64_t m_current_index; | |||
uint32_t m_sharedBytes; | |||
|
|||
///Constants on GPU | |||
hash128_t* m_dag; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Init all the fields.
Left running overnight on 3 cards. Still has problem in HWMON. All three cards report exactly the same temp and fan speed percentage. |
@jean-m-cyr edit: update, i can reproduce the problem on windows, testing on linux soon |
libethash-cuda/ethash_cuda_miner.cpp
Outdated
|
||
if (device_count == 0) | ||
return false; | ||
|
||
// use selected device | ||
m_device_num = std::min<int>((int)_deviceId, device_count - 1); | ||
|
||
unsigned device_num = _deviceId < device_count -1 ? _deviceId : device_count - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to use class variable m_device_num
(or set it to same value), happy to change it to unsigned, but hwmon needs the device_num later to fetch stats for the correct device. See line 404 in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep...
Changing m_device_num type to uint32, and all references to device_num in ethash_cuda_miner::init to m_device_num does the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah I'm sorry... fixed it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@subtly is this fine now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only this vector instead of raw dynamic array left. I'm fine with the rest.
libethash-cuda/CUDAMiner.cpp
Outdated
delete m_miner; | ||
//delete m_miner; | ||
//m_miner = new ethash_cuda_miner; | ||
if(!m_miner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I will fix it later.
libethash-cuda/ethash_cuda_miner.cpp
Outdated
|
||
ethash_cuda_miner::~ethash_cuda_miner() | ||
{ | ||
delete[] m_light; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not be needed at at all if std::vector
used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
libethash-cuda/ethash_cuda_miner.cpp
Outdated
for(int i = 0; i < devicesCount; i++) | ||
int deviceCount = getNumDevices(); | ||
m_light = std::vector<hash64_t*>(deviceCount); | ||
for(int i = 0; i < deviceCount; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed. vector's constructor will init all elements with default values, in this case with nullptr
.
libethash-cuda/ethash_cuda_miner.cpp
Outdated
m_light = new hash64_t*[devicesCount]; | ||
for(int i = 0; i < devicesCount; i++) | ||
int deviceCount = getNumDevices(); | ||
m_light = std::vector<hash64_t*>(deviceCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but because m_light
is a vector already, you can alternatively write it like m_light.resize(deviceCount)
. Still it will init new elements with nullptr
.
Confirmed working with -HWMON enabled. |
Ready to merge? |
Yes, Thank you all for bearing with me and for your continuous support |
Great work! Welcome to the group of the ethminer contributors. |
Working on issue #359
The newest commit should work, Please test it!