Donate VRC/VRM for the Wiki to VBzaNDExHyFpnNvYc5QH5e4ipBZqxxPnKJ . Thank you, Joe.

Odroid

From VeriCoin & Verium Wiki
Revision as of 13:01, 6 January 2018 by Joe rondx (Talk | contribs) (Optimized OS Image for Verium Mining)

Jump to: navigation, search

Odroid XU4’s are popular. SBC systems in general are designed to be very power efficient, because of this they are pretty good at Verium mining. The downside is you need a lot of them to amass a sizeable amount of hashes. The up-front cost of SBC’s can be very high, but their power usage is very low. Remember to take into account all the required extras to make SBC’s function. (SD cards, power cables/supplies, network cables, switches, cooling, mounting mechanism, etc…) For SBCs the mining software usually needs to be compiled for 1way using 128 MB per thread. Many devices have been tested in terms of their hashrate and it can fairly be stated that the Odroid platform with its Octa core CPUs (Exynos5422 big.LITTLE) and 2 GB LPDDR3 RAM outperforms any other device. By now Odroid has even released a special version of the original XU4 which is called Odroid HC1 and is designed for clustering. It should be noted that despite their relative low total hasrate the ration hashrate per energy is still good. Also, there is software out in the community that helps on the maintenance of large clusters. For more information visit the official Odroid Website.

Optimized OS Image for Verium Mining

The ODROID Verium Mining Image (by joe_rondx) includes an optimized OS with preinstalled miner and several other handy features. It is made for the XU4 line, that is Odroid XU4, XU4Q, HC1, MC1.

Performance features:

  • hugepages are enabled (thanks to birty & fireworm)
  • Maximal RAM clocking: 933 MHz
  • CPU downclocking of big cores: 1.9 GHz (read here why 2 GHz is not worth it)
  • Optimal two miners configuration for big.LITTLE cores.

Helper scripts:

  • Temperature logging in verium/cpu_temp.log
  • Status overview script vrmcheck.sh

