TeamRedMiner Ethash Tuning Guide
================================

Summary
-------
- Do not trust the displayed hashrates of other closed source
  miners. We will release a separate report on this topic and tools
  for everyone to verify our claims shortly. For the time being, run
  longer tests, observe your accepted poolside hashrate and draw your
  own conclusions.
  
- Polaris cards are only briefly covered by this guide, plenty of
  guides available already.

- For Vega performance, you must establish modded mem timings using
  the AMD mem tweak tool yourself, or use a mining OS that does it for
  you. TeamRedMiner does not modify timings automatically.

- Vega 56 Hynix can do > 50 MH/s which is a significant boost vs other
  miners.

- Vega 64 Samsung can do > 50 MH/s.

- Vega 56 Samsung should be flashed with a Vega 64 bios for max
  hashrate, 49-50 MH/s.

- Vega 56 Samsung with 56 bios should be tuned for efficiency instead
  targeting 46.5-47.5 MH/s.

- Radeon VII gets a big boost and can do > 86-87 MH/s.

- Dev fees: Polaris 0.75%, Vega 1.0%

- TRM discord: https://discord.gg/RGykKqB

General Overview
----------------
In general, TeamRedMiner behaves like other ethash miners. If you have
a tuned configuration for another miner, it should generally work well
although might not be the absolute optimum for your rig(s). The main
exception is for cards driving monitors or doing other simultaneous
work. For those, you often need to specify a lower manual --eth_config
value or the miner will collide with rendering tasks, having the
driver reset the GPU during mining.

For more help, and for issues not mentioned in this document, please
join the TRM discord and ping us there.

Note 1: the reader is assumed to be skilled in Vega tuning and know how
to use PPTs, set clocks using e.g. OverdriveNTool on Win, modify
timings using the AMD mem tweak tool, etc.

Note 2: we will be shortly be releasing an ETH miner testing tool that
helps out in these tuning tests by acting as a pool with very low
difficulty, making it much easier to spot excessive hw errors
quickly. Stay tuned for more info!

Note 3: a huge shout-out to our beta testers for helping out with
timings and stability testing in general (ddobreff, BDF, NCarter84,
gkumaran, pbfarmer, heavyarms1912)!


Mining Modes: A and B
---------------------
TeamRedMiner introduces two mining modes for ethash: A and B mode.
The B mode allocates a lot more memory for the DAG, meaning only >=
8GB GPUs can be used. The B mode normally adds 0.2-0.5% for Polaris
8GB cards, nothing for Vega 56/64 and a significant boost for Radeon
VIIs. The miner automatically chooses the best mode for you.

NOTE: for Windows miners using the B mode - you should roughly make
sure you have at least 8GB per GPU as available swap space, or you
risk running out of swap and need to manually force the A mode for one
or more GPUs in the rig using the --eth_config command line argument.

In addition to the A/B mode, the miner contains a single tuning
number. The miner will auto-tune the best setup for you unless a
manual override is provided using the --eth_config parameter. Please
see the miner help (teamredminer --help) for more details. The tuning
number ranges for various GPUs are:

470/570:    0-512
480/580:    0-576
Vega 56:    0-896
Vega 64:    0-1024
Radeon VII: 0-960


Polaris Cards (470-580)
-----------------------
There are a multitude of tuning guides, straps, ref boost guides etc
available for Polaris GPUs already. For these cards, TeamRedMiner
performs similarly to available miners. At the time of writing, our
tests indicate that TRM outperforms the other miners in the majority
of cases (0.75% dev fee taken into account). Sometimes it can be
0.5-1.0%, other times it's less, a few times it's such a close call
it's impossible to tell. Our B mode normally adds a 0.3-0.5% boost on
8GB cards.

For power draw, and adjusting for the true poolside hashrate, TRM is
currently the most lean miner, although the normal difference isn't
more than 0.5-1.5W per Polaris GPU.

Tuning process in short: use your current ethash straps, or if you're
a CN miner please switch to ethash-centric straps if possible. Then,
don't forget to enable --REF boost using the AMD mem tweak tool. Last,
start with a more generous voltage, max your mem clock, then lower
your core clk, and drop the voltage as much as possible while
remaining stable.

If you need more help or like to discuss tuning, join the TRM discord.

Vega 56 Hynix
-------------
The Vega 56 GPUs with Hynix HBM2 memory are generally known to be
underperforming their Samsung cousins. With this TRM release, they
have suddenly become strong contenders for the best Vega for ethash
mining instead.

The tuning setup we have come to like in our tests is the following:

1) Start with your core clk at 1100 MHz while pushing the mem clock to
   950 MHz. If you know that your mem can't handle 950 MHz, lower it
   from the start. Use 875mV for voltage.

1) Start with the following modded mem timings as a baseline:

   --cl 18 --ras 23 --rcdrd 23 --rcdwr 11 --rc 34 --rp 13
   --rrds 3 --rrdl 4 --rtp 6 --faw 12 --cwl 7 --wtrs 4 --wtrl 4
   --wr 11  --rfc 164 --REF 17000

