breakds / www.breakds.org

Personal website based on the academic/hugo project.
2 stars 0 forks source link

post/mine-ethereum-with-nix/ #2

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

How to Mine Ethereum (ETH) with Nix | The Farming Coders

A guide to start mining Eth immediately with Nix.

https://www.breakds.org/post/mine-ethereum-with-nix/

dsearle commented 3 years ago

When I try and use the nix-shell option I get the following when running nix-shell -p ethminer:

make[2]: *** [libethash-cuda/CMakeFiles/ethash-cuda.dir/build.make:84: libethash-cuda/CMakeFiles/ethash-cuda.dir/ethash-cuda_generated_ethash_cuda_miner_kernel.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:502: libethash-cuda/CMakeFiles/ethash-cuda.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 60%] Linking CXX static library libpoolprotocols.a
[ 60%] Built target poolprotocols
make: *** [Makefile:171: all] Error 2
builder for '/nix/store/bsli77m4lypacjxxkqrgj8m4gwg29jc9-ethminer-0.18.0.drv' failed with exit code 2
error: build of '/nix/store/bsli77m4lypacjxxkqrgj8m4gwg29jc9-ethminer-0.18.0.drv' failed
breakds commented 3 years ago

@dsearle - Can I have more information?

  1. Are you running NixOS?
  2. What is the cuda version?
  3. What is the nixpkgs commit you are pinning to if you know the commit?
dsearle commented 3 years ago

Hi there.

I am running NixOs. Cuda 11.1

I am very new to NixOs so I'm not sure about the nixpkgs question.

Thanks for your help so far!

breakds commented 3 years ago

Okay, so if you are using 30s Nvidia GPUs with Cuda 11, my best guess now is that you probably need etherminer 0.19 (while the ethminer in nixpkgs is still 0.18). I have an updated packages for 0.19 at here. You can download it and put it in your machine's configuration for NixOS - just replace the original one from nixpkgs by using an overlay.

You can find an example of how to add this to your overlay in this NixOS configuration.

Let me know if it helps!

dsearle commented 3 years ago

I'm actually using a GeForce 2060 Nvidia GPU with CUDA. Will the same apply? Thanks again for the direction.

breakds commented 3 years ago

Yep it should. I think the only concern here is cuda 11, but ethminer 0.19 does add support for 30s GPUs, which is an added bonus.

ghost commented 3 years ago

Thanks for nice article, Seems something about cuda is broken right now therefore build failes in nixos-unstable, do you have same issue? I found it's great to pin nixpkgs to working revision like this using flake:

{
  description = "my project description";

  inputs.flake-utils.url = "github:numtide/flake-utils";
  inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=dad48f0ada2b0de924d9dc8f1f7758595a1ab30f";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          config = { allowUnfree = true;};
          system = "x86_64-linux";
        };
      in
      {
        devShell = import ./shell.nix { inherit pkgs; };
      }
  );
}

I ended up using teamredminer inside docker though because it gives me much better hash haha

breakds commented 3 years ago

@btwiusegentoo: Thanks for sharing! Yep the current ethminer on nixpkgs does not work with Cuda 11 I think.

I like your flake-based solution. I am thinking about writing a post about flakes too :)

Meanwhile, this is how I worked around the issue - having a newer version of ethminer in a custom derivation as here The service has been working fine with this work-around.

dsearle commented 3 years ago

Your solution worked a treat. Many thanks!

breakds commented 3 years ago

@dsearle: You are welcome!