AMD grin-miner error

OS: Ubuntu 18.04 server edition
GPUS: RX580

I’m trying to run RX580 GPUs to mine grin. So far I have done the following.

  • ran ./install_ocl_plugins.sh
  • commented out the [[mining.miner_plugin_config]] to the end of the file in grin-miner.toml
  • compiled grin-miner

Is the above all that needs done ( above and beyond the basic grin-miner install instructions ) to get grin-miner working with AMD GPUs? I ask because when I run grin-miner I get the following error:

Unable to get platform id list after 10 seconds of waiting. ', libcore/result.rs:10095Size

i’ve put together this quick howto for linux miners with AMD polaris/vega gpus (you need a gpu with 8GB vram)

1.) build grin-miner on linux
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
git clone https://github.com/mimblewimble/grin-miner.git
cd grin-miner
git submodule update --init
cargo build --release --features opencl

2.) install the miner to a specific location/dir
mkdir -p /opt/grin-miner/plugins
cp grin-miner.toml /opt/grin-miner
cp target/release/grin-miner /opt/grin-miner
cp target/release/plugins/*.cuckooplugin /opt/grin-miner/plugins
cp target/release/deps/libocl_cuckaroo.so /opt/grin-miner/plugins/ocl_cuckaroo.cuckooplugin

3.) configure the miner (edit the /opt/grin-miner/grin-miner.toml file)

  • if you are not running your own node, you have to point the miner to a public pool (for example grinmint.com).
    so, change stratum server related options in grin-miner.toml according to https://grinmint.com/pages/help.html
    stratum_server_addr = “us-east-stratum.grinmint.com:3416
    stratum_server_login = "satoshi+randomvalue@nakamoto.com/rig21"
    stratum_server_password = “myverystrongpassword”
    stratum_server_tls_enabled = false

  • you have to comment out the cpu plugin(s) in grin-miner.toml
    cpu mining does not make sense at all and you will need some cpu power for the amd ocl plugin as well.

    #[[mining.miner_plugin_config]]
    #plugin_name = “cuckaroo_cpu_compat_29”
    #[mining.miner_plugin_config.parameters]
    #nthreads = 1

  • the correct plugin for AMD is ocl_cuckaroo (not ocl_cuckatoo) and you have to specify the plugin for each gpu in grin-miner.toml
    example for 4 gpu (maybe you will need to change the platform value from 0 to 1 or 2):

    [[mining.miner_plugin_config]]
    plugin_name = “ocl_cuckaroo”
    [mining.miner_plugin_config.parameters]
    platform = 0
    device = 0

    [[mining.miner_plugin_config]]
    plugin_name = “ocl_cuckaroo”
    [mining.miner_plugin_config.parameters]
    platform = 0
    device = 1

    [[mining.miner_plugin_config]]
    plugin_name = “ocl_cuckaroo”
    [mining.miner_plugin_config.parameters]
    platform = 0
    device = 2

    [[mining.miner_plugin_config]]
    plugin_name = “ocl_cuckaroo”
    [mining.miner_plugin_config.parameters]
    platform = 0
    device = 3

4.) run the miner from the installation dir
cd /opt/grin-miner ; ./grin-miner

Please post output of clinfo command. You need opencl support installed see https://amdgpu-install.readthedocs.io/en/latest/install-installing.html

I’m having troubles mining with a rig containing five RX580s.

Using the config above (plus the latest amdgpu drivers described below) I’m able to mine with a single GPU. I’m getting a hash rate of about 16 GPS, which I believe is in line with what other RX580s miner. I also confirmed that it is indeed a GPU that is running, not the CPU.

When I add multiple GPU to the configuration file like below, I will still see only 1 GPU mining, until I add more four or more GPUs in the config file. When the config file contains four or more GPUs, none of the GPUs hash.

(I am using the GrintMint mining pool, and do see correct RPC messages in the Grin client and a confirmation in the GrinMint dashboard that GrinMint is receiving hashes from the rig. When mining other coins like Ethereum, all five GPUs work.)

Is this is an issue that anyone is familiar with? How do I get all to mine using all five RX580s?

[[mining.miner_plugin_config]]
plugin_name = "ocl_cuckaroo"
[mining.miner_plugin_config.parameters]
platform = 1 # according to docs AMD is platform 1, but changing it to 0 doesn't have any effect
device = 0

[[mining.miner_plugin_config]]
plugin_name = "ocl_cuckaroo"
[mining.miner_plugin_config.parameters]
platform = 1
device = 1

etc...

add gpus to the config one by one and see when the miner stops to work. i guess the miner hangs on one of the gpu. lower the mem clock as well, start with the stock memory clock. this algo utilises the gpu memory differently compared to ethash.

Hello,
Thanks for the great guide.
Is it possible to use RX 580/480 8GB to mine C31?
I followed your guide and while running “cargo build --release --features opencl”
is have an error:
= note: /usr/bin/ld: cannot find -lOpenCL
/usr/bin/ld: cannot find -lOpenCL
collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile ocl_cuckaroo.
warning: build failed, waiting for other jobs to finish…
error: build failed

But, I use not the official driver, I installed ROCm 2.0 - is it the problem?

you can mine c31 with the lean miner included in grin-miner (ocl_cuckatoo)
the compiler is searching libOpenCL.so in /usr/lib/x86_64-linux-gnu directory.
on ubuntu, you can install package ocl-icd-libopencl1 or create a symlink in the mentioned dir to libOpenCL.so provided by ROCm.
ROCm requires PCIe atomics for Polaris and will only work on RX580/480 connected to the first or second PCIe x16 slots (depends on chipset).

Try following this guide: https://ethmonitoring.com/guide#ethmonitoring-os (one rig is free anyway)

Thank you for the explanation. I have 1GPU in my system based on Ryzen 1900. I’ve played with the different settings and setups. The only problem I have is to run original grin miner for C31 with ROCm:

Linux Ubuntu 18.04.1 desktop + standard AMD
GrinGoldMiner 2.9 C29 = 1.80
Grin Miner 1.0.2 C29 = 1.61
Grin Miner 1.0.2 C31 = 0.11
Ryzen 1900X C29 = 0.52
Ryzen 1900X C31 = 0.10

Linux Ubuntu 18.04.1 desktop + ROCm 2.1
GrinGoldMiner 2.9 C29 = 2.15
Grin Miner 1.0.2 downloaded C29 = 2.05
Grin Miner 1.0.2 downloaded C31 = ERROR
Here I have an error:

Waiting for solvers to shutdown...
/tmp/AMD_3741_18/t_3741_20.cl:55:15: error: variables in the local address space can only be declared in the outermost
      scope of a kernel function
                __local u32 el[256][8];
                            ^
1 error generated.
thread '<unnamed>' panicked at 'can't build trimmer: 

###################### OPENCL PROGRAM BUILD DEBUG OUTPUT ######################

Error: Failed to compile opencl source (from CL to LLVM IR).
###############################################################################

', src/libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Have no idea how to fix. Tried to setup LLVM_BIN=/opt/rocm/opencl/bin/x86_64 - didn’t work.

you have two options,
you can use my guide below to install the pre compilled version of Grin-Miner (from original Github), or you could edit i think is the trimmer.rs file on the ocl_cuckatoo/src folder


you edit to move the definition of that variable to outer scope! (you may find another error with the ‘util’ not being defined, if so, just say and i’ll help you)

this is a guide on how to do it with the pre compiled version, that I’ve tested with ROCm on Ubuntu 18.04.1:

sudo apt-get update
sudo apt-get install wget
cd ~
mkdir grin
cd grin

wget https://github.com/mimblewimble/grin-miner/releases/download/v1.0.2/grin-miner-v1.0.2-480780314-linux-amd64.tgz

tar -vxzf grin-miner-v1.0.2-480780314-linux-amd64.tgz
cd grin-miner-v1.0.2

nano grin-miner.toml

(EDIT YOUR CONFIG! with nano or use something better)

./grin-miner 

BTW, i’m in no way directly connected to the GRIN team, i’m just trying to help…

if any of you need to install amd drivers first, follow this(assuming you already crated the grin directory):

cd ~/grin

wget https://drivers.amd.com/drivers/linux/amdgpu-pro-18.50-725072-ubuntu-18.04.tar.xz

tar -vxJf amdgpu-pro-18.50-725072-ubuntu-18.04.tar.xz

cd amdgpu-pro-18.50-725072-ubuntu-18.04

./amdgpu-pro-install 

or

./amdgpu-install 

just did this without testing it but it should work!

This will install OpenCL and resto of the driver and features for normal Graphics Cards under 18.04.1.

Tell-me if it all works! :wink:

Hey. Thanks. This works for me - edit .rs and rebuild plugin.
Actually that’s interesting, because I have no errors with Official AMD + Pre-Compiled/Compiled, but had only the issue with the ROCm and C31.

P.s.: I’m planning to buy Radeon VII. Which plugin should I use for it for C31 to use all the 16GB of memory?

me too. I already ordered one!

Well i don’t think there is an AMD miner that can take advantage of more than 8GB RAM, that would be great actually.

I think your best shot for now is the MinerBabe’s KBminer, but it uses the lean approach if I’m not mistaken, it would be great to have an alternative with the mean approach for AMD…

I tried your precompiled guide and I get the trimmer error. I am using rocm. If I use cuckaroo ie c29 it works fine.

Any ideas?

I tried the op guide building it from scratch, then edited the trimmer file but im only getting .1634 gps for a vega 64. With minerbabe I get .41.

The same for RX 480. Minerbabe = 0.215, grin miner 1.0.2 = 0.105.
Looks like they optimised the solver.

Yes, 0.16 GPS on VEGA 64 and 0.10 on RX480 is exactly what i was getting on my rigs…
So i switched to MinerBabe…