Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OpenCL on older Radeon (Redwood)?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
jhardin
n00b
n00b


Joined: 12 Oct 2005
Posts: 48

PostPosted: Thu Jun 04, 2020 4:40 pm    Post subject: OpenCL on older Radeon (Redwood)? Reply with quote

I've been poking around for a bit trying to see whether I can get OpenCL from the stock Gentoo repo (no overlays) to work on my older Radeon (Redwood PRO - Radeon HD 5570).

I enabled the opencl USE flag on media-libs/mesa (to get the Clover OpenCL implementation), media-video/ffmpeg and media-libs/x264 (not globally) and they build successfully, but I haven't tried anything to verify OpenCL yet. Things that depend on them but that probably don't exercise OpenCL (e.g. glxgears, VLC playing a video) work properly.

These are installed:
Code:
dev-libs/ocl-icd-2.2.12-r3
dev-util/clinfo-2.2.18.04.06-r1
dev-util/intel-ocl-sdk-2.0.31360
dev-util/opencl-headers-2020.03.13-r1
media-libs/mesa-19.3.5
media-video/ffmpeg-4.2.3
virtual/ffmpeg-9-r2
virtual/opencl-3-r1
x11-apps/mesa-progs-8.4.0


clinfo reports this, which isn't encouraging:
Code:
Number of platforms                               2
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 19.3.5
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Intel(R) OpenCL
  Platform Vendor                                 Intel(R) Corporation
  Platform Version                                OpenCL 1.1 LINUX
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_fp64 cl_khr_icd 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_byte_addressable_store cl_intel_printf cl_ext_device_fission cl_intel_exec_by_local_thread
  Platform Extensions function suffix             INTEL

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     AMD REDWOOD (DRM 2.50.0 / 5.4.38-gentoo, LLVM 9.0.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 19.3.5
  Driver Version                                  19.3.5
  Device OpenCL C Version                         OpenCL C 1.1
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               5
  Max clock frequency                             650MHz
  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                                                16 / 16     
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 0 / 0        (n/a)
    float                                                4 / 4       
    double                                               0 / 0        (n/a)
  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                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    32, Little-Endian
  Global memory size                              1073741824 (1024MiB)
  Error Correction support                        No
  Max memory allocation                           751619276 (716.8MiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     15
  Max constant buffer size                        751619276 (716.8MiB)
  Max size of kernel argument                     1024
  Queue properties                               
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities                         
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  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

  Platform Name                                   Intel(R) OpenCL
Number of devices                                 1
  Device Name                                     AMD Phenom(tm) II X6 1045T Processor
  Device Vendor                                   Intel(R) Corporation
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 1.1 (Build 31360.31426)
  Driver Version                                  1.1
  Device OpenCL C Version                         OpenCL C 1.1
  Device Type                                     CPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               6
  Max clock frequency                             0MHz
  Device Partition                                (cl_ext_device_fission)
    Supported partition types (ext)               by affinity domain, by counts, equally
    Supported affinity domains (ext)              (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             1024
  Preferred work group size multiple              <getWGsizes:1171: create context : error -2>
  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                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  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                              8346877952 (7.774GiB)
  Error Correction support                        No
  Max memory allocation                           2086719488 (1.943GiB)
  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                        524288 (512KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             480
    Max 2D image size                             8192x8192 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 480
    Max number of write image args                480
  Local memory type                               Global
  Local memory size                               32768 (32KiB)
  Max number of constant args                     480
  Max constant buffer size                        131072 (128KiB)
  Max size of kernel argument                     3840 (3.75KiB)
  Queue properties                               
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Local thread execution (Intel)                Yes
  Profiling timer resolution                      1ns
  Execution capabilities                         
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
  Device Extensions                               cl_khr_fp64 cl_khr_icd 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_byte_addressable_store cl_intel_printf cl_ext_device_fission cl_intel_exec_by_local_thread


NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContext(NULL, ...) [other]              Success [INTEL]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD REDWOOD (DRM 2.50.0 / 5.4.38-gentoo, LLVM 9.0.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD REDWOOD (DRM 2.50.0 / 5.4.38-gentoo, LLVM 9.0.1)
  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                                 Clover
    Device Name                                   AMD REDWOOD (DRM 2.50.0 / 5.4.38-gentoo, LLVM 9.0.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2


/etc/env.d/03opencl is currently set to Intel, and there is nothing under /usr/lib64/OpenCL/vendors/ocl-icd so I apparently can't fiddle with it to select ocl-icd.

A couple of packages that depend on ffmpeg but that do not themselves have a opencl use flag (chromium, qtwebengine) now fail to link (after a loooong build :( ) with this:
Code:
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clReleaseMemObject@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clReleaseCommandQueue@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clCreateContext@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clGetPlatformInfo@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clEnqueueUnmapMemObject@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clCreateCommandQueue@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clWaitForEvents@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clCreateImage@OPENCL_1.2'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clEnqueueWriteImage@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clReleaseEvent@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clEnqueueMapImage@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clEnqueueReadImage@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clGetSupportedImageFormats@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clGetDeviceIDs@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clRetainCommandQueue@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clGetDeviceInfo@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clReleaseContext@OPENCL_1.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libavutil.so.56: undefined reference to `clGetPlatformIDs@OPENCL_1.0'
collect2: error: ld returned 1 exit status


eselect-opencl is blocked:
Code:
[ebuild  N     ] app-eselect/eselect-opencl-1.1.0-r4
[blocks B      ] app-eselect/eselect-opencl ("app-eselect/eselect-opencl" is blocking dev-libs/ocl-icd-2.2.12-r3, dev-util/opencl-headers-2020.03.13-r1)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (app-eselect/eselect-opencl-1.1.0-r4:0/0::gentoo, ebuild scheduled for merge) pulled in by
    app-eselect/eselect-opencl

  (dev-libs/ocl-icd-2.2.12-r3:0/0::gentoo, installed) pulled in by
    dev-libs/ocl-icd[khronos-headers,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_riscv_lp64d(-)?,abi_riscv_lp64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] (dev-libs/ocl-icd[khronos-headers,abi_x86_32(-),abi_x86_64(-)]) required by (media-libs/mesa-19.3.5:0/0::gentoo, installed) USE="X classic dri3 egl gallium gbm gles1 gles2 libglvnd llvm opencl osmesa vdpau wayland xvmc -d3d9 -debug -lm-sensors -pax_kernel (-selinux) -test -unwind -vaapi -valgrind -vulkan -vulkan-overlay -xa" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="r600 radeon (-freedreno) -i915 -i965 -intel -iris (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -radeonsi (-vc4) -virgl (-vivante) -vmware"
    dev-libs/ocl-icd[khronos-headers,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_riscv_lp64d(-)?,abi_riscv_lp64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] (dev-libs/ocl-icd[khronos-headers,abi_x86_32(-),abi_x86_64(-)]) required by (virtual/opencl-3-r1:0/0::gentoo, installed) USE="" ABI_X86="32 (64) (-x32)"


...and Mesa Clover appears dead (no upstream commits in ten years).

I'm reluctant to just dive into dev-libs/amdgpu-pro-opencl because the AMD website for it claims loudly:
Quote:
This Radeon™ Software for Linux® release is only compatible with the Radeon RX 5700 Series of cards – no other products are supported.



So, I'm asking for some advice. Is this hardware simply too old to try to use OpenCL at all and I should give up? Or will the dev-libs/amdgpu-pro-opencl package actually work and I should get that installed? Has anyone actually gotten OpenCL working with this generation of AMD GPU? Do I need to use an overlay?

Thanks!
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6778

PostPosted: Fri Jun 05, 2020 7:30 am    Post subject: Reply with quote

The compiler errors are because you have the intel libs installed - you shouldn't unless you have an Intel igp.

eselect-opencl and ocl-icd are both obsolete and should be uninstalled; if you insist on compiling things with USE=opencl, replace those with opencl-icd-loader first.

Clover is all you have on that card. Most of the things you're trying to compile with opencl support don't work with 1.1. amdgpu-pro absolutely won't work on a R600. It works with polaris10/11/12 though.
Back to top
View user's profile Send private message
jhardin
n00b
n00b


Joined: 12 Oct 2005
Posts: 48

PostPosted: Fri Jun 05, 2020 5:53 pm    Post subject: Reply with quote

Quote:
The compiler errors are because you have the intel libs installed - you shouldn't unless you have an Intel igp.

Ok, thanks, I'll remove that. I'm not sure why that got installed...

Quote:
Most of the things you're trying to compile with opencl support don't work with 1.1.
Ugh, that isn't promising.

Thanks, I'll see where that takes me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum