btcrecover icon indicating copy to clipboard operation
btcrecover copied to clipboard

Issue with OpenCL on Mac M1

Open mora-phi opened this issue 2 years ago • 5 comments

When activating opencl, seedrecover.py crashes with the following errors. I have everything installed and it seems to work otherwise (I launched samples of pyopencl where the problem seems to occur and they do not show any error). I may be missing something but I can't find what. Launching the script without opencl works well.

I am on a Mac M1 on Ventura 13.2 Python 3.10.9 pyopencl 2022.3 (also tried with 2022.2.4)


Interrupted after finishing password # 0
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/pyopencl/__init__.py", line 457, in __getattr__
    knl = Kernel(self, attr)
  File "/opt/homebrew/lib/python3.10/site-packages/pyopencl/__init__.py", line 812, in kernel_init
    kernel_old_init(self, prg, name)
pyopencl._cl.LogicError: clCreateKernel failed: INVALID_KERNEL

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/Users/N862667/btc_bruteForce/btcrecover/btcrecover/btcrpass.py", line 8117, in return_verified_password_or_false
    return loaded_wallet.return_verified_password_or_false(passwords)
  File "/Users/N862667/btc_bruteForce/btcrecover/btcrecover/btcrseed.py", line 948, in return_verified_password_or_false
    return self._return_verified_password_or_false_opencl(mnemonic_ids_list) if not isinstance(self.opencl_algo,int) \
  File "/Users/N862667/btc_bruteForce/btcrecover/btcrecover/btcrseed.py", line 1000, in _return_verified_password_or_false_opencl
    clResult = self.opencl_algo.cl_pbkdf2(self.opencl_context_pbkdf2_sha512[i], cleaned_mnemonic_ids_list,
  File "/Users/N862667/btc_bruteForce/btcrecover/lib/opencl_brute/opencl.py", line 706, in cl_pbkdf2
    result = concat(self.opencl_ctx.run(bufStructs, func, iter(passwordlist), salt))
  File "/Users/N862667/btc_bruteForce/btcrecover/lib/opencl_brute/opencl.py", line 525, in concat
    return [obj for lval in ll for obj in lval]
  File "/Users/N862667/btc_bruteForce/btcrecover/lib/opencl_brute/opencl.py", line 525, in <listcomp>
    return [obj for lval in ll for obj in lval]
  File "/Users/N862667/btc_bruteForce/btcrecover/lib/opencl_brute/opencl.py", line 264, in run
    func(self, pwdim, pass_g, salt_g, result_g)
  File "/Users/N862667/btc_bruteForce/btcrecover/lib/opencl_brute/opencl.py", line 703, in func
    prg.pbkdf2(s.queue, pwdim, None, pass_g, salt_g, result_g,
  File "/opt/homebrew/lib/python3.10/site-packages/pyopencl/__init__.py", line 474, in __getattr__
    raise AttributeError("'%s' was not found as a program "
AttributeError: 'pbkdf2' was not found as a program info attribute or as a kernel name
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/N862667/btc_bruteForce/btcrecover/./seedrecover.py", line 38, in <module>
    mnemonic_sentence, path_coin = btcrseed.main(sys.argv[1:])
  File "/Users/N862667/btc_bruteForce/btcrecover/btcrecover/btcrseed.py", line 3619, in main
    mnemonic_found = run_btcrecover(**phase_params)
  File "/Users/N862667/btc_bruteForce/btcrecover/btcrecover/btcrseed.py", line 3012, in run_btcrecover
    (mnemonic_found, not_found_msg) = btcrpass.main()
  File "/Users/N862667/btc_bruteForce/btcrecover/btcrecover/btcrpass.py", line 8683, in main
    for password_found, passwords_tried_last in password_found_iterator:
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 873, in next
    raise value
AttributeError: 'pbkdf2' was not found as a program info attribute or as a kernel name
UNSUPPORTED (log once): createKernel: newComputePipelineState failed```

mora-phi avatar Jan 27 '23 15:01 mora-phi

OpenCL on M1 isn't currently supported

3rdIteration avatar Jan 28 '23 20:01 3rdIteration

Oh ok, thanks for clarifying that, at least I'll stop trying to work around the problem :-p

mora-phi avatar Jan 29 '23 16:01 mora-phi

does this still exist? I am getting this output from an M2.

***@***-MBP-2 btcrecover % python3 run-all-tests.py -vv
Traceback (most recent call last):
  File "run-all-tests.py", line 58, in <module>
    from btcrecover.test import test_passwords
  File "/Users/***/Developer/btcrecover/btcrecover/__init__.py", line 2, in <module>
    from .btcrpass import *
  File "/Users/***/Developer/btcrecover/btcrecover/btcrpass.py", line 60, in <module>
    from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'

dvncan avatar Feb 09 '24 19:02 dvncan

does this still exist? I am getting this output from an M2.

***@***-MBP-2 btcrecover % python3 run-all-tests.py -vv
Traceback (most recent call last):
  File "run-all-tests.py", line 58, in <module>
    from btcrecover.test import test_passwords
  File "/Users/***/Developer/btcrecover/btcrecover/__init__.py", line 2, in <module>
    from .btcrpass import *
  File "/Users/***/Developer/btcrecover/btcrecover/btcrpass.py", line 60, in <module>
    from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'

I don't understand the question, but you just need to follow the installation guide... (As you are missing a required module)

3rdIteration avatar Feb 09 '24 20:02 3rdIteration

这还存在吗?我从 M2 获得了此输出。

***@***-MBP-2 btcrecover % python3 run-all-tests.py -vv
Traceback (most recent call last):
  File "run-all-tests.py", line 58, in <module>
    from btcrecover.test import test_passwords
  File "/Users/***/Developer/btcrecover/btcrecover/__init__.py", line 2, in <module>
    from .btcrpass import *
  File "/Users/***/Developer/btcrecover/btcrecover/btcrpass.py", line 60, in <module>
    from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'

You must install: pycryptodome

Yua81 avatar Aug 09 '24 15:08 Yua81