Bitcoin Forum
January 02, 2026, 10:53:20 AM *
News: Latest Bitcoin Core release: 30.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Workaround for random miner crashes in Windows  (Read 1164 times)
not.you (OP)
Legendary
*
Offline Offline

Activity: 1726
Merit: 1018


View Profile
November 10, 2013, 02:42:30 PM
Last edit: November 11, 2013, 02:57:18 PM by not.you
 #1

I didn't have my miner app crash on me when I was using GPU mining, it was always the vid driver.  But now that I have some ASICs I see my cgminer randomly crash, often after working just fine for hours.  For my GPU miners I did something similar to what I am going to recommend here except that I had a script which made them shoot me an email and then reboot (since the video driver would almost never allow me to just restart mining without the reboot).  In this case though, ASICs will allow you to just restart the miner.  So to get my miner back up and mining without my intervention I use this method.

I created a batch file that checks if cgminer is running.  If cgminer is running then the script exits, if it is not running it launches it.

Code:
tasklist /FI "IMAGENAME eq cgminer.exe" 2>NUL | find /I /N "cgminer.exe">NUL 
if "%ERRORLEVEL%"=="0" GoTo Eof

start cmd.exe /c "C:\<path to launcher>\Launcher.bat"

Launcher.bat is simply the batch file that I use to launch cgminer in the first place.  If you use a different miner and have a similar problem you can just change the executable name in both places of the first line.

I could make a scheduled task to just run this on a regular basis (every 5 minutes or something) but instead I have a scheduled task that runs this only in the event of an application crash event in the event log.  Since the event log only specifies the crashing app in the details, any crashing application will cause this to run which is why it needs to check for cgminer running first in case some other app is what crashed.  Generally though my miners are dedicated and nothing else is happening on the box so an even log event of 1000 in the application log should always be a cgminer crash for me.

Also, depending on how your mining app is crashing and whether or not you have error reporting on you may want to see this: http://stackoverflow.com/questions/4528697/how-to-immediately-terminate-crashed-application
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!