2021-02-11 08:05:34 -06:00
|
|
|
---
|
|
|
|
# Mine Ethereum with GPU!
|
|
|
|
|
2021-02-11 20:20:51 -06:00
|
|
|
## Dependencies ##
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Install Dependencies
|
2021-02-11 08:05:34 -06:00
|
|
|
package:
|
2021-02-11 12:49:55 -06:00
|
|
|
name:
|
|
|
|
- build-essential
|
|
|
|
- dkms
|
|
|
|
- cmake
|
|
|
|
- perl
|
|
|
|
- libdbus-1-dev
|
|
|
|
- mesa-common-dev
|
2021-02-11 08:05:34 -06:00
|
|
|
state: present
|
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Add PPA
|
2021-02-11 20:13:06 -06:00
|
|
|
apt_repository:
|
|
|
|
repo: ppa:ethereum/ethereum
|
|
|
|
update_cache: yes
|
|
|
|
state: present
|
2021-02-11 08:05:34 -06:00
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Install Ethereum
|
2021-02-11 08:05:34 -06:00
|
|
|
package:
|
|
|
|
name: ethereum
|
|
|
|
state: present
|
|
|
|
|
2021-02-11 20:20:51 -06:00
|
|
|
|
|
|
|
## Test ##
|
|
|
|
- name: Ethminer | Test If Installed
|
|
|
|
shell: "which ethminer"
|
|
|
|
register: ethminer_install
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
2021-02-11 20:39:38 -06:00
|
|
|
## Download ##
|
2021-02-13 06:14:10 -06:00
|
|
|
- name: Ethminer | Create Downloads Folder
|
|
|
|
shell: mkdir -p Downloads
|
|
|
|
args:
|
|
|
|
chdir: /root
|
|
|
|
when: ethminer_install.failed
|
|
|
|
|
2021-02-11 20:47:55 -06:00
|
|
|
- name: Ethminer | Remove Git Repo
|
2021-02-13 06:11:41 -06:00
|
|
|
shell: rm -rf ethminer
|
|
|
|
args:
|
|
|
|
chdir: /root/Downloads
|
2021-02-11 20:47:55 -06:00
|
|
|
ignore_errors: yes
|
|
|
|
when: ethminer_install.failed
|
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Clone Git Repo
|
2021-02-13 06:11:41 -06:00
|
|
|
shell: git clone https://github.com/ethereum-mining/ethminer.git
|
|
|
|
args:
|
|
|
|
chdir: /root/Downloads
|
2021-02-11 20:20:51 -06:00
|
|
|
when: ethminer_install.failed
|
2021-02-11 08:05:34 -06:00
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Update Repo's Repos
|
2021-02-13 06:11:41 -06:00
|
|
|
shell: git submodule update --init --recursive
|
|
|
|
args:
|
|
|
|
chdir: /root/Downloads/ethminer
|
2021-02-11 20:20:51 -06:00
|
|
|
when: ethminer_install.failed
|
2021-02-11 08:05:34 -06:00
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Create Build Folder
|
2021-02-13 06:11:41 -06:00
|
|
|
shell: mkdir -p build
|
|
|
|
args:
|
|
|
|
chdir: /root/Downloads/ethminer
|
2021-02-11 20:20:51 -06:00
|
|
|
when: ethminer_install.failed
|
2021-02-11 08:05:34 -06:00
|
|
|
|
2021-02-12 06:09:57 -06:00
|
|
|
- name: Ethminer | Default Flags
|
|
|
|
set_fact:
|
|
|
|
opencl_flag: "OFF"
|
|
|
|
cuda_flag: "OFF"
|
|
|
|
dbus_flag: "OFF"
|
2021-02-13 05:54:59 -06:00
|
|
|
sys_opencl_flag: "ON"
|
2021-02-12 06:09:57 -06:00
|
|
|
|
|
|
|
- name: Ethminer | Determine OPENCL Flag
|
|
|
|
set_fact:
|
|
|
|
opencl_flag: "ON"
|
2021-02-13 05:54:59 -06:00
|
|
|
sys_opencl_flag: "OFF"
|
2021-02-12 06:09:57 -06:00
|
|
|
when: amdgpu is defined
|
|
|
|
|
|
|
|
- name: Ethminer | Determine CUDA Flag
|
|
|
|
set_fact:
|
|
|
|
cuda_flag: "ON"
|
|
|
|
when: nvidia is defined
|
|
|
|
|
|
|
|
- name: Ethminer | Determine DBUS Flag
|
|
|
|
set_fact:
|
|
|
|
dbus_flag: "ON"
|
|
|
|
when: ansible_distribution == "Pop!_OS"
|
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | cmake Flags
|
2021-02-13 06:16:46 -06:00
|
|
|
shell: "cmake .. -DETHASHCL={{ opencl_flag }} \
|
|
|
|
-DETHASHCUDA={{ cuda_flag }} \
|
|
|
|
-DAPICORE=ON \
|
|
|
|
-DBINKERN=ON \
|
|
|
|
-DETHDBUS={{ dbus_flag }} \
|
|
|
|
-DUSE_SYS_OPENCL={{ sys_opencl_flag }} \
|
|
|
|
-DEVBUILD=ON"
|
2021-02-13 06:11:41 -06:00
|
|
|
args:
|
|
|
|
chdir: /root/Downloads/ethminer/build
|
2021-02-11 20:20:51 -06:00
|
|
|
when: ethminer_install.failed
|
2021-02-11 08:05:34 -06:00
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | cmake Build
|
2021-02-13 06:11:41 -06:00
|
|
|
shell: cmake --build .
|
|
|
|
args:
|
|
|
|
chdir: /root/Downloads/ethminer/build
|
2021-02-11 20:20:51 -06:00
|
|
|
when: ethminer_install.failed
|
2021-02-11 20:13:06 -06:00
|
|
|
|
2021-02-11 20:39:38 -06:00
|
|
|
|
|
|
|
## Install #
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | make install
|
2021-02-13 06:11:41 -06:00
|
|
|
shell: make install
|
2021-02-13 06:14:52 -06:00
|
|
|
args:
|
2021-02-13 06:11:41 -06:00
|
|
|
chdir: /root/Downloads/ethminer/build
|
2021-02-11 20:20:51 -06:00
|
|
|
when: ethminer_install.failed
|
|
|
|
|
2021-02-11 08:05:34 -06:00
|
|
|
|
2021-02-11 20:20:51 -06:00
|
|
|
## Personal Setup ##
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Download Script
|
2021-02-13 06:19:48 -06:00
|
|
|
shell: scp ling@leet:InstallFiles/Miners/ETH/ethminer.sh /home/mfn/
|
|
|
|
|
|
|
|
- name: Ethminer | CHMod Script
|
|
|
|
shell: chmod 755 /home/mfn/ethminer.sh
|