xmrig / xmrig-amd

Monero AMD (OpenCL) miner
GNU General Public License v3.0
412 stars 226 forks source link

Error on compiling time for AMD GPU (macOS) #277

Open d9beuD opened 4 years ago

d9beuD commented 4 years ago

I downloaded and compiled xmrig-amd from releases with no issue. But when I start xmrig with default config I get the following output:

 * ABOUT        XMRig-AMD/2.14.6 clang/11.0.0
 * LIBS         libuv/1.31.0 OpenCL/1.2 OpenSSL/1.0.2t microhttpd/0.9.63 
 * CPU          Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz x64 AES
 * ALGO         cryptonight, donate=5%
 * POOL #1      donate.v2.xmrig.com:3333 variant auto
 * COMMANDS     hashrate, pause, resume
[2019-11-20 11:19:20] compiling code and initializing GPUs. This will take a while...
[2019-11-20 11:19:20] found OpenCL GPU: Intel(R) UHD Graphics 630, cu: 24
[2019-11-20 11:19:20] found OpenCL GPU: AMD Radeon Pro 555X Compute Engine, cu: 12
[2019-11-20 11:19:20] #00, GPU #01 AMD Radeon Pro 555X Compute Engine, i:192 (8/256), si:2/2, u:8, cu:12
[2019-11-20 11:19:20]              0.38/1.00/4 GB
[2019-11-20 11:19:20] GPU #1 compiling...
[2019-11-20 11:19:33] Error CL_BUILD_PROGRAM_FAILURE when calling clBuildProgram.
Build log:
Error returned by cvms_element_build_from_source
[2019-11-20 11:19:33] Failed to start threads.

My hardware:

I don't understand what this error means.

hvw33 commented 4 years ago

Same here ...

ekoyudhi commented 4 years ago

Yes...i use Radeon 5450 HD get same error

serambca commented 3 years ago

HI! how to compile in macOS? I only see instructions for Linux or Windows :(

d9beuD commented 3 years ago

HI! how to compile in macOS? I only see instructions for Linux or Windows :(

It is the same as for Ubuntu, see this link: https://github.com/xmrig/xmrig-amd/wiki/Ubuntu-Build

gtu78aed87t commented 3 years ago

It didn't work for me neither failing at the 'cmake ..' command.

-- The C compiler identification is AppleClang 10.0.1.10010046 -- The CXX compiler identification is AppleClang 10.0.1.10010046 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at /usr/local/Cellar/cmake/3.20.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find UV (missing: UV_LIBRARY UV_INCLUDE_DIR) Call Stack (most recent call first): /usr/local/Cellar/cmake/3.20.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) cmake/FindUV.cmake:25 (find_package_handle_standard_args) CMakeLists.txt:234 (find_package)

brianmcfadden commented 3 years ago

This is a very old issue, but it still exists. There is a function in src/amd/opencl/cryptonight.cl called Skein. Near the end of that function, there are 4 lines that read:

       ulong outIdx = atomic_inc(output + 0xFF);
       if (outIdx < 0xFF) {
          output[outIdx] = BranchBuf[idx] + (uint) get_global_offset(0);
       }

When I comment out those 4 lines, clBuildProgram succeeds, and xmrig-amd starts hashing, and the video display slows down terribly. You could try it out and verify whether that's where the issue lies.

Those are probably 4 lines of important code that screw up all the hashing when commented out, so this isn't a fix, but it does identify the part that's breaking. What's strange is that in the function called JH, which is the function after Skein, there is an identical code block that doesn't break. I suppose JH may never get called, and Skein does, but that's speculation on my part. Someone who knows the code better might be able to take a look at this.

d9beuD commented 3 years ago

Maybe it would be great to use Metal API instead of OpenCL. Metal is up to date and well optimized. But I can understand that it would be a huge development work.

gtu78aed87t commented 3 years ago

How would you go about to get xmrig-amd to use metal? I managed to compile it somehow on a mojave system with rx 580, but got stuck when it couldn't detect it. I have both searched for a way to either update opencl beyond 1.2 or find a gpu-miner that utilize metal.

brianmcfadden commented 3 years ago

@KhronosGroup intends to host/coordinate a project for OpenCL over Metal as part of OpenCL 3.0. AFAIK, there is no timetable, and there is some question whether that will be on the schedule at all, but I think it would be very useful here.

https://images.anandtech.com/doci/15746/OpenCL%2030%20Press%20Deck_20.png

ganzocrypt commented 3 years ago

Hi, there is fork that is working on macos AMD, tested on KaPow algo. You can check the last xmrig I posted for testing, not sure if it works on other systems.

Can someone test it and if it works which algos are working?