Anyone have a good example of watchdog.bat? I have a gpu that drops occasionally and I'd like to stop the miner gracefully and restart it...or handle it like SRB does.
This is where it gets a little tricky, it depends on how your rig(s) behave on a dead gpu. When I push my Vega 64 on my workstation too hard to test clocks etc I get such a hard hang that I need to cycle the PCIe root hub just to get a prompt back in order to reboot, the gpu looks ok but it's dead. Never had such a hard hang on any other setup. For my Polaris cards on the same workstation, the driver handles the reset just fine by itself and I can just do a simple restart of the miner after setting clocks. So, if I were to handle this with 100% success on this specific workstation with a single script, I would need the hard reset+reboot version.
For the simple use case of a gpu drop that the driver recovers from, I would use two bat files, one that starts the miner with your normal args, then a watchdog restart script with a delay. When the watchdog script is fired, the miner will always shut down as well.
start.bat
set GPU_MAX_ALLOC_PERCENT=100
set GPU_SINGLE_ALLOC_PERCENT=100
set GPU_MAX_HEAP_SIZE=100
set GPU_USE_SYNC_OBJECTS=1
rem Set clocks for all GPUs here
teamredminer.exe -a cnv8 -o stratum+tcp://pool.supportxmr.com:7777 -u 479c6JsyawEVAMNZU8GMmXgVPTxd1vdejR6vVpsm7z8y2AvP7C5hz2g5gfrqyffpvLPLYb2eUmmWA5yhRw5ANYyePX7SvLE -p x --watchdog_script=watchdog.bat
watchdog.bat
@echo off
echo Watchdog restarting miner in 30 secs.
timeout /T 30
start_cnv8.bat
Remember: to test your watchdog script, add " --watchdog_test" to the command line args. In the case above, that would trigger an endless cycle of restart after ~20 secs of mining.