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

Ubuntu 16.04.04 OpenCL not seen by XMR-STAK #1442

Closed SveguS80 closed 6 years ago

SveguS80 commented 6 years ago

Background and Question

XMR-STAK does not see OpenCL, i cannot figure out why since all the checks are passing i can come up with.

Basic information

Compile information

Since the compilation worked ok passing the location of OpenCL for AMD-SDK-APP i thought it would be ok.

cmake -DOpenCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include -DOpenCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so -DCUDA_ENABLE=OFF -DHWLOC_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: /usr/bin/cc -- Check for working C compiler: /usr/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: /usr/bin/c++ -- Check for working CXX compiler: /usr/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_0 -- Looking for CL_VERSION_2_0 - found -- Found OpenCL: /opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so (found version "2.0") -- 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: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g") -- Configuring done -- Generating done -- Build files have been written to: /home/svegus/xmr-stak svegus@moneroUB:~/xmr-stak$ make install Scanning dependencies of target xmr-stak-c [ 3%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_keccak.c.o [ 6%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_skein.c.o [ 10%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_groestl.c.o [ 13%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_jh.c.o [ 16%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_blake256.c.o [ 20%] Linking C static library bin/libxmr-stak-c.a [ 20%] Built target xmr-stak-c Scanning dependencies of target xmr-stak-backend [ 23%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/jconf.cpp.o [ 26%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/version.cpp.o [ 30%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/jconf.cpp.o [ 33%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o [ 36%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/hwlocMemory.cpp.o [ 40%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/globalStates.cpp.o [ 43%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/backendConnector.cpp.o [ 46%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_common.cpp.o [ 50%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/httpd.cpp.o [ 53%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/webdesign.cpp.o [ 56%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/console.cpp.o [ 60%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/utility.cpp.o [ 63%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/executor.cpp.o [ 66%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/uac.cpp.o [ 70%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/telemetry.cpp.o [ 73%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/socket.cpp.o [ 76%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/jpsock.cpp.o [ 80%] Linking CXX static library bin/libxmr-stak-backend.a [ 80%] Built target xmr-stak-backend Scanning dependencies of target xmrstak_opencl_backend [ 83%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/amd_gpu/gpu.cpp.o [ 86%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/jconf.cpp.o [ 90%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/minethd.cpp.o [ 93%] Linking CXX shared library bin/libxmrstak_opencl_backend.so [ 93%] Built target xmrstak_opencl_backend Scanning dependencies of target xmr-stak [ 96%] Building CXX object CMakeFiles/xmr-stak.dir/xmrstak/cli/cli-miner.cpp.o [100%] Linking CXX executable bin/xmr-stak [100%] Built target xmr-stak

AMD OpenCl infornation

[2018-04-17 08:26:53] : Mining coin: monero7 [2018-04-17 08:26:53] : WARNING: UNKNOWN_ERROR when calling clGetPlatformIDs for number of platforms. [2018-04-17 08:26:53] : WARNING: No OpenCL platform found. [2018-04-17 08:26:53] : WARNING: No AMD OpenCL platform found. Possible driver issues or wrong vendor driver. [2018-04-17 08:26:53] : WARNING: backend AMD disabled. [2018-04-17 08:26:53] : Starting 1x thread, affinity: 0. [2018-04-17 08:26:53] : Fast-connecting to xmrpool.eu:5555 pool ... [2018-04-17 08:26:53] : MEMORY ALLOC FAILED: mmap failed [2018-04-17 08:26:53] : Pool xmrpool.eu:5555 connected. Logging in... [2018-04-17 08:26:54] : Difficulty changed. Now: 25000. [2018-04-17 08:26:54] : Pool logged in. [2018-04-17 08:27:28] : New block detected. [2018-04-17 08:27:32] : Difficulty changed. Now: 10000. [2018-04-17 08:27:32] : New block detected.

  run `clinfo` and add the output here
  Number of platforms:               1
  Platform Profile:              FULL_PROFILE
  Platform Version:              OpenCL 2.0 AMD-APP (2442.7)
  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:                    Radeon RX 570 Series
  Device Topology:               PCI[ B#1, D#0, F#0 ]
  Max compute units:                 32
  Max work items dimensions:             3
    Max work items[0]:               256
    Max work items[1]:               256
    Max work items[2]:               256
  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:               1244Mhz
  Address bits:                  64
  Max memory allocation:             3019689984
  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:            16
  Max size of kernel argument:           1024
  Alignment (bits) of base address:      2048
  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:                4279554048
  Constant buffer size:              3019689984
  Max number of constant args:           8
  Local memory type:                 Scratchpad
  Local memory size:                 32768
  Max pipe arguments:                0
  Max pipe active reservations:          0
  Max pipe packet size:              0
  Max global variable size:          0
  Max global variable preferred total size:  0
  Max read/write image args:             0
  Max on device events:              0
  Queue on device max size:          0
  Max on device queues:              0
  Queue on device preferred size:        0
  SVM capabilities:              
    Coarse grain buffer:             No
    Fine grain buffer:               No
    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:                No
    Profiling :                  No
  Platform ID:                   0x7fc3d85ed478
  Name:                      Ellesmere
  Vendor:                    Advanced Micro Devices, Inc.
  Device OpenCL C version:           OpenCL C 1.2 
  Driver version:                2442.7
  Profile:                   FULL_PROFILE
  Version:                   OpenCL 1.2 AMD-APP (2442.7)
  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
SveguS80 commented 6 years ago

Saw another post with simialr issue where the environment variables was not setup correct. So i setup the AMD-APP-SDK variables in the user profile.

$ echo $AMDAPPSDKROOT /opt/AMDAPPSDK-3.0 $ echo $LD_LIBRARY_PATH :/opt/AMDAPPSDK-3.0/lib/x86_64:/opt/AMDAPPSDK-3.0/lib/x86

Recomplied XMR, but still the same:

SveguS80 commented 6 years ago

Error UNKNOWN_ERROR when calling clGetPlatformIDs for number of platforms #164

I was looking at the wrong error message! The above post cleared it up. Permissions. If I run xmr-stak as root all works fine.