GPU Folding w/Radeon on Linux

FLECOM

Modder(ator) & [H]ardest Folder Evar
Staff member
Joined
Jun 27, 2001
Messages
15,801
getting ready to pull my hair out... trying to get my RX580 working on my workstation (Linux Mint 19.3)

Screenshot_2020-04-02_20-25-20.png

I have installed the latest AMD-PRO drivers

after I rebooted I try and start the GPU client and get

Code:
*********************** Log Started 2020-04-03T00:21:17Z ***********************
00:21:17:************************* Folding@home Client *************************
00:21:17:    Website: https://foldingathome.org/
00:21:17:  Copyright: (c) 2009-2018 foldingathome.org
00:21:17:     Author: Joseph Coffland <[email protected]>
00:21:17:       Args: --child --lifeline 2622 /etc/fahclient/config.xml --run-as
00:21:17:             fahclient --pid-file=/var/run/fahclient.pid --daemon
00:21:17:     Config: /etc/fahclient/config.xml
00:21:17:******************************** Build ********************************
00:21:17:    Version: 7.5.1
00:21:17:       Date: May 11 2018
00:21:17:       Time: 19:59:04
00:21:17: Repository: Git
00:21:17:   Revision: 4705bf53c635f88b8fe85af7675557e15d491ff0
00:21:17:     Branch: master
00:21:17:   Compiler: GNU 6.3.0 20170516
00:21:17:    Options: -std=gnu++98 -O3 -funroll-loops
00:21:17:   Platform: linux2 4.14.0-3-amd64
00:21:17:       Bits: 64
00:21:17:       Mode: Release
00:21:17:******************************* System ********************************
00:21:17:        CPU: Intel(R) Xeon(R) CPU X5687 @ 3.60GHz
00:21:17:     CPU ID: GenuineIntel Family 6 Model 44 Stepping 2
00:21:17:       CPUs: 8
00:21:17:     Memory: 23.49GiB
00:21:17:Free Memory: 22.16GiB
00:21:17:    Threads: POSIX_THREADS
00:21:17: OS Version: 4.15
00:21:17:Has Battery: false
00:21:17: On Battery: false
00:21:17: UTC Offset: -4
00:21:17:        PID: 2625
00:21:17:        CWD: /var/lib/fahclient
00:21:17:         OS: Linux 4.15.0-91-generic x86_64
00:21:17:    OS Arch: AMD64
00:21:17:       GPUs: 1
00:21:17:      GPU 0: Bus:26 Slot:0 Func:0 AMD:5 Ellesmere XT [Radeon RX
00:21:17:             470/480/570/580/590]
00:21:17:       CUDA: Not detected: Failed to open dynamic library 'libcuda.so':
00:21:17:             libcuda.so: cannot open shared object file: No such file or
00:21:17:             directory
00:21:17:     OpenCL: Not detected: clGetDeviceIDs() returned -1
00:21:17:***********************************************************************
.......blah blah retry a million times to download
00:22:21:WU01:FS01:Connecting to 128.252.203.10:8080
00:22:33:WU01:FS01:Downloading 33.04MiB
00:22:39:WU01:FS01:Download 15.14%
00:22:45:WU01:FS01:Download 29.89%
00:22:51:WU01:FS01:Download 30.27%
00:22:58:WU01:FS01:Download 41.81%
00:23:04:WU01:FS01:Download 58.84%
00:23:10:WU01:FS01:Download 80.22%
00:23:16:WU01:FS01:Download 91.76%
00:23:19:WU01:FS01:Download complete
00:23:19:WU01:FS01:Received Unit: id:01 state:DOWNLOAD error:NO_ERROR project:14294 run:0 clone:4 gen:199 core:0x21 unit:0x000000f080fccb0a5e0e6cdf3742c39b
00:23:19:WU01:FS01:Downloading core from http://cores.foldingathome.org/v7/lin/64bit/Core_21.fah
00:23:19:WU01:FS01:Connecting to cores.foldingathome.org:80
00:23:20:WU01:FS01:FahCore 21: Downloading 3.23MiB
00:23:22:WU01:FS01:FahCore 21: Download complete
00:23:22:WU01:FS01:Valid core signature
00:23:22:WU01:FS01:Unpacked 7.94MiB to cores/cores.foldingathome.org/v7/lin/64bit/Core_21.fah/FahCore_21
00:23:23:WU01:FS01:Starting
00:23:23:ERROR:WU01:FS01:Failed to start core: OpenCL device matching slot 1 not found, try setting 'opencl-index' manually

if I specify the slot manually for the GPU

Code:
00:50:09:WU01:FS01:Requesting new work unit for slot 01: READY gpu:0:Ellesmere XT [Radeon RX 470/480/570/580/590] from 13.90.152.57
00:50:09:WU01:FS01:Connecting to 13.90.152.57:8080
00:50:19:WU01:FS01:Downloading 86.23MiB
00:50:25:WU01:FS01:Download 6.45%
00:50:31:WU01:FS01:Download 11.96%
00:50:37:WU01:FS01:Download 19.71%
00:50:43:WU01:FS01:Download 26.82%
00:50:49:WU01:FS01:Download 36.24%
00:50:55:WU01:FS01:Download 43.56%
00:51:01:WU01:FS01:Download 50.66%
00:51:07:WU01:FS01:Download 58.42%
00:51:13:WU01:FS01:Download 65.01%
00:51:19:WU01:FS01:Download 73.93%
00:51:25:WU01:FS01:Download 79.94%
00:51:31:WU01:FS01:Download 86.39%
00:51:37:WU01:FS01:Download 91.76%
00:51:43:WU01:FS01:Download 99.15%
00:51:43:WU01:FS01:Download complete
00:51:43:WU01:FS01:Received Unit: id:01 state:DOWNLOAD error:NO_ERROR project:11781 run:0 clone:4208 gen:7 core:0x22 unit:0x000000130d5a98395e73c4ffff4a97bc
00:51:43:WU01:FS01:Starting
00:51:43:WU01:FS01:Running FahCore: /usr/bin/FAHCoreWrapper /var/lib/fahclient/cores/cores.foldingathome.org/v7/lin/64bit/Core_22.fah/FahCore_22 -dir 01 -suffix 01 -version 705 -lifeline 2625 -checkpoint 15 -gpu-vendor amd -opencl-device 0 -cuda-device 0 -gpu 0
00:51:43:WU01:FS01:Started FahCore on PID 6201
00:51:43:WU01:FS01:Core PID:6205
00:51:43:WU01:FS01:FahCore 0x22 started
00:51:44:WU01:FS01:0x22:*********************** Log Started 2020-04-03T00:51:43Z ***********************
00:51:44:WU01:FS01:0x22:*************************** Core22 Folding@home Core ***************************
00:51:44:WU01:FS01:0x22:       Type: 0x22
00:51:44:WU01:FS01:0x22:       Core: Core22
00:51:44:WU01:FS01:0x22:    Website: https://foldingathome.org/
00:51:44:WU01:FS01:0x22:  Copyright: (c) 2009-2018 foldingathome.org
00:51:44:WU01:FS01:0x22:     Author: John Chodera <[email protected]> and Rafal Wiewiora
00:51:44:WU01:FS01:0x22:             <[email protected]>
00:51:44:WU01:FS01:0x22:       Args: -dir 01 -suffix 01 -version 705 -lifeline 6201 -checkpoint 15
00:51:44:WU01:FS01:0x22:             -gpu-vendor amd -opencl-device 0 -cuda-device 0 -gpu 0
00:51:44:WU01:FS01:0x22:     Config: <none>
00:51:44:WU01:FS01:0x22:************************************ Build *************************************
00:51:44:WU01:FS01:0x22:    Version: 0.0.2
00:51:44:WU01:FS01:0x22:       Date: Dec 6 2019
00:51:44:WU01:FS01:0x22:       Time: 21:20:17
00:51:44:WU01:FS01:0x22: Repository: Git
00:51:44:WU01:FS01:0x22:   Revision: f87d92b58abdf7e6bf2e173cfbc4dc3e837c7042
00:51:44:WU01:FS01:0x22:     Branch: core22
00:51:44:WU01:FS01:0x22:   Compiler: GNU 4.8.2 20140120 (Red Hat 4.8.2-15)
00:51:44:WU01:FS01:0x22:    Options: -std=gnu++98 -O3 -funroll-loops
00:51:44:WU01:FS01:0x22:   Platform: linux2 4.9.87-linuxkit-aufs
00:51:44:WU01:FS01:0x22:       Bits: 64
00:51:44:WU01:FS01:0x22:       Mode: Release
00:51:44:WU01:FS01:0x22:************************************ System ************************************
00:51:44:WU01:FS01:0x22:        CPU: Intel(R) Xeon(R) CPU X5687 @ 3.60GHz
00:51:44:WU01:FS01:0x22:     CPU ID: GenuineIntel Family 6 Model 44 Stepping 2
00:51:44:WU01:FS01:0x22:       CPUs: 8
00:51:44:WU01:FS01:0x22:     Memory: 23.49GiB
00:51:44:WU01:FS01:0x22:Free Memory: 18.29GiB
00:51:44:WU01:FS01:0x22:    Threads: POSIX_THREADS
00:51:44:WU01:FS01:0x22: OS Version: 4.15
00:51:44:WU01:FS01:0x22:Has Battery: false
00:51:44:WU01:FS01:0x22: On Battery: false
00:51:44:WU01:FS01:0x22: UTC Offset: -4
00:51:44:WU01:FS01:0x22:        PID: 6205
00:51:44:WU01:FS01:0x22:        CWD: /var/lib/fahclient/work
00:51:44:WU01:FS01:0x22:         OS: Linux 4.15.0-91-generic x86_64
00:51:44:WU01:FS01:0x22:    OS Arch: AMD64
00:51:44:WU01:FS01:0x22:********************************************************************************
00:51:44:WU01:FS01:0x22:Project: 11781 (Run 0, Clone 4208, Gen 7)
00:51:44:WU01:FS01:0x22:Unit: 0x000000130d5a98395e73c4ffff4a97bc
00:51:44:WU01:FS01:0x22:Reading tar file core.xml
00:51:44:WU01:FS01:0x22:Reading tar file integrator.xml
00:51:44:WU01:FS01:0x22:Reading tar file state.xml
00:51:44:WU01:FS01:0x22:Reading tar file system.xml
00:51:44:WU01:FS01:0x22:Digital signatures verified
00:51:44:WU01:FS01:0x22:Folding@home GPU Core22 Folding@home Core
00:51:44:WU01:FS01:0x22:Version 0.0.2
00:51:57:WU01:FS01:0x22:ERROR:exception: Error initializing context: clGetDeviceIDs (-1)
00:51:57:WU01:FS01:0x22:Saving result file ../logfile_01.txt
00:51:57:WU01:FS01:0x22:Saving result file science.log
00:51:57:WU01:FS01:0x22:Folding@home Core Shutdown: BAD_WORK_UNIT
00:51:58:WARNING:WU01:FS01:FahCore returned: BAD_WORK_UNIT (114 = 0x72)
00:51:58:WU01:FS01:Sending unit results: id:01 state:SEND error:FAULTY project:11781 run:0 clone:4208 gen:7 core:0x22 unit:0x000000130d5a98395e73c4ffff4a97bc
00:51:58:WU01:FS01:Uploading 8.00KiB to 13.90.152.57
00:51:58:WU01:FS01:Connecting to 13.90.152.57:8080
00:51:58:WU01:FS01:Upload complete
00:51:58:WU01:FS01:Server responded WORK_ACK (400)
00:51:58:WU01:FS01:Cleaning up

I have done the following

* added radeon.cik_support=0 amdgpu.cik_support=1 to grub
* ocl-icd-opencl-dev and it's dependencies was already installed (also tried reinstalling it out of desperation)
* ocl-icd-libopencl1 is installed

if I run FAHBench it works fine

Screenshot_2020-04-02_20-54-39.png
 
here's the output of clinfo

Code:
Number of platforms                               2
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (3004.6)
  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                                   Portable Computing Language
  Platform Vendor                                 The pocl project
  Platform Version                                OpenCL 1.2 pocl 1.1 None+Asserts, LLVM 6.0.0, SPIR, SLEEF, DISTRO, POCL_DEBUG
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             POCL

  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 (3004.6)
  Driver Version                                  3004.6
  Device OpenCL C Version                         OpenCL C 1.2 
  Device Type                                     GPU
  Device Board Name (AMD)                         AMD Radeon (TM) RX 480 Graphics
  Device Topology (AMD)                           PCI-E, 1a:00.0
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               36
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                16
  SIMD instruction width (AMD)                    1
  Max clock frequency                             1266MHz
  Graphics IP (AMD)                               8.0
  Device Partition                                (core)
    Max number of sub-devices                     36
    Supported partition types                     None
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Preferred work group size (AMD)                 256
  Max work group size (AMD)                       1024
  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
  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
  Address bits                                    64, Little-Endian
  Global memory size                              8135663616 (7.577GiB)
  Global free memory (AMD)                        7917128 (7.55GiB)
  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 size                   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 pixels
    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 number of constant args                     8
  Max constant buffer size                        4244635648 (3.953GiB)
  Preferred constant buffer size (AMD)            16384 (16KiB)
  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)        1585873264080177248ns (Thu Apr  2 20:21:04 2020)
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  Yes
    Number of async queues (AMD)                  2
    Max real-time compute queues (AMD)            0
    Max real-time compute units (AMD)             1702187274
    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 

  Platform Name                                   Portable Computing Language
