Update names.

This commit is contained in:
Hyperling 2021-03-28 09:47:54 -05:00
parent 208752c871
commit 3aaf04c367
2 changed files with 45 additions and 45 deletions

View File

@ -2,12 +2,12 @@
# Install OpenCL drivers. # Install OpenCL drivers.
## Step 0/3: Dependencies ## ## Step 0/3: Dependencies ##
- name: AMDGPU | Variables - name: Miner | Driver | AMDGPU | Variables
set_fact: set_fact:
amdgpu_cron_job: AMDGPU - Need To Finish Installation amdgpu_cron_job: AMDGPU - Need To Finish Installation
amdgpu_cron_cmd: "{{ root_home.stdout }}/scm.sh" amdgpu_cron_cmd: "{{ root_home.stdout }}/scm.sh"
- name: AMDGPU | Install Dependencies - name: Miner | Driver | AMDGPU | Install Dependencies
package: package:
name: name:
- dkms - dkms
@ -15,7 +15,7 @@
- clinfo - clinfo
state: present state: present
- name: AMDGPU | Set GRUB Timer - name: Miner | Driver | AMDGPU | Set GRUB Timer
lineinfile: lineinfile:
path: /etc/default/grub path: /etc/default/grub
regexp: '^GRUB_TIMEOUT=' regexp: '^GRUB_TIMEOUT='
@ -23,34 +23,34 @@
state: present state: present
backup: yes backup: yes
- name: AMDGPU | Remove Previous Run's Cron Job - name: Miner | Driver | AMDGPU | Remove Previous Run's Cron Job
cron: cron:
user: root user: root
name: "{{ amdgpu_cron_job }}" name: "{{ amdgpu_cron_job }}"
state: absent state: absent
# Tests # Tests
- name: AMDGPU | Check If GA Kernel Installed - name: Miner | Driver | AMDGPU | Check If GA Kernel Installed
shell: 'uname --kernel-release | grep 5.4.0-65-generic' shell: 'uname --kernel-release | grep 5.4.0-65-generic'
register: ga_kernel register: ga_kernel
ignore_errors: yes ignore_errors: yes
- name: AMDGPU | Check If HWE Kernel Installed - name: Miner | Driver | AMDGPU | Check If HWE Kernel Installed
shell: 'apt search linux-image-5.8.0-* | grep -c installed' shell: 'apt search linux-image-5.8.0-* | grep -c installed'
register: hwe_kernel register: hwe_kernel
ignore_errors: yes ignore_errors: yes
#- name: AMDGPU | Check If All Driver Installed #- name: Miner | Driver | AMDGPU | Check If All Driver Installed
# shell: 'which amdgpu-uninstall' # shell: 'which amdgpu-uninstall'
# register: amdgpu_install # register: amdgpu_install
# ignore_errors: yes # ignore_errors: yes
- name: AMDGPU | Check If Pro Driver Installed - name: Miner | Driver | AMDGPU | Check If Pro Driver Installed
shell: 'which amdgpu-pro-uninstall' shell: 'which amdgpu-pro-uninstall'
register: amdgpu_install register: amdgpu_install
ignore_errors: yes ignore_errors: yes
- name: AMDGPU | DEBUG - name: Miner | Driver | AMDGPU | DEBUG
debug: debug:
var: "{{ item }}" var: "{{ item }}"
loop: loop:
@ -61,11 +61,11 @@
## Step 1/3: Get Correct Kernel ## ## Step 1/3: Get Correct Kernel ##
- name: AMDGPU | Install Recommended GA Kernel - name: Miner | Driver | AMDGPU | Install Recommended GA Kernel
shell: apt install --install-recommends linux-generic shell: apt install --install-recommends linux-generic
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
- name: AMDGPU | Install Specific GA Kernel For Booting - name: Miner | Driver | AMDGPU | Install Specific GA Kernel For Booting
package: package:
name: name:
- linux-headers-5.4.0-65 - linux-headers-5.4.0-65
@ -76,7 +76,7 @@
state: present state: present
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
- name: AMDGPU | Prepare GRUB To Boot GA Kernel - name: Miner | Driver | AMDGPU | Prepare GRUB To Boot GA Kernel
lineinfile: lineinfile:
path: /etc/default/grub path: /etc/default/grub
regexp: '^GRUB_DEFAULT=' regexp: '^GRUB_DEFAULT='
@ -85,11 +85,11 @@
backup: yes backup: yes
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
- name: AMDGPU | Update GRUB - name: Miner | Driver | AMDGPU | Update GRUB
shell: update-grub shell: update-grub
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
- name: AMDGPU | Prepare Cron Job To SCM - name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
cron: cron:
user: root user: root
name: "{{ amdgpu_cron_job }}" name: "{{ amdgpu_cron_job }}"
@ -99,7 +99,7 @@
disabled: no disabled: no
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
- name: AMDGPU | Reboot To GA Kernel - name: Miner | Driver | AMDGPU | Reboot To GA Kernel
shell: reboot shell: reboot
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
@ -110,7 +110,7 @@
## Step 2/3: Remove Incorrect Kernels ## ## Step 2/3: Remove Incorrect Kernels ##
- name: AMDGPU | Remove Bad Kernels - name: Miner | Driver | AMDGPU | Remove Bad Kernels
shell: "apt remove --purge linux-generic-hwe-20.04 \ shell: "apt remove --purge linux-generic-hwe-20.04 \
linux-oem-20.04 \ linux-oem-20.04 \
linux-hwe-* \ linux-hwe-* \
@ -120,12 +120,12 @@
linux-modules-5.6.0-*" linux-modules-5.6.0-*"
when: amdgpu_install.failed and hwe_kernel.stdout != "0" when: amdgpu_install.failed and hwe_kernel.stdout != "0"
- name: AMDGPU | Update + Clean System - name: Miner | Driver | AMDGPU | Update + Clean System
shell: "apt update; apt dist-upgrade -y; apt autoremove -y" shell: "apt update; apt dist-upgrade -y; apt autoremove -y"
when: amdgpu_install.failed and hwe_kernel.stdout != "0" when: amdgpu_install.failed and hwe_kernel.stdout != "0"
# This is to ensure we can test adding `apt install --install-recommends linux-generic` later # This is to ensure we can test adding `apt install --install-recommends linux-generic` later
- name: AMDGPU | Boot Default Kernel - name: Miner | Driver | AMDGPU | Boot Default Kernel
lineinfile: lineinfile:
path: /etc/default/grub path: /etc/default/grub
regexp: '^GRUB_DEFAULT=' regexp: '^GRUB_DEFAULT='
@ -134,11 +134,11 @@
backup: yes backup: yes
when: amdgpu_install.failed and hwe_kernel.stdout != "0" when: amdgpu_install.failed and hwe_kernel.stdout != "0"
- name: AMDGPU | Update GRUB - name: Miner | Driver | AMDGPU | Update GRUB
shell: update-grub shell: update-grub
when: amdgpu_install.failed and hwe_kernel.stdout != "0" when: amdgpu_install.failed and hwe_kernel.stdout != "0"
- name: AMDGPU | Prepare Cron Job To SCM - name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
cron: cron:
user: root user: root
name: "{{ amdgpu_cron_job }}" name: "{{ amdgpu_cron_job }}"
@ -149,7 +149,7 @@
when: amdgpu_install.failed and hwe_kernel.stdout != "0" when: amdgpu_install.failed and hwe_kernel.stdout != "0"
# This reboot may not be necessary. # This reboot may not be necessary.
#- name: AMDGPU | Reboot To Ensure GA Is 0 #- name: Miner | Driver | AMDGPU | Reboot To Ensure GA Is 0
# shell: reboot # shell: reboot
# when: amdgpu_install.failed and hwe_kernel.stdout != "0" # when: amdgpu_install.failed and hwe_kernel.stdout != "0"
# #
@ -160,24 +160,24 @@
## Step 3/3: Install AMD PRO Driver ## ## Step 3/3: Install AMD PRO Driver ##
- name: AMDGPU | Download Driver - name: Miner | Driver | AMDGPU | Download Driver
shell: 'scp ling@leet:InstallFiles/Drivers/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz {{ root_home.stdout }}/Downloads/' shell: 'scp ling@leet:InstallFiles/Drivers/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz {{ root_home.stdout }}/Downloads/'
when: amdgpu_install.failed when: amdgpu_install.failed
- name: AMDGPU | Extract Tarball - name: Miner | Driver | AMDGPU | Extract Tarball
shell: 'cd {{ root_home.stdout }}/Downloads; tar -xvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz' shell: 'cd {{ root_home.stdout }}/Downloads; tar -xvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz'
when: amdgpu_install.failed when: amdgpu_install.failed
## Only one driver set can exist at a time! ## ## Only one driver set can exist at a time! ##
#- name: AMDGPU | Install AMDGPU All Driver #- name: Miner | Driver | AMDGPU | Install AMDGPU All Driver
# shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-install -y' # shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-install -y'
# when: amdgpu_install.failed # when: amdgpu_install.failed
- name: AMDGPU | Install AMDGPU-Pro Driver - name: Miner | Driver | AMDGPU | Install AMDGPU-Pro Driver
shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-pro-install -y --opencl=pal,legacy' shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-pro-install -y --opencl=pal,legacy'
when: amdgpu_install.failed when: amdgpu_install.failed
- name: AMDGPU | Prepare Cron Job To SCM - name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
cron: cron:
user: root user: root
name: "{{ amdgpu_cron_job }}" name: "{{ amdgpu_cron_job }}"
@ -187,7 +187,7 @@
disabled: no disabled: no
when: amdgpu_install.failed when: amdgpu_install.failed
- name: AMDGPU | Reboot To GA Kernel - name: Miner | Driver | AMDGPU | Reboot To GA Kernel
shell: reboot shell: reboot
when: amdgpu_install.failed when: amdgpu_install.failed
@ -198,11 +198,11 @@
## We're done! ## ## We're done! ##
- name: AMDGPU | Test Driver - name: Miner | Driver | AMDGPU | Test Driver
shell: clinfo -l shell: clinfo -l
register: clinfo register: clinfo
- name: AMDGPU | Test Results - name: Miner | Driver | AMDGPU | Test Results
debug: debug:
var: clinfo var: clinfo
ignore_errors: yes ignore_errors: yes