2) The guess is that this setup will hit 46-46.5 MH/s for you. The key
   to improving performance is --rcdrd. Proceed to lower that value
   one step at the time, stopping and restarting the miner between
   each change. You must be on the lookout for hw errors which means
   you've reached your GPU's limit.

3) If you're part of the lucky crowd and your GPU can handle a rcdrd
   value as low as 15-16, you should now be seeing a 50-50.2 MH/s
   hashrate. If your card starts producing hw errors, you need to
   increase rcdrd until you're stable. NOTE: you must _blast_ your
   fans to make sure the HBM temp is kept in check. On Windows, we
   recommend using HWiNFO64 to monitor the HBM temp. It should
   preferably be kept < 60C.

4) Lower the core clk as much as possible without losing hashrate. If
   you ended up ith a rcdrd value > 16, there should be room to lower
   it from 1100 MHz. For a 50 MH/s hashrate, you probably need the
   1100 MHz core clk to sustain it.

5) Lower voltage to 850/840/830/820 mV, as low as possible while
   remaining stable.

6) For better efficency (but lower hashrate), tune down your core clk
   and try to further lower the voltage.

Using this setup, we have been running Gigabyte Vega 56 Hynix cards
for > 50 MH/s with no hw errors. Other miners running at the same
clocks ended up around 44 MH/s, meaning +13-14% for TRM, although we
can't guarantee there aren't better configurations for said miners.

Vega 64 Samsung
---------------
In short, try the following for a 50-51 MH/s setup:

1) Set clocks to core clk 1075 MHz, mem clk 1107 MHz, voltage at 850
   mV. Your card may need to clock down the mem clk to 1050-1080 MHz
   to be stable with no hw errs.

2) Use the following modded timings:

   --CL 20 --RAS 30 --RCDRD 14 --RCDWR 12 --RC 44 --RP 14 --RRDS 3
   --RRDL 6 --RTP 5 --FAW 12 --CWL 8 --WTRS 4 --WTRL 9 --WR 14
   --REF 17000 --RFC 249

3) Hopefully it runs stable and you should observe a hashrate around
   50.5-50.9 MH/s. If your GPU can't handle the timings, you need to
   relax them to less aggressive variants available in the AMD mem
   tweak thread on Bitcointalk, or come join the TRM discord for
   further suggestions.

4) For better efficiency (but lower hashrate), tune down your core clk
   and try to further lower voltage while remaining stable.

5) We reiterate: _blast_ your fans and monitor your HBM temperature.


Vega 56 Samsung flashed 64 bios
-------------------------------
From a tuning perspective, we treated these cards like regular Vega 64
GPUs. You might need to increase core clk somewhat compared to true
Vega 64s to compensate for the fewer compute units, otherwise follow
the guide for Vega 64 Samsung.

In general, the flashed cards couldn't handle a maxed out mem clk at
1107 MHz, rather needed to clock down to 1060-1075 MHz. Start stable,
and add a step where you slowly increase the mem clk again.


Vega 56 Samsung (56 bios)
-------------------------
If you want to target a max hashrate setup for 49-50 MH/s, we advise
you to flash a Vega 64 bios. We have found it very difficult to
achieve the same speeds as for Vega 56 Hynix using the stock bios for
Vega 56 Samsung GPUs. If you insist on using the Vega 56 bios, we
rather recommend a more efficient setup doing 47-47.5 MH/s:

1) Clock down your core clk significantly to 940 MHz. We ran our tests
   in power states core P3+mem P3. Set mem clk to 950 MHz. Start with
   850 mV for voltage.

2) Apply small timing modifications:

   --RCDRD 12 --REF 12000

   If your card can't handle RCDRD 12, leave it at the stock value (13).

3) Lower voltage as much as possible. We ended up at 815 mV. You
   should now have a nice efficient setup for 47.0-47.5 MH/s.


Radon VII
---------
The VIIs are simple to tune. Just start the miner at maybe 1600 MHz
core clk, 1000 MHz mem clk, it should give you 86-87 MH/s. The miner
will auto-tune to some Bxxx value for you and give a significant boost
over other miners.

IMPORTANT: we have seen some VIIs getting close to zero boost between
A and B modes. The B mode should see a significant hashrate
increase. Many times those GPUs have been running the very original
bios (v105) and need to flash to v106 that was released by AMD shortly
after the Radeon VII release date. That bios can be tricky to find at
this point. Please ping us in the TRM discord and we can provide it.

The only remaining tuning is to first lower the core clk until you
start losing hashrate, which often is immediately. After that, try to
lower voltage for a more efficient setup. If you can't keep your cards
cool, you need to clock down in general (both core and mem clk) for a
lower hashrate.

And again: blast those fans, especially on the VIIs.


Happy mining!
