Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with OpenCL on Mac M1 #391

Open
mora-phi opened this issue Jan 27, 2023 · 5 comments
Open

Issue with OpenCL on Mac M1 #391

mora-phi opened this issue Jan 27, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@mora-phi
Copy link

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```
@3rdIteration
Copy link
Owner

OpenCL on M1 isn't currently supported

@3rdIteration 3rdIteration added the enhancement New feature or request label Jan 28, 2023
@mora-phi
Copy link
Author

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

@dvncan
Copy link

dvncan commented Feb 9, 2024

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'

@3rdIteration
Copy link
Owner

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)

@Yua81
Copy link

Yua81 commented Aug 9, 2024

这还存在吗?我从 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants