fireice-uk / xmr-stak-amd

Monero AMD miner
GNU General Public License v3.0
193 stars 106 forks source link

clBuildProgram error on ubuntu 16.04 + rx 480 + ROCm (AMD-APP) #48

Open gsedej opened 7 years ago

gsedej commented 7 years ago

Hello, I compiled xmr-stak-amd but when running i always get some errors. It might be driver bug. Using "ROCm" partialy opensource driver, but opencl should be AMD-APP

[2017-06-13 12:25:15] : Error CL_BUILD_PROGRAM_FAILURE when calling clBuildProgram.
error: unable to execute command: Segmentation fault (core dumped)
error: clang frontend command failed due to signal (use -v to see invocation)

config. I did try chanign settings but always same error

"gpu_thread_num" : 1,
"gpu_threads_conf" : [ 
    { "index" : 0, "intensity" : 64, "worksize" : 8, "affine_to_cpu" : true }
"platform_index" : 0,

here is the full log

$ ./bin/xmr-stak-amd config.txt 
[2017-06-13 12:25:12] : Compiling code and initializing GPUs. This will take a while...
Profiling is not available
[2017-06-13 12:25:12] : Device 0 work size 8 / 256.
clang version 4.0 
Target: amdgcn-amd-amdhsa-opencl
Thread model: posix
InstalledDir: /opt/rocm/opencl/bin/x86_64
[2017-06-13 12:25:15] : Error CL_BUILD_PROGRAM_FAILURE when calling clBuildProgram.
Build log:
warning: argument unused during compilation: '-I .'
error: unable to execute command: Segmentation fault (core dumped)
error: clang frontend command failed due to signal (use -v to see invocation)
note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
/opt/rocm/opencl/bin/x86_64/clang[0x217c00a]
/opt/rocm/opencl/bin/x86_64/clang[0x217a3be]
/opt/rocm/opencl/bin/x86_64/clang[0x217a510]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f19c6640390]
/opt/rocm/opencl/bin/x86_64/clang[0x13d53e4]
/opt/rocm/opencl/bin/x86_64/clang[0x13b88aa]
/opt/rocm/opencl/bin/x86_64/clang[0x1743007]
/opt/rocm/opencl/bin/x86_64/clang[0x20cbcea]
/opt/rocm/opencl/bin/x86_64/clang[0x20cbd83]
/opt/rocm/opencl/bin/x86_64/clang[0x20cc77f]
/opt/rocm/opencl/bin/x86_64/clang[0x598456]
/opt/rocm/opencl/bin/x86_64/clang[0x59a8a3]
/opt/rocm/opencl/bin/x86_64/clang[0x576ceb]
/opt/rocm/opencl/bin/x86_64/clang[0x8ed2ae]
/opt/rocm/opencl/bin/x86_64/clang[0x8c2ad5]
/opt/rocm/opencl/bin/x86_64/clang[0x5720bd]
/opt/rocm/opencl/bin/x86_64/clang[0x56f208]
/opt/rocm/opencl/bin/x86_64/clang[0x52326a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f19c6286830]
/opt/rocm/opencl/bin/x86_64/clang[0x5694c1]
Stack dump:
0.  Program arguments: /opt/rocm/opencl/bin/x86_64/clang -cc1 -triple amdgcn-amd-amdhsa-opencl -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name t_19803_47.bc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu fiji -dwarf-column-info -debugger-tuning=gdb -resource-dir /opt/rocm/opencl/bin/lib/clang/4.0 -O3 -fdebug-compilation-dir /home/gsedej/git/xmr-stak-amd -ferror-limit 19 -fmessage-length 192 -cl-kernel-arg-info -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all -o /tmp/t_19803_47-8cf830.o -x ir /tmp/AMD_19803_32/t_19803_47.bc 
1.  Code generation
2.  Running pass 'Function Pass Manager' on module '/tmp/AMD_19803_32/t_19803_47.bc'.
3.  Running pass 'SI Fix SGPR copies' on function '@cn0'
Error: Creating the executable failed: Compiling LLVM IRs to executable

clinfo

