print 'Wrong platform or more than one OpenCL platforms found, use --platform to select one of the following\n' for i in xrange(len(platforms)): print '[%d]\t%s' % (i, platforms[i].name) sys.exit() if options.platform == -1: options.platform = 0 devices = platforms[options.platform].get_devices() if (options.device == -1 or options.device >= len(devices)): print 'No device specified or device not found, use -d to specify one of the following\n' for i in xrange(len(devices)): print '[%d]\t%s' % (i, devices[i].name) sys.exit() miner = None try: miner = BitcoinMiner(devices[options.device], options.host, options.user, options.password, options.port, options.rate, options.askrate, options.worksize, options.vectors, options.verbose) miner.fps_slow = options.fps_slow miner.fps_fast = options.fps_fast miner.swapFrame() miner.mine() except KeyboardInterrupt: print '\b\b \nStopping...' finally: if miner: miner.exit() sleep(1.1)
options.platform = 0 devices = platforms[options.platform].get_devices() if (options.device == -1 or options.device >= len(devices)): print 'No device specified or device not found, use -d to specify one of the following\n' for i in xrange(len(devices)): print '[%d]\t%s' % (i, devices[i].name) sys.exit() miner = None try: miner = BitcoinMiner(devices[options.device], options.host, options.user, options.password, options.port, options.rate, options.askrate, options.worksize, options.vectors, options.verbose) miner.fps_slow = options.fps_slow miner.fps_fast = options.fps_fast miner.swapFrame() miner.mine() except KeyboardInterrupt: print '\b\b \nStopping...' finally: if miner: miner.exit() sleep(1.1)
for device in args.devices: miner = BitcoinMiner( sysDevices[device].getOpenCL(), args.host, args.user, args.password, args.port, secure=args.secure, userAgentString=PROGRAM_NAME ) miners.append(miner) # start all the minners for miner in miners: miner.mine() except KeyboardInterrupt: print # try to clean the carret log.warn('Ctrl-C - Exiting ...') sys.exit(0) finally: # kill and wait for all the minners to die for miner in miners: if miner != None: miner.exit() while not miner.isStopped: pass log.warn('a minner died :(') log.warn('finished') print "-"*76 print "The End"