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

OpenCL fails to compile on Mac M1 #12

Open
RS102839 opened this issue May 5, 2021 · 0 comments
Open

OpenCL fails to compile on Mac M1 #12

RS102839 opened this issue May 5, 2021 · 0 comments

Comments

@RS102839
Copy link

RS102839 commented May 5, 2021

System is a Mac Mini M1 with 16 GB memory, building in arm64 mode

Using the XMRIG miner and activated OpenCL with RandomX. Failed with this error:

[SNIP]
[2021-05-04 12:38:53.070] cpu use argon2 implementation default
[2021-05-04 12:38:53.070] randomx init dataset algo rx/0 (8 threads) seed 7d658366894bda88...
[2021-05-04 12:38:53.070] randomx allocated 2336 MB (2080+256) huge pages 0% 0/1168 +JIT (0 ms)
[2021-05-04 12:39:01.629] randomx dataset ready (8558 ms)
[2021-05-04 12:39:01.631] opencl use profile rx (1 thread) scratchpad 2048 KB
| # | GPU | BUS ID | INTENSITY | WSIZE | MEMORY | NAME
| 0 | 0 | n/a | 128 | 8 | 256 | Apple M1
[2021-05-04 12:39:01.632] opencl GPU #0 compiling...
UNSUPPORTED (log once): buildComputeProgram: cl2Metal failed
[2021-05-04 12:39:01.821] opencl error CL_BUILD_PROGRAM_FAILURE when calling clBuildProgram
BUILD LOG:
Compilation failed:

program_source:1736:1: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' update_max(latency,(last_memory_op_slot+WORKERS_PER_HASH)/WORKERS_PER_HASH); `^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` `program_source:1347:56: note: expanded from macro 'update_max'` `#define update_max(value, next_value) do { if ((value) < (next_value)) (value) = (next_value); } while (0)
~~~~~ ^ ~~~~~~~~~~
program_source:1759:1: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'unsigned int'
update_max(first_allowed_slot,latency*WORKERS_PER_HASH);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
program_source:1347:56: note: expanded from macro 'update_max'
#define update_max(value, next_value) do { if ((value) < (next_value)) (value) = (next_value); } while (0)
[2021-05-04 12:39:01.822] opencl thread #0 self-test failed~~~~~~
[2021-05-04 12:39:01.822] opencl disabled (failed to start threads)

My question is twofold:

  1. The signed vs unsigned comparison doesn't appear to be significant, therefore I should be able to solve this by casting the uint32_t to int32_t without any side effects, right?
  2. The source code module appears to be randomx_vm.cl but if I change this module to add the casts and rebuild, the new code is not used. Even if I first remove the contents of the build directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant