Start Up Bat file

CalivetCalivet Member Posts: 194 ✭✭
How to create a batch file to auto start mining on Windows startup or after system crash and resets.

This is for windows 10 only since I am running Windows 10. I am also using MSI afterburner. Please do not attempt this until you have perfected your undervolt/overclock or whatever settings you want to mine at. They must be stable and able to start up without any issues.

I have saved my settings in MSI afterburner. I have checked the boxes, which would start up afterburner when windows start and to minimize it. I have also checked to apply overclock settings on startup.

Ok first of all you need to set up your windows login so that you don't have to enter a password before you can get main GUI. Just go to settings and accounts. Create new account or change your account to not have a password (leave it blank). Go down to sign in options, select "never" in the box that ask when windows should require you to type in a password. Scroll down and you will see related settings. Click on that. Scroll down to where it says, "show windows background pic...." turn that off. Doin all this will allow you to skip the sign in screen when windows boots up or restarts. This is what we need. The batch file will not execute by itself if you do not do this. It will wait for you to sign in with your password then execute the mining batch file.

I am using CDM 5.3 and dual mining. In the readme file under the -r option, if you enable -r 1, it will execute a reboot.bat file. He also includes the code, shutdown /r /t 5 /f . Open up a new notepad and insert that code. Save it as reboot.bat. Make sure you don't save it as a text file, make sure it's a executable bat file.

Now open up a new notepad file and enter the following

echo off

start /d " this is where your start.bat address goes" start.bat

example:

echo off
start /d "C:\Users\Desktop\my files\Claymore's Dual nyoc+Decred AMD GPU Miner v5.3" start.bat

Save the file as whatever you want to name it. (Make sure you use the quotation marks, before the C: and after the folder name where your batch file is)

Now right click on that file and create a shortcut.

Right click on that shortcut and select cut.

Go to the search the web and windows box (next to the windows startup icon) and type in run.

When the run window pops up type in shell:startup

Now you should be in the startup folder where you can add batch files.

Right click and select paste or you can click the home tab and select paste.

So in theory when you miner crashes and executes the reboot.bat, your system restarts, upon system startup it will execute the bat file you just created. If you're using MSI afterburner you settings will already be loaded and you will be mining again.

I had to google all this and put it all together. I did not invent this. Use at your own discretion.



«1