View File

@ -2,7 +2,7 @@
# Mine Ethereum with GPU! # Mine Ethereum with GPU!
## Dependencies ## ## Dependencies ##
- name: Ethminer | Install Dependencies - name: Miner | Software | Ethminer | Install Dependencies
package: package:
name: name:
- build-essential - build-essential
@ -13,75 +13,75 @@
- mesa-common-dev - mesa-common-dev
state: present state: present
- name: Ethminer | Add PPA - name: Miner | Software | Ethminer | Add PPA
apt_repository: apt_repository:
repo: ppa:ethereum/ethereum repo: ppa:ethereum/ethereum
update_cache: yes update_cache: yes
state: present state: present
- name: Ethminer | Install Ethereum - name: Miner | Software | Ethminer | Install Ethereum
package: package:
name: ethereum name: ethereum
state: present state: present
## Test ## ## Test ##
- name: Ethminer | Test If Installed - name: Miner | Software | Ethminer | Test If Installed
shell: "which ethminer" shell: "which ethminer"
register: ethminer_install register: ethminer_install
ignore_errors: yes ignore_errors: yes
## Download ## ## Download ##
- name: Ethminer | Remove Git Repo - name: Miner | Software | Ethminer | Remove Git Repo
shell: rm -rf ethminer shell: rm -rf ethminer
args: args:
chdir: "{{ root_home.stdout }}/Downloads" chdir: "{{ root_home.stdout }}/Downloads"
ignore_errors: yes ignore_errors: yes
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | Clone Git Repo - name: Miner | Software | Ethminer | Clone Git Repo
shell: git clone https://github.com/ethereum-mining/ethminer.git shell: git clone https://github.com/ethereum-mining/ethminer.git
args: args:
chdir: "{{ root_home.stdout }}/Downloads" chdir: "{{ root_home.stdout }}/Downloads"
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | Update Repo's Repos - name: Miner | Software | Ethminer | Update Repo's Repos
shell: git submodule update --init --recursive shell: git submodule update --init --recursive
args: args:
chdir: "{{ root_home.stdout }}/Downloads/ethminer" chdir: "{{ root_home.stdout }}/Downloads/ethminer"
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | Create Build Folder - name: Miner | Software | Ethminer | Create Build Folder
shell: mkdir -p build shell: mkdir -p build
args: args:
chdir: "{{ root_home.stdout }}/Downloads/ethminer" chdir: "{{ root_home.stdout }}/Downloads/ethminer"
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | Default Flags - name: Miner | Software | Ethminer | Default Flags
set_fact: set_fact:
opencl_flag: "OFF" opencl_flag: "OFF"
cuda_flag: "OFF" cuda_flag: "OFF"
dbus_flag: "OFF" dbus_flag: "OFF"
sys_opencl_flag: "ON" sys_opencl_flag: "ON"
- name: Ethminer | Determine OPENCL Flag - name: Miner | Software | Ethminer | Determine OPENCL Flag
set_fact: set_fact:
opencl_flag: "ON" opencl_flag: "ON"
sys_opencl_flag: "OFF" sys_opencl_flag: "OFF"
when: amdgpu is defined when: amdgpu is defined
- name: Ethminer | Determine CUDA Flag - name: Miner | Software | Ethminer | Determine CUDA Flag
set_fact: set_fact:
cuda_flag: "ON" cuda_flag: "ON"
when: nvidia is defined when: nvidia is defined
- name: Ethminer | Determine DBUS Flag - name: Miner | Software | Ethminer | Determine DBUS Flag
set_fact: set_fact:
dbus_flag: "ON" dbus_flag: "ON"
when: ansible_distribution == "Pop!_OS" when: ansible_distribution == "Pop!_OS"
- name: Ethminer | cmake Flags - name: Miner | Software | Ethminer | cmake Flags
shell: "cmake .. -DETHASHCL={{ opencl_flag }} \ shell: "cmake .. -DETHASHCL={{ opencl_flag }} \
-DETHASHCUDA={{ cuda_flag }} \ -DETHASHCUDA={{ cuda_flag }} \
-DAPICORE=ON \ -DAPICORE=ON \
@ -93,13 +93,13 @@
chdir: "{{ root_home.stdout }}/Downloads/ethminer/build" chdir: "{{ root_home.stdout }}/Downloads/ethminer/build"
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | cmake Build - name: Miner | Software | Ethminer | cmake Build
shell: cmake --build . shell: cmake --build .
args: args:
chdir: "{{ root_home.stdout }}/Downloads/ethminer/build" chdir: "{{ root_home.stdout }}/Downloads/ethminer/build"
when: ethminer_install.failed when: ethminer_install.failed
- name: Ethminer | make install - name: Miner | Software | Ethminer | make install
shell: make install shell: make install
args: args:
chdir: "{{ root_home.stdout }}/Downloads/ethminer/build" chdir: "{{ root_home.stdout }}/Downloads/ethminer/build"
@ -107,7 +107,7 @@
## Personal Script Setup ## ## Personal Script Setup ##
- name: Ethminer | Script - name: Miner | Software | Ethminer | Script
shell: "{{ item }}" shell: "{{ item }}"
loop: loop:
- "scp ling@leet:InstallFiles/Miners/ethminer/ethminer.sh {{ user_mfn.home }}/" - "scp ling@leet:InstallFiles/Miners/ethminer/ethminer.sh {{ user_mfn.home }}/"