Пример #1
1
for i in range(config.update_frequency):
    conn = sqlite3.connect(config.db_file)
    c = conn.cursor()

    c.execute("create table if not exists stats (time REAL, load INTEGER, "
              "temp REAL, fanspeed INTEGER, fanrpm INTEGER, hashrate REAL, "
              "efficiency REAL)")

    try:
        hashrate, efficiency = open(config.miner_log).readline().split(':')
    except ValueError:
        hashrate, efficiency = (0, 0)
    hashrate = int(hashrate)
    efficiency = float(efficiency)
    c.execute("insert into stats values (?, ?, ?, ?, ?, ?, ?)",
              ( time.time(),
                ADL.getGPULoad(),
                ADL.getTemp(),
                ADL.getFanSpeed(),
                ADL.getFanRPM(),
                hashrate / 1000.,
                efficiency * 100
                )
              )

    conn.commit()
    c.close()
    conn.close()
    time.sleep(60/config.update_frequency)
Пример #2
0
	for opt, val in cParser.defaults().iteritems():
		setattr(options, opt, val)

	# Define pool specific values if specified and available
	if cParser.has_section('pool_%s' % options.pool):
		for opt in cParser.options('pool_%s' % options.pool):
			setattr(options, opt, cParser.get('pool_%s' % options.pool, opt))

	# Setup logging
	logging.config.fileConfig('logging.conf')
	log = logging.getLogger('stripminer')

	# Collection GPU card information
	log.info('Collecting available GPU information')
	os.environ['DISPLAY'] = ':0'
	devices = ADL.getNumGPU()

	# Fire off mining workers for each device
	processes = []
	for device in devices:
		gpuidx = device['GPU']
		ADL.setIndex(gpuidx)
		log.info('Device[GPU%d] %s (Core: %d, Memory: %d, Fan %d%%)',
			gpuidx, device['Name'], ADL.getCoreClockSpeed(),
			ADL.getMemoryClockSpeed(), ADL.getFanSpeed())
		if cParser.has_section('ADL_GPU%d' % gpuidx):
			log.debug('Found ADL settings for GPU%d', gpuidx)
			if cParser.has_option('ADL_GPU%d' % gpuidx, 'core'):
				core = cParser.getint('ADL_GPU%d' % gpuidx, 'core')
				log.debug('Device[GPU%d] setting Core to %d Mhz', gpuidx, core)
				ADL.setCoreClockSpeed(2, core)
Пример #3
-1
**  FAN SPEED IS NOT ADVISABLE!
**
** ALL ADL code has been taken from AMDOverdriveCtrl ( http://amdovdrvctrl.sourceforge.net/ )
** 
** AMDOverdriveCtrl Author: Thorsten Gilling ([email protected])
** 
** pyADL.py
** This is just a simple python extended library for AMD ADL
** Author: netxshare - http://www.bitshift.io
** 
** 1CWddfhXagPoWgzUCs7oVHFjwBmqbAoJRr
** -------------------------------------------------------------------------*/
'''
import ADL

ADL.SetupADL(0)
print ADL.getGPULoad()
print ADL.getTemp()
print ADL.getFanSpeed()
print ADL.getFanRPM()
print ADL.getCoreClockSpeed()
print ADL.getMemoryClockSpeed()
print ADL.getVoltage()
ADL.setFanSpeed(75)
#ADL.setCoreClockSpeed(2,900)
ADL.SetupADL(5) # Switch to Second GPU on 6990
#ADL.setCoreClockSpeed(2,900)
print ADL.getTemp()
print ADL.getGPULoad()
#ADL.setMemoryClockSpeed(2,1000)