Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ubuntu-bash-mining

ubuntu-bash-mining is a set of bash scripts examples to simplify automatization for mining of cryptocurrency. In this repo example for ethminer tool used (for building instructions please visit original repo, but some brief instructions you can find in this Readme file).

Why are these scripts useful

  • Complete example script for starting mining ETH in linux's SCREEN
  • Complete example script for connect with mining pool (for nanopool)
  • Example of bash script for checking if mining already run, and start if not
  • Example of bash script for stop mining if specific ubuntu users are logged in, and start when logged out
  • Using sheduling in CRON

Usage

  1. Open start_mining.sh script and change field [etherium address] to your real etherium address
  2. Open check_mining.sh script and set actual script path to variable SCRIPT_START_MINE
  3. Run command:
$ echo $PATH

Then get this value and set to variable PATH from script check_users.sh 4. Set needed list of users into variable USERS in script check_users.sh. Mining will stop when one of these users is logged in. Also, set actual paths for variables SCRIPT_CHECK and SCRIPT_STOP 5. Change mode for all bash scripts:

$ chmod +x start_mining.sh
$ chmod +x stop_mining.sh
$ chmod +x check_mining.sh
$ chmod +x check_users.sh
  1. Open crontab:
$ crontab -e

and set your shedule for checking. If you want checking status of mining no matter what user is in the system, then add this line to crontab (script check_users.sh will not be used):

* * * * * [ubuntu-bash-mining]/check_mining.sh

Else, if you want to use stop-list of users:

* * * * * [ubuntu-bash-mining]/check_users.sh

Checked configurations

  • Ubuntu 16.04 + NVidia GTX 1060 6GB + CUDA 9.2 + NVidia driver ver: 396.37
  • Ubuntu 20.04 + Nvidia GTX 1070 8GB + CUDA 11.2 + NVidia driver ver: 460.39
  • Ubuntu 16.04 + Nvidia RTX 2070 Super + CUDA 10.2 + NVidia driver ver: 440.64.00
  • Ubuntu 16.04 + NVidia Tesla P40 24GB + Nvdia Tesla P100 16GB + CUDA 11.2 + NVidia driver ver: 460.32.03
  • Ubuntu 16.04 + Radeon RX 580 8 GB + amdgpu-pro-17.40-483984

How to build ethminer for using with CUDA

  1. Install nvidia driver and CUDA toolkit. Choose versions which fit your GPU model. This step is beyond the scope of this manual, it is better to use the original instructions from the NVidia site
  2. Install mesa library:
$ sudo apt-get install git mesa-common-dev cmake
  1. Download and build ethminer:
$ git clone https://github.com/ethereum-mining/ethminer.git
$ cd ethminer
$ git submodule update --init --recursive
$ mkdir build 
$ cd build
$ cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF -DETHSTRATUM=ON
  1. Install ethminer:
$ sudo make install

How to build ethminer for Radeon RX 580 8GB

  1. Check availability of graphic card:
$ lspci | grep VGA

My output:

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X] (rev e7)

Use this manual if you need to remove previous drivers installations

  1. Use this link to get installations details from official site

  2. Installation (get from this)

$ tar -Jxvf amdgpu-pro-17.40-483984.tar.xz
$ cd amdgpu-pro-17.40-483984
$ ./amdgpu-pro-install -y --compute
  1. Install OpenCL ICD (installable client driver) and mesa:
$ apt-get install opencv-amdgpu-pro-icd
$ apt-get install git mesa-common-dev cmake
  1. Download and install ethminer:
$ git clone https://github.com/ethereum-mining/ethminer.git
$ cd ethminer
$ git submodule update --init --recursive
$ mkdir build; cd build
$ cmake .. -DETHASHCUDA=OFF -DETHASHCL=ON
$ cmake --build . -- j4 # may be skip this step - don't remember
$ sudo make install

About

Bash scripts to automate process of mining on ubuntu using ethminer tool, nanopool and crontab

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages