Reset OpenCL when settings change
- previously, changing the OpenCL vendor (or turning it on/off) required a restart and this wasn't clear
This commit is contained in:
parent
171bc83ec0
commit
8d829b587e
|
@ -2444,6 +2444,7 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
|
|
||||||
if self.settingsDialogInstance.ui.comboBoxOpenCL.currentText().toUtf8() != BMConfigParser().safeGet("bitmessagesettings", "opencl"):
|
if self.settingsDialogInstance.ui.comboBoxOpenCL.currentText().toUtf8() != BMConfigParser().safeGet("bitmessagesettings", "opencl"):
|
||||||
BMConfigParser().set('bitmessagesettings', 'opencl', str(self.settingsDialogInstance.ui.comboBoxOpenCL.currentText()))
|
BMConfigParser().set('bitmessagesettings', 'opencl', str(self.settingsDialogInstance.ui.comboBoxOpenCL.currentText()))
|
||||||
|
queues.workerQueue.put(('resetPoW', ''))
|
||||||
|
|
||||||
acceptableDifficultyChanged = False
|
acceptableDifficultyChanged = False
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,11 @@ class singleWorker(threading.Thread, StoppableThread):
|
||||||
self.sendOutOrStoreMyV4Pubkey(data)
|
self.sendOutOrStoreMyV4Pubkey(data)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
elif command == 'resetPoW':
|
||||||
|
try:
|
||||||
|
proofofwork.resetPoW()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
elif command == 'stopThread':
|
elif command == 'stopThread':
|
||||||
self.busy = 0
|
self.busy = 0
|
||||||
return
|
return
|
||||||
|
|
|
@ -26,7 +26,12 @@ except:
|
||||||
libAvailable = False
|
libAvailable = False
|
||||||
|
|
||||||
def initCL():
|
def initCL():
|
||||||
global ctx, queue, program, enabledGpus, hash_dt
|
global ctx, queue, program, enabledGpus, hash_dt, vendors
|
||||||
|
gpus = []
|
||||||
|
ctx = False
|
||||||
|
enabledGpus = []
|
||||||
|
vendors = []
|
||||||
|
hash_dt = None
|
||||||
try:
|
try:
|
||||||
hash_dt = numpy.dtype([('target', numpy.uint64), ('v', numpy.str_, 73)])
|
hash_dt = numpy.dtype([('target', numpy.uint64), ('v', numpy.str_, 73)])
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -231,6 +231,9 @@ def run(target, initialHash):
|
||||||
except:
|
except:
|
||||||
pass #fallback
|
pass #fallback
|
||||||
|
|
||||||
|
def resetPoW():
|
||||||
|
openclpow.initCL()
|
||||||
|
|
||||||
# init
|
# init
|
||||||
def init():
|
def init():
|
||||||
global bitmsglib, bso, bmpow
|
global bitmsglib, bso, bmpow
|
||||||
|
|
Loading…
Reference in New Issue
Block a user