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-11 20:47:55 -06:00
|
|
|
- name: Ethminer | Remove Git Repo
|
|
|
|
shell: 'cd /root/Downloads; rm -rf ethminer'
|
|
|
|
ignore_errors: yes
|
|
|
|
when: ethminer_install.failed
|
|
|
|
|
2021-02-11 12:12:52 -06:00
|
|
|
- name: Ethminer | Clone Git Repo
|
2021-02-11 20:39:38 -06:00
|
|
|
shell: 'cd /root/Downloads; git clone https://github.com/ethereum-mining/ethminer.git'
|
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-11 20:39:38 -06:00
|
|
|
shell: 'cd /root/Downloads/ethminer; git submodule update --init --recursive'
|
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-11 20:39:38 -06:00
|
|
|
shell: 'cd /root/Downloads/ethminer; mkdir -p build'
|
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 05:54:59 -06:00
|
|
|
shell: 'cd /root/Downloads/ethminer/build; cmake .. -DETHASHCL={{ opencl_flag }} -DETHASHCUDA={{ cuda_flag }} -DAPICORE=ON -DBINKERN=ON -DETHDBUS={{ dbus_flag }} -DUSE_SYS_OPENCL={{ sys_opencl_flag }} -DEVBUILD=ON'
|
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-11 20:39:38 -06:00
|
|
|
shell: 'cd /root/Downloads/ethminer/build; cmake --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-11 20:39:38 -06:00
|
|
|
shell: 'cd /root/Downloads/ethminer/build; make install'
|
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-11 20:39:38 -06:00
|
|
|
shell: 'scp ling@leet:InstallFiles/Miners/ETH/ethminer.sh /home/mfn/; chmod 755 /home/mfn/ethminer.sh'
|