mimblewimble / grin-miner

Standalone miner for grin
Apache License 2.0
296 stars 153 forks source link

ocl_cuckaroo plugin crash with AMD (Mac Pro) #199

Open timetoseek opened 5 years ago

timetoseek commented 5 years ago

The "ocl_cuckaroo" plugin crashes immediately on my Mac Pro 2012 (Mojave), with 2 CPU's (12 cores total), and an AMD Radeon RX 580 (8GB). Here is the section of "grin-miner.toml" with applicable configurations: plugin_name = "ocl_cuckaroo" [mining.miner_plugin_config.parameters] platform = 0 device = 1

Screen print of the crash is as follows: ocl_cuckaroo_plugin_crash

What is interesting is that I am able to run the "ocl_cuckatoo" plugin just fine, as well as the "cuckaroo_cpu_compat_29", works OK. Screen prints are as follows:

ocl_cuckatoo_plugin_works

cuckaroo_cpu_compat_29_plugin_works

timetoseek commented 5 years ago

What is interesting is that I am able to run the "ocl_cuckatoo" plugin just fine, as well as the "cuckaroo_cpu_compat_29", works OK. Screen prints are as follows:

Update: after running the "ocl_cuckatoo" plugin overnight, there were no shares accepted (!), so there's possibly a bug in "ocl_cuckatoo" or some compatibility issue with my AMD card... In any case, I've stopped running the "ocl_cuckatoo" plugin on my Mac Pro, and now just running a Grin node & wallet, and Grin-Miner with the "cuckaroo_cpu_compat_29" plugin (which does accept shares).

timetoseek commented 5 years ago

another screen shot of the crash of "ocl_cuckaroo" plugin, plus additional information about th GPU used...

ocl_cuckaroo_crash_no_ui


GPU_info

hashmap commented 5 years ago

Could you post an output of clinfo command? Some cards shows 256 as max wg size, while in reality RX 580 supports 1024, so we try to fix it here https://github.com/mimblewimble/grin-miner/blob/master/ocl_cuckaroo/src/trimmer.rs#L91 it seems it doesn't work in your case

timetoseek commented 5 years ago

Could you post an output of clinfo command?

Yes, please see links below:

clinfo_mac_format.txt


clinfo_dos_format.txt

hashmap commented 5 years ago

Thanks. That's what I said:

 Max work item sizes                             256x256x256
 Max work group size                             256

we have no problem to set the correct value (1024) on linux, obv it doesn't work on mac. Perhaps you can find a way to somehow set it manually while I'll try to find a solution. Unfortunately I don't have an amd card to test with mac, so may need your assistance.

timetoseek commented 5 years ago

OK, I'll see what I can do to set it manually (?), not sure how this can be done but I'll dig around.. Also, would be glad to help you with testing, no problem...

timetoseek commented 5 years ago

After doing some digging/tweaking, I am unfortunately unable to get the ocl_cuckaroo plugin to work on macOS... all out of ideas at this point... if you have any ideas or testing for me, then please let me know, would be glad to help... thank you!

timetoseek commented 5 years ago

Still trying to get ocl_cuckaroo plugin to work for macOS. Have also tried to compile using Xcode, but still the ocl_cuckaroo plugin crashes due to the Max workgroup size issue mentioned above... By the way, there is some helpful information about max workgroup size in this thread: https://github.com/RadeonOpenCompute/ROCm/issues/330

hashmap commented 5 years ago

I wonder why you have only Apple platform. Is it possible to install AMD drivers?

timetoseek commented 5 years ago

That is a good question... the AMD graphics driver is part of the operating system, so there are no additional drivers needed or available...

One additional note-- the macOS version of OpenCL is quite ancient, and unlikely to be updated (Apple is suggesting developers adopt Metal instead of OpenCL)... actually, OpenCL was depreciated in Mojave (in other words, the deprecated APIs will be removed entirely from future versions of macOS :worried:

Here is the announcement from Apple, please read towards the end of the article...Deprecation of OpenCL

weibel commented 3 years ago

This issue is a bit old but does anyone know if there since has been any work done to support metal on MacOS e.g. through https://github.com/gfx-rs/gfx or https://github.com/gfx-rs/wgpu-rs ?