Closed badman74 closed 10 years ago
Can you link your config?
I have the same problem. Bug is introduced in #282
I tracked down the issue to the algorithm switcher and this seems to be a problem with the windows implementation of pthread. I managed to fix this problem in a test build but it's a dirty hack in my view.
if (unlikely(pthread_create(&restart_thr, NULL, restart_mining_threads_thread, (void *) (intptr_t) n_threads)))
quit(1, "restart_mining_threads create thread failed");
sleep(60);
quit(1, "thread was not cancelled in 60 seconds after restart_mining_threads");
At the end of the algo switcher, a thread (restart_thr
) is launched to restart all mining threads/gpus and returns NULL
when done. The parent thread meanwhile sleeps 60 seconds and if the timeout is reached, sgminer assumes that something went wrong and quits.
I'm not overly knowledgeable with pthread but under linux, when the restart thread returns NULL, somehow the parent thread returns also, cancelling the 60 seconds timeout. No issues there.
Under windows, however, the restart thread returns NULL and nothing happens. The parent thread still waits for the timeout and eventually reaches it even tho everything is ok. This causes sgminer to quit.
Does anyone have an idea why this is happening? I can release my fix but it's not a long term solution in my opinion...
I'm guessing this has been a problem in the algo switcher for a while now. See #269
Here are my config and log: Log: http://pastebin.com/QSWvq1TF Config: http://pastebin.com/B9xjRKLB Profiles: http://pastebin.com/fB9apbNg
I tried config with default-profile
but problem remains.
@ystarnaud I am not sure this is (only) algo switcher problem because before #282 everything worked fine with the same config.
Dirty hack is to comment line (for win32):
quit(1, "thread was not cancelled in 60 seconds after restart_mining_threads");
I've been running sgminer without above line for 12h. No problems nor (visible) memory leaks.
@troky Ok, your config doesn't have an algorithm
set at the global level (outside of pools or profiles) and you don't have a default-profile
set to load an algorithm from. This makes sgminer load ckolivas
at startup.
Now this is what happens: sgminer starts with an initial algo, In your case ckolivas
. Sgminer looks for the first alive pool to hash on. It finds pool 0, tmb x11. Pool 0 wants darkcoin-mod
, but ckolivas
is loaded. Algo switcher comes into play, darkcoin-mod
is loaded, pool 0 starts hashing. The thread issue I mentioned above happens, sgminer exits.
If you set a default-profile
, this can happen also. Say your default profile was x13, marucoin-mod
would be loaded at sgminer startup. Pool 0 is alive, wants darkcoin-mod
. Algo switcher happens, sgminer exits after 60 seconds.
This only happens on windows. My solution was to set a boolean variable globally. Once the restart thread was done, it would set it to true. When the timeout happened, and the variable was true, it would cancel the thread and avoid quitting sgminer.
There is some logic questions here we need to solve:
default-profile
setting mandatory? Why not fall back to first profile defined in profiles
?algorithm
? Every profile should have algorithm set and if it isn't set throw config error.@troky Granted, my implementation has had a few flaws and I address them as people bring them to my attention. I do plenty of testing of my own but I can't account for everyone's particular configs or system builds. That being said here are answers to your questions:
default-profile
IS NOT mandatory. If you don't specify anything there, global level settings populate it like in old style configs. If you don't have global level settings then sgminer core defaults come into play. I can set it to fall back to profile 0 but again, it won't solve problems with the core of sgminer.@ystarnaud
Waiting for @mrbrdo for pthrads sleep/quit fix or workaround on windows.
Give the latest commits a shot. I believe I solved a few things and hopefully didn't create new issues...
It works for me. With or without default-profile
setting.
I'd say we can close this as of build 4.2.1-178-g7801
i am running windows 7 if i have profiles configured and it is not on the default-profile or it isnt specified then the miner quits after 60 sec