env-ansible/tasks/miner/gpu/ethminer.yml

120 lines
2.7 KiB
YAML
Raw Normal View History

---
# Mine Ethereum with GPU!
## Dependencies ##
2021-02-11 12:12:52 -06:00
- name: Ethminer | Install Dependencies
package:
2021-02-11 12:49:55 -06:00
name:
- build-essential
- dkms
- cmake
- perl
- libdbus-1-dev
- mesa-common-dev
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 12:12:52 -06:00
- name: Ethminer | Install Ethereum
package:
name: ethereum
state: present
## Test ##
- name: Ethminer | Test If Installed
shell: "which ethminer"
register: ethminer_install
ignore_errors: yes
## 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
- name: Ethminer | Remove Git Repo
shell: rm -rf ethminer
args:
chdir: /root/Downloads
ignore_errors: yes
when: ethminer_install.failed
2021-02-11 12:12:52 -06:00
- name: Ethminer | Clone Git Repo
shell: git clone https://github.com/ethereum-mining/ethminer.git
args:
chdir: /root/Downloads
when: ethminer_install.failed
2021-02-11 12:12:52 -06:00
- name: Ethminer | Update Repo's Repos
shell: git submodule update --init --recursive
args:
chdir: /root/Downloads/ethminer
when: ethminer_install.failed
2021-02-11 12:12:52 -06:00
- name: Ethminer | Create Build Folder
shell: mkdir -p build
args:
chdir: /root/Downloads/ethminer
when: ethminer_install.failed
- name: Ethminer | Default Flags
set_fact:
opencl_flag: "OFF"
cuda_flag: "OFF"
dbus_flag: "OFF"
sys_opencl_flag: "ON"
- name: Ethminer | Determine OPENCL Flag
set_fact:
opencl_flag: "ON"
sys_opencl_flag: "OFF"
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"
args:
chdir: /root/Downloads/ethminer/build
when: ethminer_install.failed
2021-02-11 12:12:52 -06:00
- name: Ethminer | cmake Build
shell: cmake --build .
args:
chdir: /root/Downloads/ethminer/build
when: ethminer_install.failed
2021-02-11 20:13:06 -06:00
2021-02-11 12:12:52 -06:00
- name: Ethminer | make install
shell: make install
2021-02-13 06:14:52 -06:00
args:
chdir: /root/Downloads/ethminer/build
when: ethminer_install.failed
2021-02-13 07:12:44 -06:00
## Personal Script Setup ##
2021-02-11 12:12:52 -06:00
- name: Ethminer | Download Script
2021-02-13 18:57:51 -06:00
shell: scp ling@leet:InstallFiles/Miners/ethminer/ethminer.sh /home/mfn/
2021-02-13 06:19:48 -06:00
- name: Ethminer | CHMod Script
shell: chmod 755 /home/mfn/ethminer.sh