Setup the Image

  1. Download the Image.
  2. Burn it without extracting it (because it's 2 partitions)
  3. On first bootup give it 5-10 mins time until you should be able to find the device in the network.
  4. Log in with standard root/odroid

Configuration of the Image

The first thing you want to do is the configuration of the miner. The autostart of the miner is currently done in the rc.local file.

 nano /etc/rc.local 

At the end you will find two mining commands which you need to adjust for your pool/solo setup.

In addition to the miner configuration you might want to change the hostname and password:

 nano /etc/hostname
 nano /etc/hosts
 passwd

Reboot before going on

 reboot

XU4 & XU4Q Tipps

Since the image was created on an HC1 you might want to check the GPU setting.

Usage and Monitoring

There is a simple status script in the home directory, call

 ./vrmcheck.sh

which prints out the configuration in rc.local, the last 10 lines of each miner log, CPU frequency and the current temperature.

Monitoring both miners is a bit of a challenge, but DerrickEs minerMonitor scripts support the configuration of ports (4048 & 4049 in this case). I also recommend mining on two pool to decentralize the hasrate, keep some hashes going if one pool is down and also for monitoring.

Other OS Images

Let's start with special images by Odroid God birty: Odroid Miner images In particular the newest image with enabled hugepages in combination with fireworms miner gives a significant boost of hashrate. It was used for the optimized image.

Odroids Official Images are of course very well made. The newest Ubuntu Mate 16.04.3 (20171212) which was release after birtys image even has hugepages enabled. But unfortunately it uses too much RAM. Even more unfortunate is, that the Ubuntu 16.04.3 (20171213) (MINIMAL, BARE OS) image doesn't have hugepages enabled.

I have once tested like 6 different images that are available for the XU4 platform.

For the beginning I recommend the DietPi image because its included diet-config tool already supports lots of the configurations you want to set. Direct Link to image

The performance of Armbians headless 3.x kernel was very good before the hugepages option was available.

Tweaking the OS for Mining

The whole thing as a script (ARM Miner + XU4 Setup): Download Shell script

 wget https://github.com/DJoeDt/verium/raw/master/1wayARM_XU4_VeriumMiner_install.sh
 chmod +x 1wayARM_XU4_VeriumMiner_install.sh
 ./1wayARM_XU4_VeriumMiner_install.sh

Downclocking (yes, down!) the CPU

To prevent throttleing due to heat it may actually increase your hashrate if the CPU doesn't run at 2 GHz (max). Even if you can prevent throttleing at 2GHz it is anyhow now worth it: you might get 10-15 H/m more but it costs about 2 Watts (out of 12) to get this last increase - so it won't pay back, for Details: HC1 power benchmark.

Install the utility (or use DietPi config)

 sudo apt-get install cpufrequtils

use it directly

 sudo cpufreq-set -c 7 -u 1.9GHz -r

and make the change permanent by creating a config file

 sudo nano /etc/default/cpufrequtils 

with the following settings

 ENABLE="true"
 GOVERNOR="performance"
 MAX_SPEED=1900000
 MIN_SPEED=1900000

Now the CPU should always run at constant speed. This also saves a reasonable amount of power.

Overclocking the RAM

On the boot-FAT-Partition edit the boot.ini

 sudo nano boot.ini

Find

 ddr_freq

and change the value to 933

 # DRAM Frequency
 # Sets the LPDDR3 memory frequency
 # Supported values: 933 825 728 633 (MHZ)
 setenv ddr_freq 933

Make sure before bootz to

 # set DDR frequency
 dmc ${ddr_freq}  
 

Downclocking the GPU

Install this utility

 sudo apt-get install sysfsutils
 

Then edit

 sudo nano /etc/sysfs.conf
 

and insert the following line

 # Put GPU into powersave mode (= Downclocking it)
 devices/platform/11800000.mali\:/devfreq/11800000.mali\:/governor = powersave
 

then start the service

 sudo service sysfsutils start

Effect: reduced the power consumption by 0.7 – 0.8W, SOC will be 1-3°C cooler

GPU for headless

Another way might be

 sudo nano /etc/rc.local

and add this line before exit 0

 echo powersave > /sys/devices/platform/11800000.mali\:/devfreq/11800000.mali\:/governor

Settingn up a Swapfile

Verium is memory intensive, so we increase the swap file (or use DieuPi config)

 sudo fallocate -l 1G /var/swapfile
 sudo chmod 600 /var/swapfile
 sudo mkswap /var/swapfile
 sudo swapon /var/swapfile

check it with

 free -h

and configure that permanently

 sudo echo "/var/swapfile    none    swap    sw    0    0" >> /etc/fstab

Processes

Further optimization can be done by checking the process tree

 pstree -p

and disable/deinstall stuff that isn't needed. KILL 'EM ALL!

I did not find it yet but if you come across ads7846 remove it.

 modprobe -r ads7846
 tee /etc/modprobe.d/blacklist-ads7846.conf <<< "ads7846"

XU4 hardware

The key is to exchange the thermal tape of the heatsink with some good thermal paste, decreases the temperature by 10 degrees (C) using same testing conditions. Also get the under side cooled as well.

To save electricity you may turn down the power supplies voltage with a screw driver.

Check sd card slot heat.

Optimal big.LITTLE and Maximal RAM Usage

aka "Getting the last Hash out of your Odroid".

The first step is to use an OS image that uses a minimum amount of RAM for the system.

To illustrate how to use the big.LITTLE cores and most of the memory we first have a look at the configuration with effectstocause miner.

The Goal

Verium mining is a lot about RAM, so you want to maximize the memory usage.

 How does that work?

The [veriumMiner] can be configured to use a different amount of RAM per thread. So the idea is to use 2 different miner compilations and make use of the 2GB LPDDR3 RAM @ 933Mhz the Odroid has.

Plus: do that wisely to also benefit from the big.LITTLE cores of the Samsung Exynos5422 Cortex™ ARM Cortex-A15 (2.0Ghz) / Cortex-A7 (1.4 Ghz) Octa core CPUs

Technical details

The miner settings are called 1 way or 3 way (or Nway) where

 1 way => 128 MB   per mining thread 
 3 way => 384 MB   per mining thread 

The #way of the miner is configured in

 nano veriumMiner/algo/scrypt.c

Now you can calculate around for yourself or just trust me that you want those two miner configurations and then run

 5 threads @ 1 way =  640 MB 
 3 threads @ 3 way = 1152 MB  
                     1792 MB total RAM

The system needs some memory, too and with this setting there is only around 60 MB left free - but only if you use the image linked above ( I have tested 6 different ones, only this works with -t 5 & -t 3 ).

A 2 way compilation might be interesting as well, but my compilation try didn't work (only boooo's).

Easy Installation