$ clinfo 
Profiling is not available
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.0 AMD-APP (2410.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback cl_amd_offline_devices 
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 1
  Device Name                                     gfx803
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.2 
  Driver Version                                  1.1 (HSA,LC)
  Device OpenCL C Version                         OpenCL C 2.0 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Max compute units                               36
  Max clock frequency                             1306MHz
  Device Partition                                (core)
    Max number of sub-devices                     36
    Supported partition types                     none specified
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes                 
    char                                                 4 / 4       
    short                                                2 / 2       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 1 / 1        (n/a)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Address bits                                    64, Little-Endian
  Global memory size                              8589934592 (8GiB)
  Error Correction support                        No
  Max memory allocation                           8589934592 (8GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384
  Global Memory cache line                        64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             26591
    Max size for 1D images from buffer            65536 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 128
    Max number of write image args                8
  Local memory type                               Local
  Local memory size                               65536 (64KiB)
  Max constant buffer size                        8589934592 (8GiB)
  Max number of constant args                     8
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      1ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Device 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_gl_sharing cl_amd_media_ops cl_amd_media_ops2 cl_khr_subgroups cl_khr_depth_images 

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [AMD]
  clCreateContext(NULL, ...) [default]            Success [AMD]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx803
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx803

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.8
  ICD loader Profile                              OpenCL 1.2
    NOTE:   your OpenCL library declares to support OpenCL 1.2,
        but it seems to support up to OpenCL 2.1 too.
fireice-uk commented 7 years ago

I personally never got the open source drivers to work. There are some reports, but then again some people report seeing Elvis. Using AMD's drivers is the only way afaik - but if you do manage to get it working on foss drivers, please post the steps.

gsedej commented 7 years ago

As seen in clinfo it is the AMD-APP opencl driver. It's in the phase of releasing the source code - should be same. The "Clover" is the fully open source and does not share code with AMD-APP.

I can mine with cpp-etheminer using this exact driver. Also other apps are working. Any idea where could I check for error? Googling didnt help. Should I report to driver (https://github.com/RadeonOpenCompute/ROCm)

gstoner commented 7 years ago

We are going to look into this and get back to you guys on what is going on.

gstoner commented 7 years ago

@gsedej We are close to releasing ROCm 1.6 with new update to OpenCL runtime and compiler, we check it against this release

psychocrypt commented 7 years ago

is #48 solving this issue?

gsedej commented 7 years ago

Please wait for ROCm 1.6 to be released, so I can report if it works.

gstoner commented 7 years ago

Yes, we now have compilation successful and starts with ROCm1.6.3 aka 1.6-148 currently posted at repo.rocm.com

Can you guys run it since we do not have wallet

[2017-09-04 17:12:58] : Compiling code and initializing GPUs. This will take a while... [2017-09-04 17:13:10] : Device 0 work size 8 / 256. [2017-09-04 17:13:17] : Device 1 work size 8 / 256. [2017-09-04 17:13:24] : Device 2 work size 8 / 256. [2017-09-04 17:13:32] : Device 3 work size 8 / 256. [2017-09-04 17:13:39] : Device 4 work size 8 / 256. [2017-09-04 17:13:46] : Device 5 work size 8 / 256.

xmr-stak-amd 1.1.0-1.4.0 mining software, AMD Version. AMD mining code was written by wolf9466. Brought to you by fireice_uk under GPLv3.

Configurable dev donation level is set to 1.0 %

You can use following keys to display reports: 'h' - hashrate 'r' - results 'c' - connection

[2017-09-04 17:13:53] : Starting GPU thread, no affinity. [2017-09-04 17:13:53] : Starting GPU thread, no affinity. [2017-09-04 17:13:53] : Starting GPU thread, no affinity. [2017-09-04 17:13:53] : Starting GPU thread, no affinity. [2017-09-04 17:13:53] : Starting GPU thread, no affinity. [2017-09-04 17:13:53] : Starting GPU thread, no affinity. [2017-09-04 17:13:53] : Connecting to pool pool.supportxmr.com:3333 ... [2017-09-04 17:13:54] : Connected. Logging in... [2017-09-04 17:13:54] : SOCKET ERROR - No login/password specified [2017-09-04 17:13:54] : SOCKET ERROR - RECEIVE error: socket closed [2017-09-04 17:13:54] : Pool connection lost. Waiting 10 s before retry (attempt 1). [2017-09-04 17:14:04] : Connecting to pool pool.supportxmr.com:3333 ... [2017-09-04 17:14:04] : Connected. Logging in... [2017-09-04 17:14:04] : SOCKET ERROR - No login/password specified [2017-09-04 17:14:04] : SOCKET ERROR - RECEIVE error: socket closed

kwaaak commented 7 years ago

You can run it with the donation address: 4581HhZkQHgZrZjKeCfCJxZff9E3xCgHGF25zABZz7oR71TnbbgiS7sK9jveE6Dx6uMs2LwszDuvQJgRZQotdpHt1fTdDhk

gsedej commented 7 years ago

Still the same for me (rocm 1.6-148, RX 480)

$ ./xmr-stak-amd 
[2017-09-05 12:24:27] : Compiling code and initializing GPUs. This will take a while...
[2017-09-05 12:24:27] : Device 0 work size 8 / 256.
clang version 4.0 
Target: amdgcn-amd-amdhsa-opencl
Thread model: posix
InstalledDir: /opt/rocm/opencl/bin/x86_64
[2017-09-05 12:24:29] : Error CL_BUILD_PROGRAM_FAILURE when calling clBuildProgram.
Build log:
warning: argument unused during compilation: '-I .'
error: unable to execute command: Segmentation fault (core dumped)
error: clang frontend command failed due to signal (use -v to see invocation)
note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
/opt/rocm/opencl/bin/x86_64/clang[0x223cbca]
/opt/rocm/opencl/bin/x86_64/clang[0x223af5e]
/opt/rocm/opencl/bin/x86_64/clang[0x223b0b0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fcf56d26390]
/opt/rocm/opencl/bin/x86_64/clang[0x1448e94]
/opt/rocm/opencl/bin/x86_64/clang[0x1429b81]
/opt/rocm/opencl/bin/x86_64/clang[0x17d2677]
/opt/rocm/opencl/bin/x86_64/clang[0x218586a]
/opt/rocm/opencl/bin/x86_64/clang[0x2185903]
/opt/rocm/opencl/bin/x86_64/clang[0x21862ff]
/opt/rocm/opencl/bin/x86_64/clang[0x58f356]
/opt/rocm/opencl/bin/x86_64/clang[0x5917d3]
/opt/rocm/opencl/bin/x86_64/clang[0x56da79]
/opt/rocm/opencl/bin/x86_64/clang[0x90093e]
/opt/rocm/opencl/bin/x86_64/clang[0x8d345d]
/opt/rocm/opencl/bin/x86_64/clang[0x568e5d]
/opt/rocm/opencl/bin/x86_64/clang[0x565dc8]
/opt/rocm/opencl/bin/x86_64/clang[0x5189d9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fcf5696b830]
/opt/rocm/opencl/bin/x86_64/clang[0x55fde1]
Stack dump:
0.  Program arguments: /opt/rocm/opencl/bin/x86_64/clang -cc1 -triple amdgcn-amd-amdhsa-opencl -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name t_3806_43.bc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu fiji -dwarf-column-info -debugger-tuning=gdb -resource-dir /opt/rocm/opencl/bin/lib/clang/4.0 -O3 -fdebug-compilation-dir /home/gsedej/git/xmr-stak-amd/bin -ferror-limit 19 -fmessage-length 135 -cl-kernel-arg-info -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all -o /tmp/t_3806_43-eb0160.o -x ir /tmp/AMD_3806_30/t_3806_43.bc 
1.  Code generation
2.  Running pass 'Function Pass Manager' on module '/tmp/AMD_3806_30/t_3806_43.bc'.
3.  Running pass 'SI Fix SGPR copies' on function '@cn0'
Error: Creating the executable failed: Compiling LLVM IRs to executable

There are no temporary files (/tmp/...) mention in output

fireice-uk commented 7 years ago

@gstoner some pools require you to set a password (usually it is used for the rig id), please make sure that your pool_password is not empty.

gstoner commented 7 years ago

We have it running now internally.

With the given wallet address, app is running.

[2017-09-05 15:16:00] : Compiling code and initializing GPUs. This will take a while... [2017-09-05 15:16:04] : Device 0 work size 8 / 256. [2017-09-05 15:16:10] : Device 1 work size 8 / 256. [2017-09-05 15:16:15] : Device 2 work size 8 / 256. [2017-09-05 15:16:21] : Device 3 work size 8 / 256. [2017-09-05 15:16:26] : Device 4 work size 8 / 256. [2017-09-05 15:16:32] : Device 5 work size 8 / 256.

xmr-stak-amd 1.1.0-1.4.0 mining software, AMD Version. AMD mining code was written by wolf9466. Brought to you by fireice_uk under GPLv3.

Configurable dev donation level is set to 1.0 %

You can use following keys to display reports: 'h' - hashrate 'r' - results 'c' - connection

[2017-09-05 15:16:37] : Starting GPU thread, no affinity. [2017-09-05 15:16:37] : Starting GPU thread, no affinity. [2017-09-05 15:16:37] : Starting GPU thread, no affinity. [2017-09-05 15:16:37] : Starting GPU thread, no affinity. [2017-09-05 15:16:37] : Starting GPU thread, no affinity. [2017-09-05 15:16:37] : Starting GPU thread, no affinity. [2017-09-05 15:16:37] : Connecting to pool pool.supportxmr.com:3333 ... [2017-09-05 15:16:38] : Connected. Logging in... [2017-09-05 15:16:38] : Difficulty changed. Now: 1000. [2017-09-05 15:16:38] : New block detected. [2017-09-05 15:16:39] : Result accepted by the pool. [2017-09-05 15:16:40] : Result accepted by the pool. [2017-09-05 15:16:40] : Result accepted by the pool. [2017-09-05 15:16:40] : Result accepted by the pool. [2017-09-05 15:16:40] : Result accepted by the pool. [2017-09-05 15:16:41] : Result accepted by the pool. [2017-09-05 15:16:41] : Result accepted by the pool. [2017-09-05 15:16:41] : Result accepted by the pool. [2017-09-05 15:16:41] : Result accepted by the pool. [2017-09-05 15:16:42] : Result accepted by the pool. [2017-09-05 15:16:42] : Result accepted by the pool. [2017-09-05 15:16:42] : Result accepted by the pool. [2017-09-05 15:16:42] : Result accepted by the pool. [2017-09-05 15:16:43] : Result accepted by the pool. [2017-09-05 15:16:44] : Result accepted by the pool. [2017-09-05 15:16:44] : Result accepted by the pool. [2017-09-05 15:16:44] : Result accepted by the pool. [2017-09-05 15:16:44] : Result accepted by the pool. [2017-09-05 15:16:44] : Result accepted by the pool. [2017-09-05 15:16:45] : Result accepted by the pool. [2017-09-05 15:16:45] : Result accepted by the pool. [2017-09-05 15:16:45] : Result accepted by the pool. [2017-09-05 15:16:45] : Result accepted by the pool. [2017-09-05 15:16:45] : Result accepted by the pool. [2017-09-05 15:16:46] : Result accepted by the pool. [2017-09-05 15:16:46] : Result accepted by the pool. [2017-09-05 15:16:46] : Result accepted by the pool. [2017-09-05 15:16:46] : Result accepted by the pool. [2017-09-05 15:16:47] : Result accepted by the pool. [2017-09-05 15:16:47] : Result accepted by the pool. [2017-09-05 15:16:47] : Result accepted by the pool. [2017-09-05 15:16:47] : Result accepted by the pool. [2017-09-05 15:16:47] : Result accepted by the pool. [2017-09-05 15:16:48] : Result accepted by the pool. [2017-09-05 15:16:48] : Result accepted by the pool. [2017-09-05 15:16:48] : Result accepted by the pool. [2017-09-05 15:16:48] : Result accepted by the pool. [2017-09-05 15:16:49] : Result accepted by the pool. [2017-09-05 15:16:49] : Result accepted by the pool. [2017-09-05 15:16:49] : Result accepted by the pool. [2017-09-05 15:16:49] : Result accepted by the pool. [2017-09-05 15:16:50] : Result accepted by the pool. [2017-09-05 15:16:50] : Result accepted by the pool. [2017-09-05 15:16:50] : Result accepted by the pool. [2017-09-05 15:16:50] : Result accepted by the pool. [2017-09-05 15:16:50] : Result accepted by the pool. [2017-09-05 15:16:51] : Result accepted by the pool. [2017-09-05 15:16:51] : Result accepted by the pool. [2017-09-05 15:16:51] : Result accepted by the pool. [2017-09-05 15:16:51] : Result accepted by the pool. [2017-09-05 15:16:52] : Result accepted by the pool. [2017-09-05 15:16:52] : Result accepted by the pool. [2017-09-05 15:16:53] : Result accepted by the pool. [2017-09-05 15:16:53] : Result accepted by the pool. [2017-09-05 15:16:53] : Result accepted by the pool.

rhlug commented 7 years ago

@gstoner please share how you got it to compile. what clang / llvm versions, etc.

gstoner commented 7 years ago

@rhlug it is based on a new version of OpenCL we are working on.

MoneroCrusher commented 7 years ago

@gstoner Thanks for your efforts! when will it be released? Can't wait to start mining :-)

MoneroCrusher commented 7 years ago

Can you share a kind of "beta" with us miners so we dont have to wait anymore?

MoneroCrusher commented 7 years ago

btw @gstoner did you run the above with a Vega GPU or another one?