fireice-uk / xmr-stak

Free Monero RandomX Miner and unified CryptoNight miner
GNU General Public License v3.0
4.05k stars 1.79k forks source link

0H/s on RX Vega 56 Ubuntu 18.04 LTS #2238

Closed ghost closed 5 years ago

ghost commented 5 years ago

Good evening My new RX Vega 56 reports 0H/s, in benchmark as well as in real mining mode:

[2019-02-13 22:18:19] : Starting AMD GPU (OpenCL) thread 0, no affinity.
[2019-02-13 22:18:19] : Starting AMD GPU (OpenCL) thread 1, no affinity.
[2019-02-13 22:18:19] : Wait 5 sec until all backends are initialized
[2019-02-13 22:18:24] : Start a 30 second benchmark...
[2019-02-13 22:18:54] : Benchmark Thread 0 amd: 0.0 H/S
[2019-02-13 22:18:54] : Benchmark Thread 1 amd: 0.0 H/S
[2019-02-13 22:18:54] : Benchmark Total: 0.0 H/S

Do you have an idea where this could come from? Thank you

Basic information

CPU: 2x Intel Xeon E5-2680 GPU: Gigabyte Radeon RX Vega 56 RAM: 16GB DDR3 ECC Board: EP2C602-4L/D16 Onboard GPU: Aspeed AST2300 OS: Ubuntu 18.04 LTS Kernel: 4.15.0-45-generic

The very same system worked fine with two Radeon R9 390 cards, one was in the same slot the Vega 56 is in now.

Issue with the execution

AMD OpenCl issue

Driver in use: ROCm 1.9.2

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

  Platform Name:                 AMD Accelerated Parallel Processing
Number of devices:               1
  Device Type:                   CL_DEVICE_TYPE_GPU
  Vendor ID:                     1002h
  Board name:                    Vega 10 XL/XT [Radeon RX Vega 56/64]
  Device Topology:               PCI[ B#131, D#0, F#0 ]
  Max compute units:                 56
  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:               1590Mhz
  Address bits:                  64
  Max memory allocation:             7287183769
  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:            26751
  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:                     Yes
    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:                8573157376
  Constant buffer size:              7287183769
  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:              2992216473
  Max global variable size:          7287183769
  Max global variable preferred total size:  8573157376
  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:                   0x7f1033a7fdf0
  Name:                      gfx900
  Vendor:                    Advanced Micro Devices, Inc.
  Device OpenCL C version:           OpenCL C 2.0 
  Driver version:                2679.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_subgroups cl_khr_depth_images cl_amd_copy_buffer_p2p cl_amd_assembly_program 

Stability issue

psychocrypt commented 5 years ago

please run it once without benchmark imo the compiling takes to long. the next start will be faster and you can benchmark the code

ghost commented 5 years ago

Thank you for your answer. I deleted all old OpenCL kernels from ~/.openclcache, recompiled xmr-stak and started it directly without benchmark mode. Unfortunately this did not change anything, the Vega is still running at 0H/s.

But I saw one thing: The compile time is quite long anyway, even without benchmark mode:

[2019-02-14 09:29:35] : Mining coin: cryptonight_v8
[2019-02-14 09:29:35] : Found AMD platform index id = 0, name = Advanced Micro Devices, Inc.
[2019-02-14 09:29:35] : Found OpenCL GPU gfx900.
[2019-02-14 09:29:35] : AMD: GPU (OpenCL) configuration stored in file 'amd.txt'
[2019-02-14 09:29:35] : Compiling code and initializing GPUs. This will take a while...
[2019-02-14 09:29:35] : Device 0 work size 8 / 32.
[2019-02-14 09:29:35] : OpenCL device 0 - Precompiled code /home/user/.openclcache/ef1197448c744f93a4d685e3792b5643922091f70b031c683efb8302fd980f7c.openclbin not found. Compiling ...
[2019-02-14 09:29:53] : OpenCL device 0 - Precompiled code stored in file /home/user/.openclcache/ef1197448c744f93a4d685e3792b5643922091f70b031c683efb8302fd980f7c.openclbin
[2019-02-14 09:29:53] : Device 0 work size 8 / 32.
[2019-02-14 09:29:53] : OpenCL device 0 - Load precompiled code from file /home/user/.openclcache/ef1197448c744f93a4d685e3792b5643922091f70b031c683efb8302fd980f7c.openclbin
[2019-02-14 09:29:53] : Starting AMD GPU (OpenCL) thread 0, no affinity.
[2019-02-14 09:29:53] : Starting AMD GPU (OpenCL) thread 1, no affinity.

Another OpenCL app I have on this machine fails with Error clBuildProgramm -11 Is it possible that LLVM causes this?

psychocrypt commented 5 years ago

Yes could be that your opencl is somehow broken. I use mostly the rocm driver under linux. maybe give it a try

ghost commented 5 years ago

Well, this already is ROCm The newest ROCm (2.1) needs atomic PCI Express operations to work properly, which are not supported by my old CPUs unfortunately. That's why I'm running ROCm 1.9.2 which works fine without PCI atomics.

I assume it's the enabled onboard GPU that causes the trouble, even though I have no idea why my R9 390s worked fine with exactly this setup...

Do you have some simple OpenCL tool I can test/debug my setup with?

As I have no physical access to my machine currently to disable the mainboard's GPU, I will try to fix this on software level (maybe some kernel params at boot?)

ghost commented 5 years ago

This looks like an issue with ROCm driver. I could fix this anyway by using amdgpu-pro 18.50 instead and additionally installing libdrm-amdgpu1 via

sudo apt install libdrm-amdgpu1

It did not work without this package, don't ask me why... Anyway, it works now. Thank you