Chainfire / UselethMiner

Ethereum CPU miner and aggregating proxy
88 stars 8 forks source link

M1 Pro 16GB, etc. #3

Open CarlosOrozco88 opened 3 years ago

CarlosOrozco88 commented 3 years ago

Hi! I saw your miner and i test it with my new M1 Pro with 16GB ram. It seems that can do consistent 7.5MHs while ethminer is scoring 5MHs. Also with TG Pro and 100% fan speed the cpu temps are <=80°. At 70% rpm is around 85°. Im a programmer (js ecosystem-node) but i have no knolowge of c, opencl, metal but if you need/want some testing i can help, just for fun.

Great work and thanks!

Fast-T commented 2 years ago

do you get hugepages on your mac?

CarlosOrozco88 commented 2 years ago

Unafortunatly, no. image

Chainfire commented 2 years ago

Sorry, I missed this issue notification.

Have you tried the m1-specific build of ethminer (ethminer-m1) ? Reportedly it scores 10.25 mh/s on the M1 Max. Unsure if they can be run at the same time - they couldn't on the original M1 I tested on, but that only had 8GB RAM. I don't have any results for uselethminer on the M1 Max unfortunately. If a Mac Mini comes out with these chips I might order one to mess around with.

I'd be very interested to know the actual powerdraw of your M1 Pro unit (laptop?) when running uselethminer at full speed (both screen on and off).

Additionally, I did notice on the M1 (original) Mac Mini that performance started off at something like 4.5 MH/s, but would slowly creep down to 2.5 or so over the course of an hour. Do you see the same thing on the M1 Pro?

Hugepages are not supported by the M1 kernels at all. I'm not sure if the architecture supports them, but one would assume so. If they could be activated, it might nearly double the throughput (or it might not, eh).

There's not really anything you can do programming-wise to help. Currently the source is not public, but even if it was, only hardcore C and SIMD/NEON experience would help.

As for testing things I come up with, I don't think there's much more I can do currently to improve performance. There are some small tweaks I can do that might improve performance 5-10% or so with a lot of effort, something I probably won't bother even trying unless I have direct physical access to a machine.

CarlosOrozco88 commented 2 years ago

Have you tried the m1-specific build of ethminer (ethminer-m1) ? Reportedly it scores 10.25 mh/s on the M1 Max. Unsure if they can be run at the same time - they couldn't on the original M1 I tested on, but that only had 8GB RAM. I don't have any results for uselethminer on the M1 Max unfortunately. If a Mac Mini comes out with these chips I might order one to mess around with.

Yes, it runs at the same time without any problem. In my m1 pro (16gb ram, 10 core cpu, 16 core gpu) ethminer-m1 scores 5mh/s while useleth is scoring consistenly 7.5 mh/s.

I'd be very interested to know the actual powerdraw of your M1 Pro unit (laptop?) when running uselethminer at full speed (both screen on and off).

The cpu is drawing about 30mW. ethminer only draws about 6mW on the GPU side, i think that a miner for this gpu using metal should be about 6 times faster than ethminer (i think gpu on full power should draw aprox 35mW). image image I have TGPro with custom speedfan configuration: image

How i can measure the screen powerdraw?

Additionally, I did notice on the M1 (original) Mac Mini that performance started off at something like 4.5 MH/s, but would slowly creep down to 2.5 or so over the course of an hour. Do you see the same thing on the M1 Pro?

No, image image ehtminer-m1 (m1proethminer): image uselethminer (m1prouselethminer): image uselethminer2 (mprowinuseleth) is a macbook pro retina from 2015 with a i7-4870HQ 2.50GHz (16gb ram): windows 10 pro/bootcamp with hugepages enabled, scoring about 1.5mh/s

What do you think about the gpu? It is metal/the architecture a limit for this gpu? In theory, 30mh/s (m1pro) and 60mh/s(m1 max) from gpu + 7.5mh/s from cpu is a "profitable" mining machine :'), with a very few powerdraw.

I am writing this in the same m1pro laptop while using the two minners, not very responsive but i can type...

Chainfire commented 2 years ago

Very interesting results. And uselethminer does not slow down when ethminer-m1 is also running and vice-versa? I think they share the same memory so that's certainly possible.

Looking at the numbers, package power does not include the screen, so no need to test that.