I have prepared two scripts on my [git repository] (no warranty whatsoever)

 * 1wayARM_XU4_VeriumMiner_install.sh
 * 3wayARM_XU4_VeriumMiner_install.sh

which install the miners into

 ~/verium/1wayminer/
 ~/verium/3wayminer/

How to run them

Having both compilations at hand we need to manage them properly. Besides the threads there are two things to configure

 # the big.little core
 # the API Port

big cores -t 3

Thy big cores shall run the 3 way miner on the standard port 4048 with high priority

 --cpu-priority 4
 --cpu-affinity 0x00F0 
 -b 4048
 --api-bind 0.0.0.0:4048

those are the options to be set. About using cpu-affinity.

This is the complete line from my /etc/rc.local

 # 3way -t 3 big
 /root/verium/3wayminer/cpuminer -o stratum+tcp://pool-eu.bloxstor.com:3003 -u VEXMki29ycW5vSt3MmdM5iwHqsHux91EMr.Guide -p GuidePwd --cpu-priority 4 -t 3 --cpu-affinity 0x00FF --api-bind 0.0.0.0:4048 &

Just copy it and give it a try as donation ;) .

little cores -t 5

The little core shall run the 1 way miner on API Port 4049 with lower priority

 --cpu-priority 1
 -b 4049
 --api-bind 0.0.0.0:4049

where I just don't touch --cpu-affinity and thus the remaining 4 little + 1 big cores are used.

This is the complete line from my /etc/rc.local

 # 1way -t 5 little
 /root/verium/1wayminer/cpuminer -o stratum+tcp://pool-eu.bloxstor.com:3003 -u VEXMki29ycW5vSt3MmdM5iwHqsHux91EMr.Guide -p GuidePwd --cpu-priority 1 -t 5 -b 4049 --api-bind 0.0.0.0:4049 &

Monitoring

If you use the API you need to configure both ports. My workaround with birtys <3 webscripts looks like this:

So far I have copied index_monitor.php to index_monitor4049.php, reconfigured

 defined('API_PORT') || define('API_PORT', 4049);

in it, and just included it by adding

 <?php include 'index_monitor4049.php';?>

to the index.php.

The Result

Some remarks before we look at H/m:

  1. again: only the image linked above worked for me, but not even by default
  2. you still have to create a swap file (included in my scripts)
  3. I lied about the lines in my rc.local, I actually mine on two different pools. Decentralize it! ;)

Hashrate Numbers!!11

Originally I ran birtys miner configuration which actually is the 1 way configuration. Without any -t option it just starts 8 threads and with pool mining i got an average of

 395 H/m   = 1 way -t 8

The two miners put out like

 195 H/m   = 1 way -t 5
 250 H/m   = 3 way -t 3

Happy adding! :)

I wonder how this performs when solo mining?

Update to fireworm miner & hugepages

Setup: birtys hugepages minimal image: [drive]

 sudo nano /etc/sysctl.conf
 vm.nr_hugepages=579

Change host, dram_freq=933 & pwd

 nano /etc/hostname
 nano /etc/hosts
 nano /media/boot/boot.ini
 passwd

Reboot before going on

 reboot

Install 3way miner

 wget https://github.com/DJoeDt/verium/raw/master/3wayARM_HC1_fireworm_install.sh
 chmod +x 3wayARM_HC1_fireworm_install.sh
 ./3wayARM_HC1_fireworm_install.sh

Get names right:

 mv veriumMiner/ verium/1wayminer/

Autostart config

 nano /etc/rc.local
 
nice --15 /root/verium/3wayminer/cpuminer -o stratum+tcp://eu.vrm.mining-pool.ovh:3032 -u joe_rondx.HC1 -p verium --cpu-priority 1 -t 3 --cpu-affinity 0x00F0 --api-bind 0.0.0.0:4048 --no-color >> /root/verium/3wayminer/mine.log &

sleep 5

nice --5 /root/verium/1wayminer/cpuminer -o stratum+tcp://pool-eu.bloxstor.com:3003 -u VEXMki29ycW5vSt3MmdM5iwHqsHux91EMr.Guide -p Guidepwd --cpu-priority 0 -t 5 --api-bind 0.0.0.0:4049 -b 4049 --no-color >> /root/verium/1wayminer/mine.log &
  

Run

 -t 3 on 3way

first !! First because it should make use of hugepages.

Secondly run

 -t 5 on 1way

which runs without hugepages