Number of devices                                 1
  Device Name                                     pthread-Intel(R) Xeon(R) CPU           X5687  @ 3.60GHz
  Device Vendor                                   GenuineIntel
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 1.2 pocl HSTR: pthread-x86_64-pc-linux-gnu-westmere
  Driver Version                                  1.1
  Device OpenCL C Version                         OpenCL C 1.2 pocl
  Device Type                                     CPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               8
  Max clock frequency                             3724MHz
  Device Partition                                (core)
    Max number of sub-devices                     8
    Supported partition types                     equally, by counts
  Max work item dimensions                        3
  Max work item sizes                             4096x4096x4096
  Max work group size                             4096
  Preferred work group size multiple              8
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 0 / 0        (n/a)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               No
    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
  Address bits                                    64, Little-Endian
  Global memory size                              23079301120 (21.49GiB)
  Error Correction support                        No
  Max memory allocation                           8589934592 (8GiB)
  Unified memory for Host and Device              Yes
  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                        12582912 (12MiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            536870912 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                128
  Local memory type                               Global
  Local memory size                               8388608 (8MiB)
  Max number of constant args                     8
  Max constant buffer size                        8388608 (8MiB)
  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                            Yes
    SPIR versions                                 1.2
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                
  Device Extensions                               cl_khr_byte_addressable_store 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_3d_image_writes cl_khr_spir cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64

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_DEFAULT)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   Ellesmere
  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
 
I haven't tried to get my RX570 running under Linux but before installing the AMD-Pro drivers did you try the open source drivers? I've never bothered with Pro drivers before so I'm not sure if that might not be causing an issue.
 
AMD + OpenCL in linux is a nightmare. I got one system working a year or so back and I'm not really sure how I did it.
 
OpenCL: Not detected: clGetDeviceIDs() returned -1

This is your problem

Try this:

Code:
sudo apt install opencl-dev


EDIT: Hrmm seems like you have the ICD installed already -- is the opencl-dev package just a virtual package that installs ocl-icd-opencl-dev or is it something else?
 
I picked up a radeon VII a few months back and was able get get it to run boinc GPU projects on linux using this set of instructions.

However, I was not able to get F@H running on the radeon VII. My guess is that user 'fahclient' does not have permission to load the OpenCl drivers, because I was able to tun FAH when I started the client manually in my home directory. If you'd like to try this here's what I did.

sudo systemctl disable FAHClient <----disables the FAHClient service that starts automatically during boot.
sudo reboot
In your home directory make folder FAH: mkdir FAH
cd FAH
wget http://fah-web.stanford.edu/file-releases/public/GPUs.txt
cp /etc/fahclient/config.xml ./
FAHClient <---- this starts the client

I know this isn't ideal but it works for me.
 
Back
Top