I have no idea if a full metal implementation would actually be faster than what ethminer-m1 does, as I do not have experience working with metal.

CarlosOrozco88 commented 2 years ago

Very interesting results. And uselethminer does not slow down when ethminer-m1 is also running and vice-versa? I think they share the same memory so that's certainly possible.

No, both miners are running at full speed. The m1 pro has a 200gb/s bandwith and the max has 400gb/s, shared between cpu and gpu, so i think that this should not be a problem if the system has enough memory available

Fast-T commented 2 years ago

i can attest that. i have the same config and come to similar results. running both miners at the same time. a metal version of the entminter should in theory boost the performance. unfortunately I have no idea how to metalize it

Fast-T commented 2 years ago

would be awesome if you could let ethminer use your proxy function

Chainfire commented 2 years ago

That should be possible...?

Chainfire commented 2 years ago

@CarlosOrozco88 I released 0.11 for macOS+arm64 specifically. I got another 5% gain, up to 8.1 MH/s, on an M1 Max, by playing with the --size parameter, setting it to 88. Let me know if it works for you.

CarlosOrozco88 commented 2 years ago

I tried to install this version, but is seems i need some other things installed (i think homebrew).

Chainfire commented 2 years ago

@CarlosOrozco88 what does it say exactly? It should not require homebrew any more than the v0.1 package did, and that worked for you?

Also, I just uploaded v0.2 which adds metal support. Unfortunately, it does not bring massive speed gains over the OpenCL implementation in ethminer-m1. I clocked it at exactly the same speed on my new M1 Max.

In the end the Ethereum mining algorithm is latency-limited, not bandwidth-limited. I think the hardware should technically be able to go faster, there just doesn't seem to be a way to tell it what to do on a low enough level to make that happen.

La-te commented 2 years ago

@CarlosOrozco88 what does it say exactly? It should not require homebrew any more than the v0.1 package did, and that worked for you?

I'm getting this `$ /usr/local/uselethminer/uselethminer

Traceback (most recent call last): File "/usr/local/uselethminer/uselethminer.py", line 13, in File "/usr/local/uselethminer/controller.py", line 10, in File "/usr/local/uselethminer/stratum.py", line 6, in File "/usr/local/uselethminer/jsonrpc.py", line 8, in File "/usr/local/uselethminer/jsonrpccrypt.py", line 8, in File "/usr/local/uselethminer/cryptography/hazmat/backends/init.py", line 9, in default_backend File "/usr/local/uselethminer/cryptography/hazmat/backends/openssl/init.py", line 6, in File "/usr/local/uselethminer/cryptography/hazmat/backends/openssl/backend.py", line 64, in File "/usr/local/uselethminer/cryptography/hazmat/bindings/openssl/binding.py", line 14, in ImportError: dlopen(/usr/local/uselethminer/cryptography/hazmat/bindings/_openssl.so, 0x0002): Library not loaded: /opt/homebrew/Cellar/openssl@3/3.0.1/lib/libcrypto.3.dylib Referenced from: /usr/local/uselethminer/libssl.3.dylib Reason: tried: '/opt/homebrew/Cellar/openssl@3/3.0.1/lib/libcrypto.3.dylib' (no such file), '/usr/lib/libcrypto.3.dylib' (no such file) `

La-te commented 2 years ago

I tried to install this version, but is seems i need some other things installed (i think homebrew).

Is it this issue what I'm having? #5

Chainfire commented 2 years ago

@CarlosOrozco88 @La-te v0.22 should solve the homebrew problem

La-te commented 2 years ago

@CarlosOrozco88 @La-te v0.22 should solve the homebrew problem

v0.22 solved the issue for me. I don't have homebrew installed.

CarlosOrozco88 commented 2 years ago

-t 5,10,100 image 10MH

--flavor armv8af --size 88 image 6.5MH

--flavor armv8af --size 88 --flavor-gpu metal image 6.1MH + 3.9MH = 10MH

I do not know why, but after using --size parameter, now i cant enable more than 5 CPU threads. I think it should be scoring around 10MH (CPU) + 4-5MH(GPU) = 15MH on a M1 Pro, should it?

tryadelion commented 2 years ago

i'll try to test the new version, fresh m1 pro

Chainfire commented 2 years ago

@CarlosOrozco88 did you actually add -t 10 ? Variable threads do not work on v0.23 with Metal enabled. They should work again in the next version, though.