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"):
|
||||
BMConfigParser().set('bitmessagesettings', 'opencl', str(self.settingsDialogInstance.ui.comboBoxOpenCL.currentText()))
|
||||
queues.workerQueue.put(('resetPoW', ''))
|
||||
|
||||
acceptableDifficultyChanged = False
|
||||
|
||||
|
|
|
@ -120,6 +120,11 @@ class singleWorker(threading.Thread, StoppableThread):
|
|||
self.sendOutOrStoreMyV4Pubkey(data)
|
||||
except:
|
||||
pass
|
||||
elif command == 'resetPoW':
|
||||
try:
|
||||
proofofwork.resetPoW()
|
||||
except:
|
||||
pass
|
||||
elif command == 'stopThread':
|
||||
self.busy = 0
|
||||
return
|
||||
|
|
|
@ -26,7 +26,12 @@ except:
|
|||
libAvailable = False
|
||||
|
||||
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:
|
||||
hash_dt = numpy.dtype([('target', numpy.uint64), ('v', numpy.str_, 73)])
|
||||
try:
|
||||
|
|
|
@ -231,6 +231,9 @@ def run(target, initialHash):
|
|||
except:
|
||||
pass #fallback
|
||||
|
||||
def resetPoW():
|
||||
openclpow.initCL()
|
||||
|
||||
# init
|
||||
def init():
|
||||
global bitmsglib, bso, bmpow
|
||||
|
|
Reference in New Issue
Block a user