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.
## Step 0/3: Dependencies ##
- name: AMDGPU | Variables
- name: Miner | Driver | AMDGPU | Variables
set_fact:
amdgpu_cron_job: AMDGPU - Need To Finish Installation
amdgpu_cron_cmd: "{{ root_home.stdout }}/scm.sh"
- name: AMDGPU | Install Dependencies
- name: Miner | Driver | AMDGPU | Install Dependencies
package:
name:
- dkms
@ -15,7 +15,7 @@
- clinfo
state: present
- name: AMDGPU | Set GRUB Timer
- name: Miner | Driver | AMDGPU | Set GRUB Timer
lineinfile:
path: /etc/default/grub
regexp: '^GRUB_TIMEOUT='
@ -23,34 +23,34 @@
state: present
backup: yes
- name: AMDGPU | Remove Previous Run's Cron Job
- name: Miner | Driver | AMDGPU | Remove Previous Run's Cron Job
cron:
user: root
name: "{{ amdgpu_cron_job }}"
state: absent
# 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'
register: ga_kernel
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'
register: hwe_kernel
ignore_errors: yes
#- name: AMDGPU | Check If All Driver Installed
#- name: Miner | Driver | AMDGPU | Check If All Driver Installed
# shell: 'which amdgpu-uninstall'
# register: amdgpu_install
# ignore_errors: yes
- name: AMDGPU | Check If Pro Driver Installed
- name: Miner | Driver | AMDGPU | Check If Pro Driver Installed
shell: 'which amdgpu-pro-uninstall'
register: amdgpu_install
ignore_errors: yes
- name: AMDGPU | DEBUG
- name: Miner | Driver | AMDGPU | DEBUG
debug:
var: "{{ item }}"
loop:
@ -61,11 +61,11 @@
## 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
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:
name:
- linux-headers-5.4.0-65
@ -76,7 +76,7 @@
state: present
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:
path: /etc/default/grub
regexp: '^GRUB_DEFAULT='
@ -85,11 +85,11 @@
backup: yes
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
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:
user: root
name: "{{ amdgpu_cron_job }}"
@ -99,7 +99,7 @@
disabled: no
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
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
@ -110,7 +110,7 @@
## 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 \
linux-oem-20.04 \
linux-hwe-* \
@ -120,12 +120,12 @@
linux-modules-5.6.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"
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
# 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:
path: /etc/default/grub
regexp: '^GRUB_DEFAULT='
@ -134,11 +134,11 @@
backup: yes
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
- name: AMDGPU | Update GRUB
- name: Miner | Driver | AMDGPU | Update GRUB
shell: update-grub
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:
user: root
name: "{{ amdgpu_cron_job }}"
@ -149,7 +149,7 @@
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
# 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
# when: amdgpu_install.failed and hwe_kernel.stdout != "0"
#
@ -160,24 +160,24 @@
## 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/'
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'
when: amdgpu_install.failed
## 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'
# 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'
when: amdgpu_install.failed
- name: AMDGPU | Prepare Cron Job To SCM
- name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
cron:
user: root
name: "{{ amdgpu_cron_job }}"
@ -187,7 +187,7 @@
disabled: no
when: amdgpu_install.failed
- name: AMDGPU | Reboot To GA Kernel
- name: Miner | Driver | AMDGPU | Reboot To GA Kernel
shell: reboot
when: amdgpu_install.failed
@ -198,11 +198,11 @@
## We're done! ##
- name: AMDGPU | Test Driver
- name: Miner | Driver | AMDGPU | Test Driver
shell: clinfo -l
register: clinfo
- name: AMDGPU | Test Results
- name: Miner | Driver | AMDGPU | Test Results
debug:
var: clinfo
ignore_errors: yes

View File

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