1

I'm trying to GPU mine Monero with xmrig. I am newly updated on Ubunto 20.04, coming from 16.04 with a fresh install. I am stuck on is getting my AMD Radeon 580 GPU working with xmrig. AMD does not support drivers for Ubuntu after 16.04. I have installed OPENCL from this below page. And, I hope I installed the right software.

https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html

While following along with the advice of this video: https://www.youtube.com/watch?v=efKjfBkjPlM

To check for successful completion I have rocminfo and clinfo comands.

Result of rocminfo is:

joe@joeslinux:~$ /opt/rocm/bin/rocminfo

ROCk module is loaded
joe is member of video group
=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.1
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE                              
System Endianness:       LITTLE                             

==========               
HSA Agents               
==========               
*******                  
Agent 1                  
*******                  
  Name:                    AMD Ryzen Threadripper 1950X 16-Core Processor
  Marketing Name:          AMD Ryzen Threadripper 1950X 16-Core Processor
  Vendor Name:             CPU                                
  Feature:                 None specified                     
  Profile:                 FULL_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        0(0x0)                             
  Queue Min Size:          0(0x0)                             
  Queue Max Size:          0(0x0)                             
  Queue Type:              MULTI                              
  Node:                    0                                  
  Device Type:             CPU                                
  Cache Info:              
    L1:                      32768(0x8000) KB                   
  Chip ID:                 0(0x0)                             
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   3400                               
  BDFID:                   0                                  
  Internal Node ID:        0                                  
  Compute Unit:            32                                 
  SIMDs per CU:            0                                  
  Shader Engines:          0                                  
  Shader Arrs. per Eng.:   0                                  
  WatchPts on Addr. Ranges:1                                  
  Features:                None
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    65778612(0x3ebb3b4) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Acessible by all:        TRUE                               
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    65778612(0x3ebb3b4) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Acessible by all:        TRUE                               
  ISA Info:                
    N/A                      
*******                  
Agent 2                  
*******                  
  Name:                    gfx803                             
  Marketing Name:          Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
  Vendor Name:             AMD                                
  Feature:                 KERNEL_DISPATCH                    
  Profile:                 BASE_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        128(0x80)                          
  Queue Min Size:          4096(0x1000)                       
  Queue Max Size:          131072(0x20000)                    
  Queue Type:              MULTI                              
  Node:                    1                                  
  Device Type:             GPU                                
  Cache Info:              
    L1:                      16(0x10) KB                        
  Chip ID:                 26591(0x67df)                      
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   1340                               
  BDFID:                   16640                              
  Internal Node ID:        1                                  
  Compute Unit:            36                                 
  SIMDs per CU:            4                                  
  Shader Engines:          4                                  
  Shader Arrs. per Eng.:   1                                  
  WatchPts on Addr. Ranges:4                                  
  Features:                KERNEL_DISPATCH 
  Fast F16 Operation:      FALSE                              
  Wavefront Size:          64(0x40)                           
  Workgroup Max Size:      1024(0x400)                        
  Workgroup Max Size per Dimension:
    x                        1024(0x400)                        
    y                        1024(0x400)                        
    z                        1024(0x400)                        
  Max Waves Per CU:        40(0x28)                           
  Max Work-item Per CU:    2560(0xa00)                        
  Grid Max Size:           4294967295(0xffffffff)             
  Grid Max Size per Dimension:
    x                        4294967295(0xffffffff)             
    y                        4294967295(0xffffffff)             
    z                        4294967295(0xffffffff)             
  Max fbarriers/Workgrp:   32                                 
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    8388608(0x800000) KB               
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Acessible by all:        FALSE                              
    Pool 2                   
      Segment:                 GROUP                              
      Size:                    64(0x40) KB                        
      Allocatable:             FALSE                              
      Alloc Granule:           0KB                                
      Alloc Alignment:         0KB                                
      Acessible by all:        FALSE                              
  ISA Info:                
    ISA 1                    
      Name:                    amdgcn-amd-amdhsa--gfx803          
      Machine Models:          HSA_MACHINE_MODEL_LARGE            
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Size:      1024(0x400)                        
      Workgroup Max Size per Dimension:
        x                        1024(0x400)                        
        y                        1024(0x400)                        
        z                        1024(0x400)                        
      Grid Max Size:           4294967295(0xffffffff)             
      Grid Max Size per Dimension:
        x                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
*** Done ***             

clinfo is a stranger. Running clinfo, I got:

joe@joeslinux:~$ clinfo
terminate called after throwing an instance of 'cl::Error'
  what():  clGetPlatformIDs
Aborted (core dumped)

Running it from the directory got a different error:

joe@joeslinux:~$ /opt/rocm/opencl/bin/x86_64/clinfo
ERROR: clGetPlatformIDs(-1001)

Running it with sudo from the directory got what appears to be valid output. joe@joeslinux:~$ sudo /opt/rocm/opencl/bin/x86_64/clinfo

Number of platforms:                 1
  Platform Profile:              FULL_PROFILE
  Platform Version:              OpenCL 2.1 AMD-APP (3098.0)
  Platform Name:                 AMD Accelerated Parallel Processing
  Platform Vendor:               Advanced Micro Devices, Inc.
  Platform Extensions:               cl_khr_icd cl_amd_event_callback cl_amd_offline_devices 


  Platform Name:                 AMD Accelerated Parallel Processing
Number of devices:               1
  Device Type:                   CL_DEVICE_TYPE_GPU
  Vendor ID:                     1002h
  Board name:                    Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
  Device Topology:               PCI[ B#65, D#0, F#0 ]
  Max compute units:                 36
  Max work items dimensions:             3
    Max work items[0]:               1024
    Max work items[1]:               1024
    Max work items[2]:               1024
  Max work group size:               256
  Preferred vector width char:           4
  Preferred vector width short:          2
  Preferred vector width int:            1
  Preferred vector width long:           1
  Preferred vector width float:          1
  Preferred vector width double:         1
  Native vector width char:          4
  Native vector width short:             2
  Native vector width int:           1
  Native vector width long:          1
  Native vector width float:             1
  Native vector width double:            1
  Max clock frequency:               1340Mhz
  Address bits:                  64
  Max memory allocation:             7301444403
  Image support:                 Yes
  Max number of images read arguments:       128
  Max number of images write arguments:      8
  Max image 2D width:                16384
  Max image 2D height:               16384
  Max image 3D width:                2048
  Max image 3D height:               2048
  Max image 3D depth:                2048
  Max samplers within kernel:            26591
  Max size of kernel argument:           1024
  Alignment (bits) of base address:      1024
  Minimum alignment (bytes) for any datatype:    128
  Single precision floating point capability
    Denorms:                     No
    Quiet NaNs:                  Yes
    Round to nearest even:           Yes
    Round to zero:               Yes
    Round to +ve and infinity:           Yes
    IEEE754-2008 fused multiply-add:         Yes
  Cache type:                    Read/Write
  Cache line size:               64
  Cache size:                    16384
  Global memory size:                8589934592
  Constant buffer size:              7301444403
  Max number of constant args:           8
  Local memory type:                 Scratchpad
  Local memory size:                 65536
  Max pipe arguments:                16
  Max pipe active reservations:          16
  Max pipe packet size:              3006477107
  Max global variable size:          7301444403
  Max global variable preferred total size:  8589934592
  Max read/write image args:             64
  Max on device events:              1024
  Queue on device max size:          8388608
  Max on device queues:              1
  Queue on device preferred size:        262144
  SVM capabilities:              
    Coarse grain buffer:             Yes
    Fine grain buffer:               Yes
    Fine grain system:               No
    Atomics:                     No
  Preferred platform atomic alignment:       0
  Preferred global atomic alignment:         0
  Preferred local atomic alignment:      0
  Kernel Preferred work group size multiple:     64
  Error correction support:          0
  Unified memory for Host and Device:        0
  Profiling timer resolution:            1
  Device endianess:              Little
  Available:                     Yes
  Compiler available:                Yes
  Execution capabilities:                
    Execute OpenCL kernels:          Yes
    Execute native function:             No
  Queue on Host properties:              
    Out-of-Order:                No
    Profiling :                  Yes
  Queue on Device properties:                
    Out-of-Order:                Yes
    Profiling :                  Yes
  Platform ID:                   0x7fe7119b5d30
  Name:                      gfx803
  Vendor:                    Advanced Micro Devices, Inc.
  Device OpenCL C version:           OpenCL C 2.0 
  Driver version:                3098.0 (HSA1.1,LC)
  Profile:                   FULL_PROFILE
  Version:                   OpenCL 1.2 
  Extensions:                    cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_gl_sharing cl_amd_device_attribute_query cl_amd_media_ops cl_amd_media_ops2 cl_khr_image2d_from_buffer cl_khr_subgroups cl_khr_depth_images cl_amd_copy_buffer_p2p cl_amd_assembly_program 

clinfo and it’s folder are owned by 1001. I know that this means there is no owner 1001.

drwxrwxr-x  5 1001 1001 4096 May 17 22:28 opencl

I changed owner to root. Then I ran the clinfo command agaion, but that made no difference.

When I run xmrig here's my output:

joe@joeslinux:~$ ./mine-monero-SupportXMR-GPU.sh 
 * ABOUT        XMRig/5.11.1 gcc/5.4.0
 * LIBS         libuv/1.34.0 OpenSSL/1.1.1d hwloc/2.1.0
 * HUGE PAGES   supported
 * 1GB PAGES    disabled
 * CPU          AMD Ryzen Threadripper 1950X 16-Core Processor (1) x64 AES
                L2:8.0 MB L3:32.0 MB 16C/32T NUMA:1
 * MEMORY       12.2/62.7 GB (19%)
 * DONATE       5%
 * ASSEMBLY     auto:ryzen
 * POOL #1      pool.supportxmr.com:443 algo auto
 * COMMANDS     hashrate, pause, resume
 * HTTP API     127.0.0.1:34931 
 * OPENCL       disabled
 * CUDA         disabled
[2020-06-01 20:59:02.330]  net  use pool pool.supportxmr.com:443 TLSv1.2 104.140.244.186
[2020-06-01 20:59:02.331]  net  fingerprint (SHA-256): "676f843ef4cda0f72578b7589eedb13f4ca79f636b6a4e57eb38847c8f679d93"
[2020-06-01 20:59:02.331]  net  new job from pool.supportxmr.com:443 diff 50000 algo rx/0 height 2111473
[2020-06-01 20:59:02.333]  msr  msr kernel module is not available
[2020-06-01 20:59:02.333]  rx   init dataset algo rx/0 (32 threads) seed bcefb824c61d2171...
[2020-06-01 20:59:02.334]  rx   allocated 2336 MB (2080+256) huge pages 0% 0/1168 +JIT (0 ms)
[2020-06-01 20:59:04.631]  rx   dataset ready (2298 ms)
[2020-06-01 20:59:04.632]  cpu  use profile  rx  (16 threads) scratchpad 2048 KB
[2020-06-01 20:59:04.936]  cpu  READY threads 16/16 (16) huge pages 0% 0/16 memory 32768 KB (305 ms)
[2020-06-01 20:59:06.349] Ctrl+C received, exiting
[2020-06-01 20:59:06.354]  cpu  stopped (4 ms)
joe@joeslinux:~$ 

Sometimes the error line is:

  • OPENCL disabled (failed to load OpenCL runtime)

Did I install the right software for Open CL? Should I be using xmrig in the first place?

Thank you in advance.

5
  • Monero RandomX algorithm is CPU only. While it's possible to mine using GPU the resulting H/s is ridiculously low, and you would be burning electrons for no gain. Commented Jun 2, 2020 at 3:34
  • 1
    If you want to spend the energy to mine w/ GPU (probably not worth it, but feel free), it needs to be enabled in the config file. Based on the output, it says it's disabled. Commented Jun 2, 2020 at 18:44
  • Thank you both @scoobybejesus and Morgens TrasherDK. So, I don't understand something, I always knew Monero to be CPU/GPU minable while being ASIC resistant. And to further validate that assumption the config wizard at xmrig.com/wizard#backends offers to add GPU mining to my configuration. What are the developers of xmrig telling us about GPU mining when they offer that option? Thank you
    – JoeM
    Commented Jun 4, 2020 at 13:35
  • 1
    You need to get caught up on RandomX. monero.stackexchange.com/questions/11445/… and others Commented Jun 4, 2020 at 16:11
  • sudo apt install ocl-icd-opencl-dev xmrig couldn't find libOpenCL.so Commented Feb 28, 2021 at 20:46

1 Answer 1

2

I've tried to install OpenCl from numerous instructions I found all around the web. Most were an exercise in frustration. This is the one that worked for me. https://gist.github.com/kytulendu/3351b5d0b4f947e19df36b1ea3c95cbe

Oh, and this whole thing wasn't solely about mining monero with a GPU, that was just the first tangential application for getting OpenCL working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.