How to Mine Beam MimbleWimble on an AMD RX580 Headless Ubuntu GPU miner
Just updated my AMD RX480 and RX580 miners to mine Beam. The mining application is not available on most packaged mining distributions yet, so I created a custom headless Ubuntu 16.04 build, and this guide to remember how to do it again.
Initial Operating System Setup
Install Ubuntu 16.04 LTS Server after downloading it from a torrent or using the Ubuntu network installer
Do a standard install using all the defaults , include OpenSSH on installation
After install, login with your username and password
Get ip address with
ifconfig
Go to your PC, ssh to the Ubuntu machine, and do the rest of the setup from your PC so you can copy and paste the commands. I prefer to SSH from Bash shell, but Putty is a good client also.
If you are using a Bash shell from Windows or a Linux machine, or terminal from a Mac, make your logins easier in the future by creating a key on your own computer, then placing it on the miner. Do this on your own computer, at the shell prompt:
ssh-keygen -t rsa -b 4096 ssh-copy-id user@server
Type the password for the miner, and that should be it. Now you can login without using a password because your trusted key is installed.
Make things easier
Install some basics
sudo apt update sudo apt -y install vim wget
Change colors in the VIM editor. If you don’t like VIM, use nano instead. Just copy and paste this:
cat <<EOF >> ~/.vimrc :color desert EOF
Improve the bash shell
cat <<EOF >> ~/.bashrc force_color_prompt=yes LS_COLORS=$LS_COLORS:'di=0;36:' ; export LS_COLORS EOF
Upgrade the operating system:
sudo apt -y upgrade && sudo apt -y autoremove
Fix the network so IP address can be changed from DHCP
Not sure why Ubuntu locks one IP address into itself when it first gets an IP address. But it does. So that needs to be changed.
Step 1: Disable the default Firmware inherited names.
Edit your /etc/default/grub
sudo vim /etc/default/grub
Change the line from
GRUB_CMDLINE_LINUX_DEFAULT=””
to
GRUB_CMDLINE_LINUX_DEFAULT="text"
Change the line from
GRUB_CMDLINE_LINUX=””
to
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
make it take effect
sudo update-grub
Step 2: Create the persistent file /etc/udev/rules.d/70-persistent-net.rules as root and fill them.
sudo vim /etc/udev/rules.d/70-persistent-net.rules
Paste this into the new file you just created:
# PCI device lan Device SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:yy:XX:yy:XX:yy", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="ethX" # PCI device Wlan Device SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:yy:XX:yy:XX:yy", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wlanX"
Edit the network interfaces:
sudo vim /etc/network/interfaces
Change device names to eth0 so it reads:
# The primary network interface auto eth0 iface eth0 inet dhcp
Look up your hardware device name (MAC address) with
ifconfig
example:
HWaddr 4c:cc:6a:67:57:07
Go to your DHCP server and map your preferred IP address to the hardware address. You’re on your own for that one. Note that this is entirely optional! You can leave the IP address that was assigned and not change it if you prefer.
REBOOT the system
sudo reboot
SSH to box using the new IP address you assigned in your DHCP server! If you didn’t change it, then it should be at the same address as before. If you can’t find it, login to the terminal at the computer, type
ifconfig
if you only have a loopback address of 127.0.0.1 then run the DHCP client to get an ip address you can ssh to
sudo dhclient
and redo the network fix.
Install X server and Display Manager
Install xorg
sudo apt install xorg xserver-xorg-hwe-16.04 xserver-xorg-dummy-hwe-16.04
Edit the config file for xorg-legacy:
sudo vim /etc/X11/Xwrapper.config
delete the last line:
allowed_users=console
insert at end of file:
allowed_users=anybody needs_root_rights=yes
Create a new file for operating without a monitor connected to box:
sudo vim /etc/X11/xorg.conf
create new file xorg.conf:
Section "ServerLayout" Identifier "X.org Configured" Screen 0 "Screen8" 0 0 EndSection Section "Files" ModulePath "/usr/lib/xorg/modules" FontPath "/usr/share/fonts/X11/misc" FontPath "/usr/share/fonts/X11/cyrillic" FontPath "/usr/share/fonts/X11/100dpi/:unscaled" FontPath "/usr/share/fonts/X11/75dpi/:unscaled" FontPath "/usr/share/fonts/X11/Type1" FontPath "/usr/share/fonts/X11/100dpi" FontPath "/usr/share/fonts/X11/75dpi" FontPath "built-ins" EndSection Section "Device" ### Available Driver options are:- ### Values: <i>: integer, <f>: float, <bool>: "True"/"False", ### <string>: "String", <freq>: "<f> Hz/kHz/MHz", ### <percent>: "<f>%" ### [arg]: arg optional #Option "ShadowFB" # [<bool>] #Option "DefaultRefresh" # [<bool>] #Option "ModeSetClearScreen" # [<bool>] Identifier "Card8" Driver "dummy" VideoRam 16384 EndSection Section "Monitor" Identifier "Monitor8" HorizSync 15.0-100.0 VertRefresh 15.0-200.0 Modeline "1600x900" 33.92 1600 1632 1760 1792 900 921 924 946 EndSection Section "Screen" Identifier "Screen8" Device "Card8" Monitor "Monitor8" SubSection "Display" Viewport 0 0 Depth 24 Virtual 1600 900 EndSubSection EndSection
Make sure X works for user on login – copy and paste this:
cat <<EOF >> ~/.bashrc export DISPLAY=:0 EOF
Change /etc/profile to make it work
sudo vim /etc/profile
# add the following at end of /etc/profile:
export XAUTHORITY=~/.Xauthority
Set variables when user calls X by creating new file .xinitrc:
cat <<EOF > ~/.xinitrc #!/bin/bash DISPLAY=:0 && xterm -geometry +1+1 -n login EOF
Install AMD video driver and SDK
Download these two files from PC to server somehow. I like to use scp, but sftp works also.
AMDGPU-PRO Driver Version 17.40 for Ubuntu 16.04.3
AMD OpenCL SDK 3.0
Install AMD driver
tar xf amdgpu-pro-17.40-492261.tar.xz cd amdgpu-pro-17.40-492261/ sudo ./amdgpu-pro-install
Install AMD SDK (optional – some application need this, others don’t)
tar xf AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2 sudo ./AMD-APP-SDK-v3.0.130.136-GA-linux64.sh
Add user to video group
sudo usermod -a -G video $LOGNAME
Check amdgpu driver status
sudo apt install clinfo sudo clinfo sudo clinfo | grep compute
REBOOT
sudo reboot
Install Beam OpenCL GPU Miner
Make a directory to work in
mkdir beam cd beam
Download the Linux OpenCL GPU miner file from the webpage at https://www.beam.mw/downloads by copying and pasting the link with wget
wget https://builds.beam.mw/mainnet/2019.01.03/Release/linux/opencl-miner-1.0.52.tar.gz
verify the checksum of the file against what is posted on the website
sha256sum opencl-miner-1.0.52.tar.gz
extract it:
tar xf opencl-miner-1.0.52.tar.gz
Create your own mining file – you will need a beam wallet address that does not expire, a rig number, and an alert email address. Copy this text, edit it with your own information, then paste it while in the ~/beam directory. You can use a different beam mining pool also, of course.
cat <<EOF > startbeammining.sh
#!/bin/bash
xinit &
sleep 5
./beam-opencl-miner --server beam-us.leafpool.com:4444 --key 11e8bd588bc9e9bb0426f8e251f72dceb19f1dd4033d55098c89c2768d861ec995.rig1/blockops@nullblockoperations.com
EOF
Make the file executable by typing
chmod +x startbeammining.sh
run the miner to see if it works
./startbeammining.sh
Watch and see if anything breaks. If there is a problem, troubleshoot it and fix it. I recommend doing that by joining the Beam Discord and asking for help in the #mining thread.
If it goes well, great! Go on to the next step which creates a file to start and run the miner on reboot, and keep it running.
echo \ "[Unit] Description=Beam daemon [Service] User=$USER Type=simple WorkingDirectory=$HOME/beam/ ExecStart=$HOME/beam/startbeammining.sh -daemon -pid=$HOME/beam/beam.pid PIDFile=$HOME/beam/beam.pid Restart=always RestartSec=30 [Install] WantedBy=multi-user.target" | sudo tee /lib/systemd/system/beam.service
Start and enable the service by typing
sudo systemctl start beam sudo systemctl enable beam
Make sure the service is running properly by watching the logfile (ctrl-c to exit)
journalctl -fu beam
If you need to stop the mining process for some reason, do it with these two commands
sudo systemctl disable beam sudo systemctl stop beam
That should get things working for you. Best of luck mining beam!
Rolf Versluis
Rodrigo
September 12, 2023 @ 10:00 am
ubuntu 16.04.X???