Comments

  • oAPMooAPMo Member Posts: 97
    -r 1 in config.txt does not start reboot.bat for me, just restarts claymore.
  • agent412agent412 Member, Moderator Posts: 281 mod
    @Calivet @oAPMo For me, the easiest way to get it going was to just add the bat file to the startup folder. Just open the windows folder, and type in the search bar shell:startup, then just drag the bat file in there. That's all.

  • oAPMooAPMo Member Posts: 97
    nono, I have this but I mean if lets say u have a 4card rig, one of the cards crashes, there's 2 things that can happen if the driver can't recover in time:
    1. claymore restarts and the rig continues with 3cards
    2. claymore tries to restart and halts because it cannot start the main card. This happend to me yesterday, rig halted for 6hours and reboot.bat didn't launch, miner couldn't restart itself.
    That's what I want to do, force restart the rig if any cards crash.
  • CalivetCalivet Member Posts: 194 ✭✭
    @oAPMo did you create the reboot.bat with the code mention with the -r 1 option?
  • CalivetCalivet Member Posts: 194 ✭✭
    @agent412 ah yes that works also.
  • oAPMooAPMo Member Posts: 97
    @Calivet yes I have reboot.bat in the miner folder with shutdown /r /t 120 /f
  • CalivetCalivet Member Posts: 194 ✭✭
    @oAPMo that is strange. I just had an issue with one of my gpu crashing and it worked for me. my code in the reboot.bat is shutdown /r /t 5 /f
  • CalivetCalivet Member Posts: 194 ✭✭
    that 120 in your code is the time in which it takes in second to reset. Maybe by that time the computer is hung up on other issues and frozen. Could you try to change it to 5 seconds and see if that works?
  • oAPMooAPMo Member Posts: 97
    yes I changed it, now I'm waiting for the next one
  • oAPMooAPMo Member Posts: 97
    -r 1 with /t 5 it does restart but problem is that the pc hangs on shutdown because of the failed gpu's driver. if the miner is closed manually, then restart, its all good, but if reboot.bat restarts the pc it hangs and cannot restart.
  • CalivetCalivet Member Posts: 194 ✭✭
    @oAPMo what are your settings for your gpu? are you using an oc tool like afterburner? What is the error message you are getting?
  • oAPMooAPMo Member Posts: 97
    I dont get any error message in claymore, simply the gpu is at 0mh and restarts the miner and fails to start or starts with one less gpu, if I use the reboot.bat then shutdown doesn't happen, it just crashes. I use MSI AB -100mv with barely any core oc, 1020 (from 1000), right now I'm trying 1000 on the gpu that keeps failing with 0mv and 1020core -100mv on the rest. If this keeps happening I think I will make the reboot.bat be another start.bat with 30-60sec timeout, because all it needs is time for the gpu driver to recover, then it can go again. If I catch the gpu hang and close the miner manually, I see the driver recovering in about 5seconds and its ready to go again. However I can't figure out why this hang is happening, 750w psu for 2x r9 390 is enough, brand new gpus.
  • dddrgonzooodddrgonzooo Member Posts: 145 ✭✭
    @oAPMo You can use the task scheduler to restart every so many hours, so even if this doesn't work there is a point where your os will force a restart?
  • CalivetCalivet Member Posts: 194 ✭✭
    edited August 2016
    if it is giving you 0mh than you are undervolting your gpu's too far and does not have enough volts to detect your gpu. Try this in your bat file -di detect. To get the correct order of your gpu. So that you can isolate which Gpu needs a little more volts to be detected. Sometimes the order you have in MSI afterburner and GPUZ is different from Claymore's minner. Hence you need to enter the -di detect code to get the right order. For example after entering the code -di detect it gives me the order 10243. That means that in claymore my 2nd GPU (gpu 1) is the first one, my first gpu (gpu 0) is my second one. and so on. Once you isolate the gpu that is not being detected. Another thing to look at is the Asic quality for your 390. are they higher or lower than 72 Asic quality? You can find the Asic quality in GPUZ. This also effects your undervolt/overclock capabilities and settings. Once you isolate and find which GPU is not giving you 0 MH/S Give it a little more juice. I would recommend setting memory to 1250. core clock to 970-977. and add mV as need to detect your gpu's
  • CalivetCalivet Member Posts: 194 ✭✭
    As for your PSU is it rate 80 + bronze, gold, platinum? That is important since it has a power efficiency rating. What you are getting from the wall is not what you are getting from your cards. From example. My five 390 are pulling 1240w from the wall. My PSU is an 1300 w EVGA 80 + Gold PSU. That means it has an 87% power efficiency rating. So if i take 1240 and multiply that by .87 my rig is actually only using 1078 w. The PSU is only supplying power at 87% efficiency.
  • oAPMooAPMo Member Posts: 97
    @dddrgonzooo yes, 2-3hourly restart is my last choice, but that you can set in the miner too -r 60 (60min)
    @Calivet the order is the same in claymore as msi for me, it is gpu1 thats failing, now its at 0mv and stock core. I cannot underclock memory or core, I can only overclock in MSI AB. PSU is gold super flower, very good brand (evga psu's are made by superflower). How do you underclock core/mem ?
  • CalivetCalivet Member Posts: 194 ✭✭
    have you checked the asic quality?
  • CalivetCalivet Member Posts: 194 ✭✭
    in msi afterburner you have to check the boxes
  • CalivetCalivet Member Posts: 194 ✭✭
    I have also modded my Rom Bios with hawaii bios reader. Then flashed them with atiflash via usb bootable disk. Now to do that you would have to be willing to mess with your GPU, it can void your warranty also. So I would caution to do at your own risk. There are great forums on here also if you are interested.
  • oAPMooAPMo Member Posts: 97
    edited August 2016
    @Calivet I didn't check the extend official oc, will check underclocking with that, right now I'm just waiting if the gpu fails again or not. I don't know how but on the r9 390 rig I forgot to set virtual memory to 16g+, it was at 4g standard /facepalm. It might have been that, also disabled ULPS, now its 5hours and no fail yet, if it fails again I'm gonna check everything you said, don't even wanna go to teamviewer coz one time the gpu1 failed right as I joined remotely.
    Bios flashing I don't want to do, even tho I did hundreds of times on my r9 280x 2years ago, one even bricked but I could bring it back with alot of reflashing, the chip got corrupted and failed to write for like 50tries in a row, but +1 was the charm :D
    Do you have your main gpu on less voltage/core/mem than the rest ? I mean the one that has the video cable plugged in.
  • CalivetCalivet Member Posts: 194 ✭✭
    The one plug in for me needs a little more juice. That's good to hear. I go headless to save some on some power. The power it cost to run a monitor. Happy you got it to be stable.
  • oAPMooAPMo Member Posts: 97
    Whats the core/mem of the gpu plugged into monitor compared to the rest? Would you send me a log of your miner ? Like an hour or so, I'd like to see the fluctuations in mh.
    I'm gonna try the underclocks but now I want to see 24hour nofail before I do anything, max I've seen from the rig was about 16hours without fail. thanks for all the help btw!
  • CalivetCalivet Member Posts: 194 ✭✭
    Ill let it run for a little bit so that you will have better stats. I had to restart my rig so its been running for maybe an hour or so. PM me your email or something so that I can email you the log.
  • ceddycakesceddycakes Member Posts: 70
    I'm trying to learn the same thing as OP. I'm testing different undervolt/overclock setting, but don't want to sit and wait for 3 hours or whatever to see if anything happens.

    Does anyone know of a program that allows me to restart the batch file so that Claymore miner can startup when it hangs/freezes/crashes. Or if there is a batch file that I need to make in order for this to happen?
  • CalivetCalivet Member Posts: 194 ✭✭
    @ceddycakes did you not read the whole forum? Create a reboot.bat. Enable -r 1 in your batch file where you have your address. Copy your start up batch file that runs your miner to Shell:startup.
  • ceddycakesceddycakes Member Posts: 70
    edited August 2016
    Calivet said:

    @ceddycakes did you not read the whole forum? Create a reboot.bat. Enable -r 1 in your batch file where you have your address. Copy your start up batch file that runs your miner to Shell:startup.

    I read the whole thing multiple times, but I guess I don't get it. I have a batch file with all my mining info, in the shell:startup. I'm confused about the reboot.bat file. How is this supposed to work and link to the startup batch file? Am I supposed to have "shutdown /r /t 5 /f" in the reboot.bat file and have "-r 1" in the startup, and does it matter where the - r 1 sits in the startup batch file? I would appreciate help if you understand what to do.

    Thank you.
    Post edited by ceddycakes on
  • CalivetCalivet Member Posts: 194 ✭✭
    @ceddycakes Yes that is the correct code in the reboot.bat file. Just leave it in the same mining folder as your start.bat (or whatever you named it). Put the -r 1 between your epool and dpool address. Or you can put it after your dpool address. I believe it works the same way. The -r 1 in your start.bat (which starts your miner) will execute the reboot.bat file (which will shutdown and restart your computer. Upon start up, if a copy or shortcut to your start.bat file is in the startup folder it will execute automatically. Now the important part is to disable the windows login password requirement. So that when it restarts it doesn't stop at the windows login screen. You should be good to go.
  • ceddycakesceddycakes Member Posts: 70
    edited August 2016
    Calivet said:

    @ceddycakes Yes that is the correct code in the reboot.bat file. Just leave it in the same mining folder as your start.bat (or whatever you named it). Put the -r 1 between your epool and dpool address. Or you can put it after your dpool address. I believe it works the same way. The -r 1 in your start.bat (which starts your miner) will execute the reboot.bat file (which will shutdown and restart your computer. Upon start up, if a copy or shortcut to your start.bat file is in the startup folder it will execute automatically. Now the important part is to disable the windows login password requirement. So that when it restarts it doesn't stop at the windows login screen. You should be good to go.


    Alright! So I did what you stated, and I have a question. Is the reboot file supposed to reboot the computer, or the Claymore mining software? Reason I'm asking is because Claymore states that command "r" and command "1" are unknown. Is this normal? Am I missing something, or am I expecting something different then what this thread will offer? I feel the wording of what I'm looking for may be off.

    I am only able to get ~6 hours of work from my rig before Claymore freezes and I don't see anymore updates with shares or hashrate. I'm trying to have Claymore itself restart if it's been detected to crash or freeze after a certain amount of time. Note, Windows 10 task manager doesn't mention if Claymore is responding/not responding.

    Simple timeline of what happens and what I want done

    1. Start miner and have Claymore 5.3 running.
    2. 6 hours of time has passed and claymore is not updating itself with hashpower numbers or any type of update. Additionally, I know it's not working because the pool I'm using shows 0 as my hash rate.
    3. Now since Claymore has froze/whatever happened, I want the computer to know that CLaymore has frozen or not responded, and after, lets say, 60 seconds, I want Claymore to be forcefully reset, allowing the mining to continue with minimal hiccups.

    I hope this makes sense.

    Edit 1: Seems like https://bitcointalk.org/index.php?topic=1433925.0 says there is a Watchdog command that ties in with a reboot file. Would you know how to create the config file? Is it as simple as typing the commands that I want and Claymore will detect commands in the file automatically?
    Post edited by ceddycakes on
  • indytimindytim Member Posts: 123
    edited August 2016
    @Calivet I can't thank you enough for putting this information together and launching the discussion. I'm leaving on a 10-day trip in about 6 hours, and setting this up was on my list of about 50 different things to do. I had a few pieces in place, but was missing the part about setting MSI AB to launch on startup. That was a key piece since my 390s run pretty hot at stock voltage.

    Thanks again - a very useful thread.

    Now if we could just get Wattman to do the same as MSI AB does, for the RX 480s - right now it's a lot of manual pointing and clicking for each of 6 cards - what a PITA.
  • CalivetCalivet Member Posts: 194 ✭✭
    setx GPU_FORCE_64BIT_PTR 0
    setx GPU_MAX_HEAP_SIZE 100
    setx GPU_USE_SYNC_OBJECTS 1
    setx GPU_MAX_ALLOC_PERCENT 100
    setx GPU_SINGLE_ALLOC_PERCENT 100
    EthDcrMiner64.exe -epool us-east.ethash-hub.miningpoolhub.com:20555 -ewal username.woker -eworker username.worker -esm 2 -epsw x -mode 0 -di 34201 -eres -gser -wd 1 -r 1 -dbg 1 -dcri 40 -dcrt 10 -tt 1 -ttdcr 85 -tstop 90 -mport -3333 -allcoins -1 -allpools 1 -dpool stratum+tcp://hub.miningpoolhub.com:20550 -dwal username.worker -dpsw x -dcoin sc
or to comment.