mludvig / aws-ethereum-miner

CloudFormation template for mining Ethereum crypto currency on AWS
267 stars 152 forks source link

Mining on g4ad.xlarge with Radeon Pro V520 #25

Closed BE-CH closed 2 years ago

BE-CH commented 2 years ago

Thanks for your work in the AWS mining field, @mludvig !

I was looking around at the different instances with GPU's and I found the G4ad instances. They all seem to have AMD Radeon Pro V520 GPUs that looks really good for mining.

This youtube video showcasing (a slight modified version of V520) 70 MH/s mining ETH! https://www.youtube.com/watch?v=WMaPkCYJ1WA

The price of g4ad.xlarge linux on demand is just $0,38 pr. hour! I have done some calculations, and with this info it seems like its the pest price pr. MH/s coming in at 184 MH/s pr. $1 (Linux on demand price).

Have you tested the G4AD instances? If so, what was your results?

mludvig commented 2 years ago

The video says it's modified and overclocked so the hashrate on g4ad is almost certainly going to be less. Still may be worth it, I may have to look at it sometime.

The trouble is that AMD Radeons need a different software, both the OS drivers and the mining software since they're not NVIDIA / CUDA compatible.

BE-CH commented 2 years ago

I just tested AMD Radeons V520 on the g4ad.xlarge. They mine without a problem.

They are each running 48-50 MH/s on AWS. So quite a bit less than the 70 MH/s seen in the video.

On demand for g4ad.xlarge is running 131 MH/s pr 1$. Spot pricing for g4ad.xlarge is running 389 MH/s pr. 1$

Tho getting a spot instance of g4ad.xlarge is basically impossible, at least in my experience.

hermitico commented 2 years ago

Hi all,

What is the most cost-effective setup these days?

Merry Xmas!

mludvig commented 2 years ago

@BE-CH can you test the updated templates to see if it works for you? They now support G4ad instances.

jxu commented 2 years ago

Are the new Radeon AMI, ex. ami-0f28b3a6ec09b33d5 for us-east-2, custom made with OpenCL installed?

I still get ethminer "Error: No usable mining devices found". PhoenixMiner says

Phoenix Miner 5.6d Linux/gcc - Release build
--------------------------------------------

No CUDA driver found
Unknown OpenCL driver version! Hashrate and stale shares may suffer
OpenCL platform: OpenCL 2.2 AMD-APP (3361.0)
No avaiable GPUs for mining. Please check your drivers and/or hardware.

clinfo output

$ clinfo
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.2 AMD-APP (3361.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback 
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.11
  ICD loader Profile                              OpenCL 2.1
    NOTE:   your OpenCL library only supports OpenCL 2.1,
        but some installed platforms support OpenCL 2.2.
        Programs using 2.2 features may crash
        or behave unexpectedly
mludvig commented 2 years ago

@jxu what if you run my template as-is in us-east-2? Does it work? If it does then it’s a compatibility issue with your software.

jxu commented 2 years ago

The template as-is does not run for me. I have no experience with AWS Stacks - it reports the stack was created successfully, but AFAIK no instances are running. I also noticed I couldn't seem to ever get spot instances so I set it to both on-demand and spot. I'm not sure what the issue is as I haven't ever used AWS Session Manager and no instances showed up there.

What I did for now is just run ethminer on a manually created instance using more or less the startup script from the default template without setting up a stack.

jxu commented 2 years ago

I guess it is something not setup with the specific AMI. TeamRedMiner reports something similar:

[2022-01-05 22:07:00] Auto-detected AMD OpenCL platform 0
[2022-01-05 22:07:00] Failed to list OpenCL devices for platform 0.
mludvig commented 2 years ago

@jxu spot are sometimes hard to get but if you get ondemand going in then try to login to it via SSM - select the instance, and click “Connect” in the top-right set of buttons. Then select Session Manager and Connect. You should get a black screen with a “$” prompt. Then you can run sudo su - to get a proper root shell. Check what the output is in /tmp/ethminer.log.

jxu commented 2 years ago

Ok for some reason before instances weren't showing up - maybe because I couldn't get spot instances? I set instanceType to g4ad.xlarge and spot or on-demand to both. Now the instances seemed to boot and the log is reporting about 50 Mh/s which seems correct.

So I'm still not sure what was wrong with me testing ethminer on the custom AMI without a stack unless the stack setup does extra opencl installation or something. Also I only see one instance running - if I used default hashrate of 250, shouldn't it spin up 5 instances? I'm not sure how AWS stacks work. It just took a while for the new instances to startup

mludvig commented 2 years ago

The Radeon AMI should boot up with OpenCL ready to go, not sure what happend with your instance.

It may take some time to get all the instances, esp if you’re using ‘spot’ or ‘both’. Also note that with ‘both’ it will do 50% spot and 50% ondemand.

jxu commented 2 years ago

Ok it looks like 2/4 of my instances are spot and they just took a while. I would go with 100% spot but idk how long I'd be waiting.

The instances are using the same exact ami-0f28b3a6ec09b33d5 radeon AMIs so idk why the manually created instances didn't work.

mgeeforce commented 2 years ago

I am having a similar experience using the RadeonX8664 image: ami-04ad2df5b2bf97fd5 in ca-central-1. clinfo isn't installed and after installing it - "no devices found in platform". The template itself fails as tries to deploy a g4ad.16xlarge, regardless of hash rate specified , which isn't available in my default region.

jxu commented 2 years ago

The template itself fails as tries to deploy a g4ad.16xlarge, regardless of hash rate specified , which isn't available in my default region.

Which instances did you put into the template parameters? Only put instances that are available in your chosen region.

mludvig commented 2 years ago

@mgeeforce @jxu I've just fixed the issue with ca-central-1 - I had to explicitly exclude g4ad.8xlarge and g4ad.16xlarge in that region. They are reported as available by the EC2 API but don't actually work, go figure... Try the deployment again please and let me know. Commit 23065e3