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

Difference between revisions of "Odroid"

From VeriCoin & Verium Wiki
Jump to: navigation, search
(Power to the Rig)
Line 263: Line 263:
to the index.php.
to the index.php.
More information on monitoring can be found [ here] and [ here].
More information on monitoring can be found [ here].
=== The Result ===
=== The Result ===

Revision as of 15:11, 13 March 2018

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

Odroid startup.png

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, HC2, 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
  • Filesystem expansion by
Odroid burn.png

Setup the Image

  1. Download the Image.
  2. Burn it without extracting it (The real issue is the following: the image consists of two partitions, if you extract the gz file you have to make sure you burn both partitions and not only the fat partition.)
  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

You can also expand the filesystem by using the script


Reboot before going on


and run the resize script again



Usually the Ethernet Port should just connect via DHCP. If you have a Wifi Stick you should use


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


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 or casanova's CLI Monitor 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.

Donation suggestion

  1. The image starts mining right away - for joe_rondx (next version will include fireworm). This is not meant to be a rip off. Consider to have a freshly burned card mine for us perhaps one hour as initial donation.
  2. If you are running less than 10 units (XU4, XU4Q, HC1, MC1/4) the initial donation is all we are asking for.
  3. If you are running 10-19 units you may consider to have one small miner running on joe_rondx address.
  4. If you are running 20-29 units you may consider to have one more small miner running on fireworms address.
  5. If you are running 30-39 units you may consider to switch joes small miner to a big one.
  6. If you are running 40-49 units you may consider to switch fireworms small miner to a big one.
  7. If you are running 50+ units please also consider donating to the project via its donation page.

Justification: Individual hasrates may vary, but let's assume you were getting 450 H/m per unit without this image. The image should give you 537 H/m which is an increase of nearly 20% . 10 units should produce 5370 H/m while one small miner does about 137 H/m - which is about 2.5% of the total hashrate.

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

 chmod +x

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 not 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


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



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

Setting up a Swapfile

Verium is memory intensive, so we increase the swap file (or use DietPi 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


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)


which install the miners into


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

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:// -u VEXMki29ycW5vSt3MmdM5iwHqsHux91EMr.Guide -p GuidePwd --cpu-priority 4 -t 3 --cpu-affinity 0x00FF --api-bind &

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

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:// -u VEXMki29ycW5vSt3MmdM5iwHqsHux91EMr.Guide -p GuidePwd --cpu-priority 1 -t 5 -b 4049 --api-bind &


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.

More information on monitoring can be found here.

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

1way : 128MB -> nr_hugepages = 65. 3way : 384MB -> nr_hugepages = 193. 6way : 768MB -> nr_hugepages = 386.

Configuration of birtys image

Setup: birtys hugepages minimal image: [drive]

Configure hugepages

 sudo nano /etc/sysctl.conf



Change host

 nano /etc/hostname
 nano /etc/hosts

and dram_freq=933 in

 nano /media/boot/boot.ini

as well as the password by


Reboot before going on


Fireworm Miner Installation

Remove old miner from birtys image:

 rm -rf veriumMiner

Install newest miner by script:

 chmod +x

Miner Autostart Configuration

Autostart config

 nano /etc/rc.local
# Verium Miner Configuration
# big cores
nice --10 /root/verium/nwayminer/cpuminer \
 -o stratum+tcp:// -u joe_rondx.1 -p joe \
 -t 3 -1 1 --cpu-affinity 0x00F0 --cpu-priority 2 \
 --api-bind --no-color >> /root/verium/nwayminer/3waymine.log &

sleep 5 # delay for hugepages allocation

# little cores
/root/verium/nwayminer/cpuminer \
 -o stratum+tcp:// -u joe_rondx.HC1_1 -p joe \
 -1 4 --cpu-affinity-stride 1 --cpu-affinity-oneway-index 0 --cpu-priority 0 \
 --api-bind -b 4049 --no-color >> /root/verium/nwayminer/1waymine.log 

Run the 3way miner first !!

 -t 3 -1

First because it should make maximal use of hugepages.

Secondly run only 1way

 -1 4 

where 1 thread runs without hugepages.


=> 400 + 137 = 537 H/m @ 1.9 GHz

Power to the Rig

The specs say 4 Amps @ 5V for an Odroid. But there is way more to consider if you want to power your rig.

Amp calculations

PSU choice