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

UNKNOWN_ERROR when calling clGetPlatformIDs with RX 580 on Centos 7 #2007

Open liam-b opened 6 years ago

liam-b commented 6 years ago

Basic information

Type of the CPU Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz

Type of the GPU Gigabyte Radeon RX 580 8g

Compile issues

Which OS do you use? CentOS 7.4.1708 and Linux version 3.10.0-693.5.2.el7.x86_64

$ cmake3 .. -DCUDA_ENABLE=OFF -DMICROHTTPD_ENABLE=OFF
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /home/linuxbrew/.linuxbrew/bin/cc
-- Check for working C compiler: /home/linuxbrew/.linuxbrew/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/linuxbrew/.linuxbrew/bin/c++
-- Check for working CXX compiler: /home/linuxbrew/.linuxbrew/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - found
-- Found OpenCL: /usr/lib/libOpenCL.so (found version "2.2") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenSSL: /home/linuxbrew/.linuxbrew/Cellar/openssl/1.0.2m/lib/libcrypto.so (found version "1.0.2m")  
-- The ASM compiler identification is GNU
-- Found assembler: /home/linuxbrew/.linuxbrew/bin/cc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nbrennan/Documents/xmr/latest/xmr-stak/build
$ make install
Scanning dependencies of target xmr-stak-asm
[  3%] Building ASM object CMakeFiles/xmr-stak-asm.dir/xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.S.o
[  6%] Linking C static library bin/libxmr-stak-asm.a
[  6%] Built target xmr-stak-asm
Scanning dependencies of target xmr-stak-c
[  9%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_blake256.c.o
[ 12%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_groestl.c.o
[ 15%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_jh.c.o
[ 18%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_keccak.c.o
[ 21%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_skein.c.o
[ 24%] Linking C static library bin/libxmr-stak-c.a
[ 24%] Built target xmr-stak-c
Scanning dependencies of target xmr-stak-backend
[ 27%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/backendConnector.cpp.o
[ 30%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/cpuType.cpp.o
[ 33%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_common.cpp.o
[ 36%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/hwlocMemory.cpp.o
[ 39%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/jconf.cpp.o
[ 42%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o
[ 45%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/globalStates.cpp.o
[ 48%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/httpd.cpp.o
[ 51%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/webdesign.cpp.o
[ 54%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/jconf.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/console.cpp.o
[ 60%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/executor.cpp.o
[ 63%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/telemetry.cpp.o
[ 66%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/uac.cpp.o
[ 69%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/utility.cpp.o
[ 72%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/jpsock.cpp.o
[ 75%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/socket.cpp.o
[ 78%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/version.cpp.o
[ 81%] Linking CXX static library bin/libxmr-stak-backend.a
[ 81%] Built target xmr-stak-backend
Scanning dependencies of target xmr-stak
[ 84%] Building CXX object CMakeFiles/xmr-stak.dir/xmrstak/cli/cli-miner.cpp.o
[ 87%] Linking CXX executable bin/xmr-stak
[ 87%] Built target xmr-stak
Scanning dependencies of target xmrstak_opencl_backend
[ 90%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/amd_gpu/gpu.cpp.o
[ 93%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/jconf.cpp.o
[ 96%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/minethd.cpp.o
[100%] Linking CXX shared library bin/libxmrstak_opencl_backend.so
[100%] Built target xmrstak_opencl_backend
Install the project...
-- Install configuration: "Release"
xmr-stak installed to folder 'bin'
$ ./xmr-stak 
-------------------------------------------------------------------
xmr-stak 2.5.1 4e72408

Brought to you by fireice_uk and psychocrypt under GPLv3.
Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).
Based on OpenCL mining code by wolf9466.

Configurable dev donation level is set to 1.0%

-------------------------------------------------------------------
You can use following keys to display reports:
'h' - hashrate
'r' - results
'c' - connection
-------------------------------------------------------------------
Upcoming xmr-stak-gui is sponsored by:
   #####   ______               ____
 ##     ## | ___ \             /  _ \
#    _    #| |_/ /_   _   ___  | / \/ _   _  _ _  _ _  ___  _ __    ___  _   _
#   |_|   #|    /| | | | / _ \ | |   | | | || '_|| '_|/ _ \| '_ \  / __|| | | |
#         #| |\ \| |_| || (_) || \_/\| |_| || |  | | |  __/| | | || (__ | |_| |
 ##     ## \_| \_|\__, | \___/ \____/ \__,_||_|  |_|  \___||_| |_| \___| \__, |
   #####           __/ |                                                  __/ |
                  |___/   https://ryo-currency.com                       |___/

This currency is a way for us to implement the ideas that we were unable to in
Monero. See https://github.com/fireice-uk/cryptonote-speedup-demo for details.
-------------------------------------------------------------------
[2018-10-24 21:19:27] : Mining coin: monero
[2018-10-24 21:19:27] : WARNING: UNKNOWN_ERROR when calling clGetPlatformIDs for number of platforms.
[2018-10-24 21:19:27] : WARNING: No OpenCL platform found.
[2018-10-24 21:19:27] : WARNING: No AMD OpenCL platform found. Possible driver issues or wrong vendor driver.
[2018-10-24 21:19:27] : WARNING: backend AMD (OpenCL) disabled.
[2018-10-24 21:19:27] : Starting 1x thread, affinity: 0.
[2018-10-24 21:19:27] : hwloc: memory pinned
[2018-10-24 21:19:27] : Starting 1x thread, affinity: 1.
[2018-10-24 21:19:27] : hwloc: memory pinned
[2018-10-24 21:19:27] : Starting 1x thread, affinity: 2.
[2018-10-24 21:19:27] : hwloc: memory pinned
[2018-10-24 21:19:27] : Starting 1x thread, affinity: 3.
[2018-10-24 21:19:27] : hwloc: memory pinned
[2018-10-24 21:19:27] : Starting 1x thread, affinity: 4.
[2018-10-24 21:19:27] : hwloc: memory pinned
[2018-10-24 21:19:27] : Starting 1x thread, affinity: 5.
[2018-10-24 21:19:27] : hwloc: memory pinned
[2018-10-24 21:19:27] : Fast-connecting to pool.supportxmr.com:5555 pool ...
[2018-10-24 21:19:27] : Pool pool.supportxmr.com:5555 connected. Logging in...
[2018-10-24 21:19:27] : Difficulty changed. Now: 10000.
[2018-10-24 21:19:27] : Pool logged in.
[2018-10-24 21:19:28] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 21:19:28] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 21:19:28] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 21:19:28] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 21:19:28] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 21:19:28] : Switch to assembler version for 'intel_avx' cpu's
$ cmake -LA .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /home/linuxbrew/.linuxbrew/bin/cc
-- Check for working C compiler: /home/linuxbrew/.linuxbrew/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/linuxbrew/.linuxbrew/bin/c++
-- Check for working CXX compiler: /home/linuxbrew/.linuxbrew/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
  CMake 3.4.0 or higher is required.  You are running version 2.8.12.2

-- Configuring incomplete, errors occurred!
See also "/home/nbrennan/Documents/xmr/latest/xmr-stak/build/CMakeFiles/CMakeOutput.log".
See also "/home/nbrennan/Documents/xmr/latest/xmr-stak/build/CMakeFiles/CMakeError.log".
-- Cache values
CMAKE_AR:FILEPATH=/home/linuxbrew/.linuxbrew/bin/ar
CMAKE_ASM_COMPILER:FILEPATH=/home/linuxbrew/.linuxbrew/bin/cc
CMAKE_ASM_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar
CMAKE_ASM_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib
CMAKE_ASM_FLAGS:STRING=
CMAKE_ASM_FLAGS_DEBUG:STRING=-g
CMAKE_ASM_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_ASM_FLAGS_RELEASE:STRING=-O2 -DNDEBUG
CMAKE_ASM_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_COLOR_MAKEFILE:BOOL=ON
CMAKE_CXX_COMPILER:FILEPATH=/home/linuxbrew/.linuxbrew/bin/c++
CMAKE_CXX_COMPILER_AR:FILEPATH=/home/linuxbrew/.linuxbrew/bin/gcc-ar-5
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/home/linuxbrew/.linuxbrew/bin/gcc-ranlib-5
CMAKE_CXX_FLAGS:STRING=
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O2 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_COMPILER:FILEPATH=/home/linuxbrew/.linuxbrew/bin/cc
CMAKE_C_COMPILER_AR:FILEPATH=/home/linuxbrew/.linuxbrew/bin/gcc-ar-5
CMAKE_C_COMPILER_RANLIB:FILEPATH=/home/linuxbrew/.linuxbrew/bin/gcc-ranlib-5
CMAKE_C_FLAGS:STRING=
CMAKE_C_FLAGS_DEBUG:STRING=-g
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=-O2 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
CMAKE_INSTALL_PREFIX:PATH=/home/nbrennan/Documents/xmr/latest/xmr-stak/build
CMAKE_LINKER:FILEPATH=/home/linuxbrew/.linuxbrew/bin/ld
CMAKE_LINK_STATIC:BOOL=OFF
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_NM:FILEPATH=/home/linuxbrew/.linuxbrew/bin/nm
CMAKE_OBJCOPY:FILEPATH=/home/linuxbrew/.linuxbrew/bin/objcopy
CMAKE_OBJDUMP:FILEPATH=/home/linuxbrew/.linuxbrew/bin/objdump
CMAKE_RANLIB:FILEPATH=/home/linuxbrew/.linuxbrew/bin/ranlib
CMAKE_SHARED_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_STRIP:FILEPATH=/home/linuxbrew/.linuxbrew/bin/strip
CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
CPU_ENABLE:BOOL=ON
CUDA_ENABLE:BOOL=OFF
EXECUTABLE_OUTPUT_PATH:STRING=bin
HWLOC:FILEPATH=/usr/lib64/libhwloc.so
HWLOC_ENABLE:BOOL=ON
HWLOC_INCLUDE_DIR:PATH=/usr/include
LIBRARY_OUTPUT_PATH:STRING=bin
MICROHTTPD_ENABLE:BOOL=OFF
OPENSSL_CRYPTO_LIBRARY:FILEPATH=/home/linuxbrew/.linuxbrew/Cellar/openssl/1.0.2m/lib/libcrypto.so
OPENSSL_INCLUDE_DIR:PATH=/home/linuxbrew/.linuxbrew/Cellar/openssl/1.0.2m/include
OPENSSL_SSL_LIBRARY:FILEPATH=/home/linuxbrew/.linuxbrew/Cellar/openssl/1.0.2m/lib/libssl.so
OpenCL_ENABLE:BOOL=ON
OpenCL_INCLUDE_DIR:PATH=/usr/include/CL
OpenCL_LIBRARY:FILEPATH=/usr/lib/libOpenCL.so
OpenSSL_ENABLE:BOOL=ON
PKG_CONFIG_EXECUTABLE:FILEPATH=/home/linuxbrew/.linuxbrew/bin/pkg-config
XMR-STAK_COMPILE:STRING=native
pkgcfg_lib__OPENSSL_crypto:FILEPATH=/home/linuxbrew/.linuxbrew/Cellar/openssl/1.0.2m/lib/libcrypto.so
pkgcfg_lib__OPENSSL_ssl:FILEPATH=/home/linuxbrew/.linuxbrew/Cellar/openssl/1.0.2m/lib/libssl.so

Issue with the execution

Did you compile the miner on your own? Yes

$ ./bin/xmr-stak --version-long
Version: xmr-stak/2.5.1/4e72408/master/lin/amd-cpu/10

AMD OpenCl issue

Driver version amdgpu-pro-18.20-606296

$ clinfo
Number of platforms                               0
$ sudo clinfo
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (2639.3)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback cl_amd_offline_devices 
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 1
  Device Name                                     Ellesmere
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.2 AMD-APP (2639.3)
  Driver Version                                  2639.3
  Device OpenCL C Version                         OpenCL C 1.2 
  Device Type                                     GPU
  Device Available                                Yes
  Device Profile                                  FULL_PROFILE
  Device Board Name (AMD)                         Radeon RX 580 Series
  Device Topology (AMD)                           PCI-E, 02:00.0
  Max compute units                               36
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                16
  SIMD instruction width (AMD)                    1
  Max clock frequency                             1340MHz
  Graphics IP (AMD)                               8.0
  Device Partition                                (core)
    Max number of sub-devices                     36
    Supported partition types                     none specified
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Compiler Available                              Yes
  Linker Available                                Yes
  Preferred work group size multiple              64
  Wavefront width (AMD)                           64
  Preferred / native vector sizes                 
    char                                                 4 / 4       
    short                                                2 / 2       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 1 / 1        (cl_khr_fp16)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             No
    Round to nearest                              No
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  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                              8429133824 (7.85GiB)
  Global free memory (AMD)                        8211864 (7.831GiB)
  Global memory channels (AMD)                    8
  Global memory banks per channel (AMD)           16
  Global memory bank width (AMD)                  256 bytes
  Error Correction support                        No
  Max memory allocation                           4244635648 (3.953GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       2048 bits (256 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384 (16KiB)
  Global Memory cache line                        64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            134217728 pixels
    Max 1D or 2D image array size                 2048 images
    Base address alignment for 2D image buffers   256 bytes
    Pitch alignment for 2D image buffers          256 bytes
    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                               32768 (32KiB)
  Local memory syze per CU (AMD)                  65536 (64KiB)
  Local memory banks (AMD)                        32
  Max constant buffer size                        4244635648 (3.953GiB)
  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
  Profiling timer offset since Epoch (AMD)        1540372828792640043ns (Wed Oct 24 20:20:28 2018)
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  Yes
    SPIR versions                                 1.2
  printf() buffer size                            4194304 (4MiB)
  Built-in kernels                                
  Device Extensions                               cl_khr_fp64 cl_amd_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_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_image2d_from_buffer cl_khr_spir cl_khr_gl_event 

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              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                                   Ellesmere
  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                                   Ellesmere
Spudz76 commented 6 years ago

Run as root, or add user to video group and also check perms on /dev/dri to make sure the group is video and has perms:

# ls -l /dev/dri/
crw-rw---- 1 root video 226,   0 Oct 22 09:51 card0

I usually give up about five levels deep and run as root (with AMD)

liam-b commented 6 years ago

Running as root has the same results but I will check /dev/dri and user groups when I get home.

$ sudo su
$ ./xmr-stak
-------------------------------------------------------------------
xmr-stak 2.5.1 4e72408

Brought to you by fireice_uk and psychocrypt under GPLv3.
Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).
Based on OpenCL mining code by wolf9466.

Configurable dev donation level is set to 1.0%

-------------------------------------------------------------------
You can use following keys to display reports:
'h' - hashrate
'r' - results
'c' - connection
-------------------------------------------------------------------
Upcoming xmr-stak-gui is sponsored by:
   #####   ______               ____
 ##     ## | ___ \             /  _ \
#    _    #| |_/ /_   _   ___  | / \/ _   _  _ _  _ _  ___  _ __    ___  _   _
#   |_|   #|    /| | | | / _ \ | |   | | | || '_|| '_|/ _ \| '_ \  / __|| | | |
#         #| |\ \| |_| || (_) || \_/\| |_| || |  | | |  __/| | | || (__ | |_| |
 ##     ## \_| \_|\__, | \___/ \____/ \__,_||_|  |_|  \___||_| |_| \___| \__, |
   #####           __/ |                                                  __/ |
                  |___/   https://ryo-currency.com                       |___/

This currency is a way for us to implement the ideas that we were unable to in
Monero. See https://github.com/fireice-uk/cryptonote-speedup-demo for details.
-------------------------------------------------------------------
[2018-10-24 09:08:42] : Mining coin: monero
[2018-10-24 09:08:42] : WARNING: UNKNOWN_ERROR when calling clGetPlatformIDs for number of platforms.
[2018-10-24 09:08:42] : WARNING: No OpenCL platform found.
[2018-10-24 09:08:42] : WARNING: No AMD OpenCL platform found. Possible driver issues or wrong vendor driver.
[2018-10-24 09:08:42] : WARNING: backend AMD (OpenCL) disabled.
[2018-10-24 09:08:42] : Starting 1x thread, affinity: 0.
[2018-10-24 09:08:42] : hwloc: memory pinned
[2018-10-24 09:08:42] : Starting 1x thread, affinity: 1.
[2018-10-24 09:08:42] : hwloc: memory pinned
[2018-10-24 09:08:42] : Starting 1x thread, affinity: 2.
[2018-10-24 09:08:42] : hwloc: memory pinned
[2018-10-24 09:08:42] : Starting 1x thread, affinity: 3.
[2018-10-24 09:08:42] : hwloc: memory pinned
[2018-10-24 09:08:42] : Starting 1x thread, affinity: 4.
[2018-10-24 09:08:42] : hwloc: memory pinned
[2018-10-24 09:08:42] : Starting 1x thread, affinity: 5.
[2018-10-24 09:08:42] : hwloc: memory pinned
[2018-10-24 09:08:42] : Fast-connecting to pool.supportxmr.com:5555 pool ...
[2018-10-24 09:08:42] : Pool pool.supportxmr.com:5555 connected. Logging in...
[2018-10-24 09:08:42] : Difficulty changed. Now: 10000.
[2018-10-24 09:08:42] : Pool logged in.
[2018-10-24 09:08:42] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 09:08:42] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 09:08:42] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 09:08:42] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 09:08:42] : Switch to assembler version for 'intel_avx' cpu's
[2018-10-24 09:08:42] : Switch to assembler version for 'intel_avx' cpu's
Spudz76 commented 6 years ago

clinfo should work as whatever user, if the permissions are right, but it is odd that clinfo is OK and opencl applets don't work. So, it could be getting denied by AppArmor or one of the other 7 layers of extra permissions bureaucracy CentOS has turned on by default. More complex than getting the device nodes to be workable (which used to be all that could block you). I know nothing of apparmor other than it gets shut off or I switch to a distro without it forced upon me.

Spudz76 commented 6 years ago

Maybe something like this

drm.rnodes=1 is fairly universal being in the generic DRM module (not intel specific)

You should be able to make a config file in the /etc/modprobe* neighborhood with option drm rnodes=1 in it aside from using the kernel args and rebooting. but you have to get the whole stack to modprobe -r which can end up nearly impossible depending if console is on it. So setup and reboot and see if there are crw-rw---- 1 root video 226, 128 Oct 22 09:51 renderD128 type nodes in /dev/dri/

liam-b commented 6 years ago

Result of ls -l /dev/dri/ is

drwxr-xr-x   2 root root        80 Oct 24 20:20 ./
drwxr-xr-x  20 root root      3600 Oct 24 20:20 ../
crw-rw----+  1 root video 226,   0 Oct 25 01:26 card0
crw-rw----+  1 root video 226, 128 Oct 24 20:20 renderD128

and I ran sudo usermod -a -G video nbrennan. And now clinfo works without running as root! Still same error when running xmr-stak :/

liam-b commented 6 years ago

Ok, so I decided to take a different approach to this problem and spent about 2 hours installing ROCm and guess what, exactly the same error when running xmr-stak :( In fact, as a bonus now clinfo returns:

terminate called after throwing an instance of 'cl::Error'
  what():  clGetPlatformIDs
Aborted

so I'm feeling a little lost. Also can you explain what you mean by setting drm.rnodes=1

kloinka commented 6 years ago

For my AMD GPUs I always start xmr-stak via a start script, may be of help?

!/bin/bash

export GPU_FORCE_64BIT_PTR=1 export GPU_USE_SYNC_OBJECTS=1 export GPU_MAX_ALLOC_PERCENT=100 export GPU_SINGLE_ALLOC_PERCENT=100 export GPU_MAX_HEAP_SIZE=100 ./xmr-stak

psychocrypt commented 6 years ago

which rocm version do you installed? You need rocm 1.9

Spudz76 commented 6 years ago

The rnodes module option is probably not needed as you already have the render node in /dev/dri

If you were not running Xorg then it may not have enabled the render (just the card entry) which I think breaks the shared memory usage

Still voting on some CentOS specific added protection layer, protecting you from yourself (video device access permissions besides the filesystem-level permissions to the dev nodes - apparmor probably - you can/have-to make an apparmor profile for the app with some of the apparmor profile tools to tell apparmor subsystem it's ok to not block it from the GPU)

Basically the same annoying junk Windows does except no popup and no simple "allow button"

AppArmor is the only thing that can also block root, is why I stand so hard on some of that junk (there are some other things besides apparmor, in the way, on CentOS by default, but I don't remember them all I always just go back to Debian where they haven't gone paranoid and I can turn ON the things I want, not wonder/research how many things I might have to turn OFF...)

liam-b commented 6 years ago

@psychocrypt I just followed the instructions on https://rocm.github.io/ROCmInstall.html, so I'm pretty sure it is 1.9. Should I try different versions of ROCm? Or maybe different amd drivers? Or is that not likely to help.

liam-b commented 6 years ago

@Spudz76 would I need to do something like this to disable AppArmor? Also could SELinux be breaking things as well and should I disable it?

Spudz76 commented 6 years ago

That's on the right track, but Plesk is Debian based so they suggest commands with dpkg and such (you use yum... package names are different... etc)

This is more RedHat centric and covers both SELinux and AppArmor - SELinux was the other layer I couldn't remember the name of (probably from PTSD... dealing with it before). You can generally use any tutorials for RHEL, CentOS, Fedora they are all RedHat based and similar.

liam-b commented 6 years ago

Ok, little update. I've uninstalled ROCm because I don't think it was helping and it broke clinfo. Now I'm back on amd drivers (amdgpu-pro-18.40-676022-rhel-7.4 specifically) and clinfo is working without root again which is nice. Still no luck with xmr-stak, same old error. getenforce returns Disabled and /etc/selinux/config looks like:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

(This was already like this, I didn't change anything SELinux related)

So basically no progress :(. Is it possible I could run xmr-stak in a vm/docker container? Would that be a plausible way get this thing working? Anyway, thanks for all the help so far @Spudz76, I really appreciate your effort.

Spudz76 commented 6 years ago

I just noticed you had run cmake vs cmake3 at some point. That may have left your build folder in a strange state?

I generally ignore whatever CMake comes from the Linux Distro (always old) or even the devtoolset equivalents (also old even when 3.x) and grab the install script from CMake directly and install that. https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh

wget https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh
sh cmake-3.12.3-Linux-x86_64.sh --prefix=/usr
[answer n to install to /usr/]
cmake --version

Purge any and all cmake* from yum first

liam-b commented 6 years ago

I did what you said for cmake with no luck, same error. (I ran sudo yum remove cmake and sudo yum remove cmake3 before installing)

But, what I did try was making a little cpp file to test clGetPlatformIDs:

#include <CL/cl.h>
#include <iostream>
using namespace std;

int main() {
  cout << "hello, world" << endl;
  cl_int error;
  cl_platform_id platforms;
  cl_uint num_platforms;
  error = clGetPlatformIDs(1, &platforms, &num_platforms);
  cout << error << endl;
  cout << num_platforms << endl;  
  return 0;
}

What I got was 0 platforms found and the error code -1001 which if you look up in the OpenCL errors is CL_PLATFORM_NOT_FOUND_KHR: No valid ICDs found. I tried sudo yum install ocl-icd but it didn't help so I'm wondering what I need to get an icd working.

Also clinfo (no sudo) is still working fine and returns:

$ clinfo
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (2686.5)
  ... etc

so the driver is fine.

Spudz76 commented 6 years ago

Perhaps it is the permissions to the ICD configs which should be in /etc/OpenCL/ Check if yours are all accessible+readable such as on this Debian Sid system.

# ls -lR /etc/OpenCL
/etc/OpenCL:
total 4
drwxr-xr-x 2 root root 4096 Sep 23 11:46 vendors

/etc/OpenCL/vendors:
total 4
-rw-r--r-- 1 root root 15 Jun 14 20:19 amdocl64.icd

# cat /etc/OpenCL/vendors/amdocl64.icd
libamdocl64.so

# updatedb && locate libamdocl64.so
/opt/amdgpu-pro/lib/x86_64-linux-gnu/libamdocl64.so

# ls -l /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamdocl64.so
-rw-r--r-- 1 root root 67947032 Mar  5  2018 /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamdocl64.so

All that should line up and be everyone-readable and directories everyone-executable. Perhaps the /opt/amdgpu-pro/ tree is not everyone-open so it can't load the library file (once it makes it through all the other mapping)

Spudz76 commented 6 years ago

Sometimes strace helps see what library/file/permission is failing, if you are able to see through all the noise it outputs. But usually the failure is near the end.

Spudz76 commented 6 years ago

Also, the error code is indeed not handled and would default out and show up as UNKNOWN_ERROR

CL_PLATFORM_NOT_FOUND_KHR aka -1001 should be added probably, for better error message