guydavis / machinaris

An easy-to-use WebUI for crypto plotting and farming. Offers Bladebit, Gigahorse, MadMax, Chiadog and Plotman in a Docker container. Supports Chia, MMX, Chives, Flax, and HDDCoin among others.
Apache License 2.0
337 stars 69 forks source link

Support for apple Arm M1 machines? #43

Closed AndyRPH closed 3 years ago

AndyRPH commented 3 years ago

Add support for chia running M1 native arm code on apple silicon?

guydavis commented 3 years ago

Sounds cool. Not sure I'd know where to start though. I only have an old 2018 Mac Mini in the house. Pull requests are welcome!

Mearman commented 3 years ago

I don't have an arm chip to test it on but making multi-arch Docker images isn't too much hassle. For the M1, you'd just have to target arm64.

https://www.docker.com/blog/multi-arch-images/ https://betterprogramming.pub/setting-up-a-multi-arch-docker-build-with-circleci-and-alpine-for-your-apple-m1-ba739ef1f754

AndyRPH commented 3 years ago

I've got an M1 Mac and happy to do some testing if someone gets the ball rolling that way.

guydavis commented 3 years ago

Hi! For those with Apple M1 systems, please give the latest ghcr.io/guydavis/machinaris:develop image a try. As of latest build, the arm64 architecture is enabled, but I don't have any hardware to try running it. Here's the details on GHCR and DockerHub.

Please let me know what Machinaris worker mode you choose to test with. For example, will this only work as a Harvester? Will you be able to plot with Chia and/or Madmax plotters? Can you run the Machinaris fullnode (default mode) with all services?

Let me know how things go. In particular, please provide the logs. Thanks!

AndyRPH commented 3 years ago

Interesting:

docker: Error response from daemon: create ~/.machinaris: "~/.machinaris" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.                                       
See 'docker run --help'. 

Easy enough to adjust the path, but then I get:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

My fault, followed install instructions without realizing I needed to pull the development branch.

AndyRPH commented 3 years ago

Up and running:

1) it shows a single pool, I've got my plots divided into 3 pools. How do I get it to reflect that?

2) plotting, is it using an M1 compiled madmax? Apparently it's substantially faster to use madmax on M1 machines using the INTEL binary, not the ARM binary. I think the way blake3 is implemented on M1 is more inefficient than using blake3 compiled for x86 and then letting apple's rosetta2 do its magic. So for now, I'm not plotting with this, just farming.

It would be nice to plot with this once plotman handles removing solo plots to make room for pooled plots. I can plot a k32 in 78-82 minutes on the M1 using the x86 version of madmax. (Cutting the threads in half and running two instances in parallel even staggered doesn't increase the yield of plots per 24h)

guydavis commented 3 years ago

Up and running:

Great!

  1. it shows a single pool, I've got my plots divided into 3 pools. How do I get it to reflect that?

As an advanced user with multiple keys/pools, you'll want to use the CLI to execute your chia config commands where key/wallet selection is required. Should only be required for config, as behind the scenes Machinaris is just a WebUI in-front of the stock Chia binaries doing the farming.

  1. plotting, is it using an M1 compiled madmax? Apparently it's substantially faster to use madmax on M1 machines using the INTEL binary, not the ARM binary. I think the way blake3 is implemented on M1 is more inefficient than using blake3 compiled for x86 and then letting apple's rosetta2 do its magic. So for now, I'm not plotting with this, just farming.

Interesting. Thanks for that feedback.

It would be nice to plot with this once plotman handles removing solo plots to make room for pooled plots. I can plot a k32 in 78-82 minutes on the M1 using the x86 version of madmax. (Cutting the threads in half and running two instances in parallel even staggered doesn't increase the yield of plots per 24h)

Plotman has a replot function currently under review.

guydavis commented 3 years ago

Closing as released in v0.5.2 now. Thanks to all for the help testing!