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

93 lines
2.3 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 ##
- 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
shell: 'cd /root/Downloads; git clone https://github.com/ethereum-mining/ethminer.git'
when: ethminer_install.failed
2021-02-11 12:12:52 -06:00
- name: Ethminer | Update Repo's Repos
shell: 'cd /root/Downloads/ethminer; git submodule update --init --recursive'
when: ethminer_install.failed
2021-02-11 12:12:52 -06:00
- name: Ethminer | Create Build Folder
shell: 'cd /root/Downloads/ethminer; mkdir -p build'
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
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'
when: ethminer_install.failed
2021-02-11 12:12:52 -06:00
- name: Ethminer | cmake Build
shell: 'cd /root/Downloads/ethminer/build; cmake --build .'
when: ethminer_install.failed
2021-02-11 20:13:06 -06:00
## Install #
2021-02-11 12:12:52 -06:00
- name: Ethminer | make install
shell: 'cd /root/Downloads/ethminer/build; make install'
when: ethminer_install.failed
## Personal Setup ##
2021-02-11 12:12:52 -06:00
- name: Ethminer | Download Script
shell: 'scp ling@leet:InstallFiles/Miners/ETH/ethminer.sh /home/mfn/; chmod 755 /home/mfn/ethminer.sh'