Sudoers file, enable NOPASSWD for user, all commands
sudo visudoReplace %sudo ALL=(ALL:ALL) ALL line to %sudo ALL=(ALL:ALL) NOPASSWD: ALL
Locale fix
sudo locale-gen en_US en_US.UTF-8 hu_HU hu_HU.UTF-8
sudo dpkg-reconfigure localesUpgrade
sudo apt update && sudo apt upgradeIf you use default Kernel during installation to install Ubuntu Server. You need install Ubuntu HWE stack package.
https://help.ubuntu.com/community/AMDGPU-Driver https://wiki.ubuntu.com/Kernel/LTSEnablementStack
sudo apt update
sudo apt install --install-recommends linux-generic-hwe-18.04
sudo apt upgradesudo apt install mc vim htop lshwEdit the grub configuration file:
sudo vi /etc/default/grubReplace GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX lines
GRUB_CMDLINE_LINUX_DEFAULT="text amdgpu.dc=0 amdgpu.ppfeaturemask=0xffffffff"
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"amdgpu.ppfeaturemask=0xffffffff kernel boot option allows control of GPU power states (GPU / VRAM clocks and voltages)
Update grub configuration
sudo update-grub && sudo update-grub2 && sudo update-grub-legacy-ec2 && sudo update-initramfs -u -k allEdit network configuration file:
sudo vi /etc/network/interfacesReplace enpXsX to eth0
# The primary network interface
auto eth0
iface eth0 inet dhcpsudo reboothttps://www.amd.com/en/support/kb/release-notes/rn-rad-lin-19-50-unified
wget https://drivers.amd.com/drivers/linux/19.50/amdgpu-pro-19.50-967956-ubuntu-18.04.tar.xz --referer http://support.amd.com/en-us/kb-articles/Pages/Radeon-Software-for-Linux-Release-Notes.aspx
tar -Jxvf amdgpu-pro-19.50-967956-ubuntu-18.04.tar.xz
cd amdgpu-pro-19.50-967956-ubuntu-18.04
./amdgpu-pro-install -y --opencl=pal,legacy --headless
sudo apt install amdgpu-dkms libdrm-amdgpu-amdgpu1 libdrm2-amdgpu opencl-amdgpu-pro opencl-amdgpu-pro-devIf dpkg: error processing archive /var/opt/amdgpu-pro-local
for amdgpupkg in $(dpkg --list | grep amdgpu-pro | awk '{print $2}'); do echo $amdgpupkg; sudo dpkg --purge --force-all $amdgpupkg; done
for amdgpupkg in $(dpkg --list | grep amdgpu | awk '{print $2}'); do echo $amdgpupkg; sudo dpkg --purge --force-all $amdgpupkg; done
sudo apt-get -f install
./amdgpu-pro-install -y --opencl=pal,legacy --headlessAdd yourself to the video group
sudo usermod -a -G video $LOGNAMEsudo update-pciids
lspci -nn | grep -E 'VGA|Display'Edit your .profile
vi ~/.profileand add amdgpu-pro PATH to new line
PATH="/opt/amdgpu-pro/bin:$PATH"sudo ./atiflash -s 0 CARD-NAME.romhttps://bitcointalk.org/index.php?topic=1954245.0
Download Polaris Bios Editor
https://github.com/jaschaknack/PolarisBiosEditor
One Click Timing Patch
sudo ./amdvbflash -p 0 CARD-NAME.romsudo apt install opencl-headers libpci-dev
git clone https://github.com/ystarnaud/amdmeminfo
cd amdmeminfo
make
sudo ./amdmeminfo -o -shttps://askubuntu.com/questions/491146/terminal-commands-to-hard-shutdown-and-hard-restart?answertab=votes#tab-top
It would be safer to do a Alt+SysRq+(R,E,I,S,U,B or O) than force a hard reboot.
- R Switch the keyboard from raw mode to XLATE mode
- E SIGTERM everything except init
- I SIGKILL everything except init
- S Syncs the mounted filesystems
- U Remounts the mounted filesystems in read-only mode
- B Reboot the system, or O Turn off the system
You could just Alt+SysRq+B/O to reboot/halt if you really wanted to but you put your filesystems at risk by doing so. Doing all of the above is relatively safe and should work even when the rest of the system has broken down.
This is essentially the same method you're talking about in your commands but I'm not sure you could script the E and I (as they'll nuke your terminal access). But you could definitely handle the disk access and reboot or shutdown.
for i in s u b; do echo $i | sudo tee /proc/sysrq-trigger; sleep 5; done # reboot
for i in s u o; do echo $i | sudo tee /proc/sysrq-trigger; sleep 5; done # halt
You could still lose data from running applications but it shoudn't knacker your filesystem. If you have particularly huge disk write caches it might be best to increase the sleep value.
Download mining.sh and replace user with your username
chmod +x mining.shOpen crontab file crontab -e and add this line and change user to your username
@reboot /home/user/mining.shMining start after boot
sudo rebootEnter the tmux session
tmux a