Wine build patch for OpenCL frozen mode #1614

Merged
PeterSurda merged 1 commits from winepyopencl into v0.6 2020-04-29 07:06:20 +02:00
PeterSurda commented 2020-04-27 04:11:55 +02:00 (Migrated from github.com)
  • PyOpenCL needs to be patched to work in frozen mode
- PyOpenCL needs to be patched to work in frozen mode
PeterSurda commented 2020-04-27 07:23:22 +02:00 (Migrated from github.com)

I tested it with the 32bit executable and it works ok. The 64bit executable seems to have some problems unrelated to this PR, it looks like it creates invalid objects or doesn't create them at all.

I tested it with the 32bit executable and it works ok. The 64bit executable seems to have some problems unrelated to this PR, it looks like it creates invalid objects or doesn't create them at all.
PeterSurda commented 2020-04-27 09:00:21 +02:00 (Migrated from github.com)

There seems to be some problem with github api at the moment, that may be also why travis is stalling.

There seems to be some problem with github api at the moment, that may be also why travis is stalling.
g1itch commented 2020-04-27 15:19:00 +02:00 (Migrated from github.com)

It's weird. The OpenCL support on my Windows PC (Windows 10 64bit) is probably broken. So I applied the patch:

diff --git a/src/openclpow.py b/src/openclpow.py
index 35bf46d2..23d92cf8 100644
--- a/src/openclpow.py
+++ b/src/openclpow.py
@@ -41,10 +41,10 @@ def initCL():
         hash_dt = numpy.dtype([('target', numpy.uint64), ('v', numpy.str_, 73)])
         try:
             for platform in cl.get_platforms():
-                gpus.extend(platform.get_devices(device_type=cl.device_type.GPU))
+                gpus.extend(platform.get_devices(device_type=cl.device_type.CPU))
                 if BMConfigParser().safeGet("bitmessagesettings", "opencl") == platform.vendor:
                     enabledGpus.extend(platform.get_devices(
-                        device_type=cl.device_type.GPU))
+                        device_type=cl.device_type.CPU))
                 if platform.vendor not in vendors:
                     vendors.append(platform.vendor)
         except:

and have been able to create new address with Bitmessage_x64_0.6.3.2.exe without any exception
bm_opencl_cpu

But Bitmessage_x86_0.6.3.2.exe raises the exception upon start:

LOADER: Running bitmessagemain.py
2020-04-27 15:57:18,740 - WARNING - Using default logger configuration
2020-04-27 15:57:19,095 - CRITICAL - Unhandled exception
Traceback (most recent call last):
  File "bitmessagemain.py", line 53, in <module>
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "threads.py", line 21, in <module>
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "class_singleWorker.py", line 21, in <module>
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "proofofwork.py", line 14, in <module>
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "openclpow.py", line 24, in <module>
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "site-packages\pyopencl\__init__.py", line 78, in <module>
  File "site-packages\pyopencl\__init__.py", line 70, in _find_pyopencl_include_path
  File "site-packages\pkg_resources\__init__.py", line 1144, in resource_filename
  File "site-packages\pkg_resources\__init__.py", line 357, in get_provider
  File "site-packages\pkg_resources\__init__.py", line 900, in require
  File "site-packages\pkg_resources\__init__.py", line 786, in resolve
DistributionNotFound: The 'pyopencl' distribution was not found and is required by the application
Failed to execute script bitmessagemain
LOADER: OK.
LOADER: Cleaning up Python interpreter.
LOADER: Back to parent (RC: -1)
LOADER: Doing cleanup
It's weird. The OpenCL support on my Windows PC (Windows 10 64bit) is probably broken. So I applied the patch: ```patch diff --git a/src/openclpow.py b/src/openclpow.py index 35bf46d2..23d92cf8 100644 --- a/src/openclpow.py +++ b/src/openclpow.py @@ -41,10 +41,10 @@ def initCL(): hash_dt = numpy.dtype([('target', numpy.uint64), ('v', numpy.str_, 73)]) try: for platform in cl.get_platforms(): - gpus.extend(platform.get_devices(device_type=cl.device_type.GPU)) + gpus.extend(platform.get_devices(device_type=cl.device_type.CPU)) if BMConfigParser().safeGet("bitmessagesettings", "opencl") == platform.vendor: enabledGpus.extend(platform.get_devices( - device_type=cl.device_type.GPU)) + device_type=cl.device_type.CPU)) if platform.vendor not in vendors: vendors.append(platform.vendor) except: ``` and have been able to create new address with Bitmessage_x64_0.6.3.2.exe without any exception ![bm_opencl_cpu](https://user-images.githubusercontent.com/4012700/80375967-cd146700-88a1-11ea-93c3-47e04b09905e.png) But Bitmessage_x86_0.6.3.2.exe raises the exception upon start: ```sh LOADER: Running bitmessagemain.py 2020-04-27 15:57:18,740 - WARNING - Using default logger configuration 2020-04-27 15:57:19,095 - CRITICAL - Unhandled exception Traceback (most recent call last): File "bitmessagemain.py", line 53, in <module> File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "threads.py", line 21, in <module> File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "class_singleWorker.py", line 21, in <module> File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "proofofwork.py", line 14, in <module> File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "openclpow.py", line 24, in <module> File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "site-packages\pyopencl\__init__.py", line 78, in <module> File "site-packages\pyopencl\__init__.py", line 70, in _find_pyopencl_include_path File "site-packages\pkg_resources\__init__.py", line 1144, in resource_filename File "site-packages\pkg_resources\__init__.py", line 357, in get_provider File "site-packages\pkg_resources\__init__.py", line 900, in require File "site-packages\pkg_resources\__init__.py", line 786, in resolve DistributionNotFound: The 'pyopencl' distribution was not found and is required by the application Failed to execute script bitmessagemain LOADER: OK. LOADER: Cleaning up Python interpreter. LOADER: Back to parent (RC: -1) LOADER: Doing cleanup ```
g1itch commented 2020-04-27 15:26:19 +02:00 (Migrated from github.com)

Oops, I've built exe without these changes (have local copy of buildscripts/winbuild.sh with commented downloads).

Oops, I've built exe without these changes (have local copy of `buildscripts/winbuild.sh` with commented downloads).
g1itch (Migrated from github.com) approved these changes 2020-04-28 09:49:10 +02:00
g1itch (Migrated from github.com) left a comment

32bit executable works better with this change. Unfortunately I cannot properly check the PoW because of broken OpenCL support on my Windows PC.

32bit executable works better with this change. Unfortunately I cannot properly check the PoW because of broken OpenCL support on my Windows PC.
This repo is archived. You cannot comment on pull requests.
No description provided.