Giter Site home page Giter Site logo

amdgpu-xmr-eth-mining-ubuntu's Introduction

AMD RX 480/570/580 Mining on Ubuntu Server 18.04 LTS

Install Ubuntu Server with the HWE kernel

Sudoers file, enable NOPASSWD for user, all commands

sudo visudo

Replace %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 locales

Upgrade

sudo apt update && sudo apt upgrade

If 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 upgrade

Install packages (optional)

sudo apt install mc vim htop lshw

Disable screensaver, AMD tweaks, fall back to ethX network interface naming

Edit the grub configuration file:

sudo vi /etc/default/grub

Replace 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 all

Edit network configuration file:

sudo vi /etc/network/interfaces

Replace enpXsX to eth0

# The primary network interface
auto eth0
iface eth0 inet dhcp
sudo reboot

Install AMDGPU Driver + OpenCL + ROCm

https://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-dev

If 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 --headless

Add yourself to the video group

sudo usermod -a -G video $LOGNAME

Check your graphic card name and chipset

sudo update-pciids
lspci -nn | grep -E 'VGA|Display'

AMDGPU commands (clinfo ...)

Edit your .profile

vi ~/.profile

and add amdgpu-pro PATH to new line

PATH="/opt/amdgpu-pro/bin:$PATH"

Tuning

Save Bios

sudo ./atiflash -s 0 CARD-NAME.rom

How To Mod Bios 470/570/480/580/VEGA on windows

https://bitcointalk.org/index.php?topic=1954245.0

Download Polaris Bios Editor

https://github.com/jaschaknack/PolarisBiosEditor

One Click Timing Patch

Flash Bios Mod

sudo ./amdvbflash -p 0 CARD-NAME.rom

Get GDDR5 memory information and other information from AMD Radeon GPUs.

sudo apt install opencl-headers libpci-dev
git clone https://github.com/ystarnaud/amdmeminfo
cd amdmeminfo
make
sudo ./amdmeminfo -o -s

Hard reboot

https://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.

Install miners

Download mining.sh and replace user with your username

chmod +x mining.sh

Open crontab file crontab -e and add this line and change user to your username

@reboot /home/user/mining.sh

Mining start after boot

sudo reboot

Enter the tmux session

tmux a

amdgpu-xmr-eth-mining-ubuntu's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

amdgpu-xmr-eth-mining-ubuntu's Issues

GPU install

I am trying to use 6 msi rx 570s on miner. At what point during installation should I connect GPUs to the motherboard with PCIe risers? Iโ€™m having trouble booting into Ubuntu when I connect one GPU.

OpenCL error

Hi,

Thank you for the tutorial.

I'm trying to install AMD drivers on Ubuntu 18.04 LTS. Everything is installing without errors, but there is something wrong with OpenCL. After installation I'm trying to run clinfo, but I get ERROR: clGetDeviceIDs(-1):

# /opt/amdgpu-pro/bin/clinfo 
Number of platforms:				 2
  Platform Profile:				 FULL_PROFILE
  Platform Version:				 OpenCL 2.1 AMD-APP (2906.7)
  Platform Name:				 AMD Accelerated Parallel Processing
  Platform Vendor:				 Advanced Micro Devices, Inc.
  Platform Extensions:				 cl_khr_icd cl_amd_event_callback cl_amd_offline_devices 
  Platform Profile:				 FULL_PROFILE
  Platform Version:				 OpenCL 1.2 CUDA 10.2.97
  Platform Name:				 NVIDIA CUDA
  Platform Vendor:				 NVIDIA Corporation
  Platform Extensions:				 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics

  Platform Name:				 AMD Accelerated Parallel Processing
ERROR: clGetDeviceIDs(-1)

Also Claymore miner does not see my RX 470 GPU.

# dpkg --get-selections |grep opencl
libopencl1-amdgpu-pro:amd64			install
opencl-amdgpu-pro				install
opencl-amdgpu-pro-comgr				install
opencl-amdgpu-pro-dev				install
opencl-amdgpu-pro-icd				install
opencl-orca-amdgpu-pro-icd:amd64		install
# lspci -k | grep -EA3 'VGA|3D|Display'
01:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 3GB] (rev a1)
	Subsystem: Device 7377:0000
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
--
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X] (rev cf)
	Subsystem: Gigabyte Technology Co., Ltd Ellesmere [Radeon RX 470/480/570/580]
	Kernel modules: amdgpu
02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 580]

Have you faced with similar error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.