nicehash / excavator

NiceHash's proprietary low-level CUDA miner
https://www.nicehash.com
53 stars 19 forks source link

Switching of algorithms #259

Closed sedver closed 6 years ago

sedver commented 6 years ago

How to execute switching of algorithms and change of parameters (tdp, memory clock, core clock)?

t4nja commented 6 years ago

You can change device settings (tdp, memory clock, core clock) with device.set.tdp, device.set.core_delta and device.set.memory_delta methods. To switch active algorithm you have to free current algorithm, free all workers, add new algorithm and assign new workers to it (you can use state.set method as well, here is an example of switching from equihash to lyra2rev2).

igorvoltaic commented 6 years ago

@dropky Could you give an example of state.set used for dual mining? thanks in advance. just using uuid twice is sufficient?

t4nja commented 6 years ago

@igorvoltaic here is an example, all you have to do is pass dual mining algorithm (daggerhashimoto_decred, daggerhashimoto_sia, daggerhashimoto_pascal) as algorithm parameter.

[
   {"time": 0,"commands": [
         {
            "id": 1,
            "method": "state.set",
            "params": {
               "btc_address": "34HKWdzLxWBduUfJE9JxaFhoXnfC6gmePG.test",
               "stratum_url": "nhmp.usa.nicehash.com:3200",
               "devices": [
                  {
                     "device_uuid": "GPU-370210bb-3c94-d3ba-ee6c-5ea6d510cb69",
                     "algorithm": "daggerhashimoto_decred",
                     "params": []
                  }
               ]
            }
         }
      ]
   }
]

just using uuid twice is sufficient?

No. If you'll add two states for the same uuid/device, excavator will ignore the second one and only acknowledge the first.

igorvoltaic commented 6 years ago

thanks! wonder why i didn't check algos page myself first :)

One more question then. Does it resubscribe every time i make a switch after i pass "stratum_url": "nhmp.usa.nicehash.com:3200",? or this option is just ignored after i connect for the first time?

t4nja commented 6 years ago

No, it doesn't resubscribe every time. Subscribe is ignored if you pass the same parameters for stratum_url and btc_address as you already did (parameters excavator is currently connected to). If you change either the btc address or stratum url then excavator will resubscribe.

t4nja commented 6 years ago

FYI. You have to pass those parameters at every state.set call. If stratum url or btc address is empty, exacavator will disconnect from the stratum. As the name of the method says, you literally tell excavator what its state should be, excavator will then change the algorithms and subscription only if needed (the method is optimised so it doesn't change the things that are already as you want them to be).

igorvoltaic commented 6 years ago

thank you for the replies, everything is pretty clear now )