Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solo mode went away in v3.22.0 #393

Closed
YetAnotherRussian opened this issue Mar 22, 2023 · 5 comments
Closed

Solo mode went away in v3.22.0 #393

YetAnotherRussian opened this issue Mar 22, 2023 · 5 comments

Comments

@YetAnotherRussian
Copy link

YetAnotherRussian commented Mar 22, 2023

Hi. Crashing again :'(

Win binaries:
image

Linux (WSL) default build:
image

I've tried 4 algos I can test, possibly not algo dependant. Will add some debug info soon.

Stratum is OK.

UPD: Debug info:

image

How about making "build-gdb.sh" script in repo?

image

Just copy the default one, add "-ggdb" and remove any stripping? So there's an abiity to build right after cloning. I can make pr, but it's just a copy-paste operation.

@JayDDee
Copy link
Owner

JayDDee commented Mar 22, 2023

It looks like I misssed a line copying changes from util.c:json_rpc_call, the last line before comment. It's new and I missed it.
I deliberately left out any changes that would obviously affect GBT, I thought json_rpc_call would be adequately tested using stratum.

Edit: the bug is related to merging pr 204 from Pooler. util.c also merged pr 206 (hex2bin).
https://github.com/pooler/cpuminer/commits/master

json_t *json_rpc_call(CURL *curl, const char *url,
const char *userpass, const char *rpc_req,
int *curl_err, int flags)
{
json_t *val, *err_val, *res_val;
int rc;
long http_rc;
struct data_buffer all_data = {0};
char *json_buf;
json_error_t err;
struct curl_slist *headers = NULL;
char curl_err_str[CURL_ERROR_SIZE];
long timeout = (flags & JSON_RPC_LONGPOLL) ? opt_timeout : 30;
struct header_info hi = {0};

all_data.headers = &hi;
/* it is assumed that 'curl' is freshly [re]initialized at this pt */

If this doesn't fix it try replacing util.c with the old version.

Regarding your suggestion for a debug build script, there's a certain skill set associated with that. Debuggng requires some creativity, it's hard to script it. Someone with the skill set to use GDB would also have the skill set to build for it.
Consider it a test, you can use GDB if you know how to build for it.

I've been testing the MSYS build using the standard build.sh. build_msys2.sh has an extra option that was apparently needed at the time. It seems to compile without it now. I'm not sure if it was ever needed. If you've been adding --param=evrp-mode=legacy, try withou it.

@YetAnotherRussian
Copy link
Author

If this doesn't fix it

Just checked, seems to work. No need to replace util.c

@JayDDee
Copy link
Owner

JayDDee commented Mar 22, 2023

Thanks. Silly error.

Edit: I'm working on another potential optimization and it's going well. I may hold off another day or 2 for a new release to include it.

@JayDDee
Copy link
Owner

JayDDee commented Mar 25, 2023

cpuminer-opt-3.22.1 is released.

@JayDDee
Copy link
Owner

JayDDee commented Mar 30, 2023

Closing thoughts on the misalingment issue. I think the compiler should have handled this much better.
For dynamically allocated blocks, for which the application has little control, the optimizer should not make changes that require alignment greater than the default malloc alignment.

There are many ways this problem could have been avoided:

  1. use AVX2 unaligned memory accesses
  2. malloc automatically aligns pointer based on target/array type
  3. optimizer realigns block to match stricter requirements
  4. not optimizing beyond default alignment or if required alignment can't be guaranteed

I don't think this the end of it. The fix I implemented is a workaound specific to certain instances, it doesn't solve the root of the problem.

@JayDDee JayDDee closed this as completed Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants