cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

nickfxh
Journeyman III

OpenCL compilation times on RX 6800XT seem 10x longer than other AMD cards.

I'm part of a team that develops an Image Editor which uses OpenCL for accerated filters.

We recently acquired RX 6800XT cards (replacing RX 580) and have been really suprised at the difference in compilation times for what seems reasonably uncomplicated kernels.

We record timings for our filter plugins and I include some picked out from the list (RX 580 vs 6800XT):

RX 580: [ plugins ] Set up "BlackAndWhite" in 1605 ms
6800XT: [ plugins ] Set up "BlackAndWhite" in 244668 ms

RX 580: [ plugins ] Set up "BevelAndEmboss" in 2444 ms
6800XT: [ plugins ] Set up "BevelAndEmboss" in 239744 ms

RX 580: [ plugins ] Set up "Caustics" in 2240 ms
6800XT: [ plugins ] Set up "Caustics" in 235744 ms

 

As you can see, at best it's about 10x slower. The drivers are up to date. There does seem to be a similar report from earlier this year? But I don't know if it was resolved for that card.
https://community.amd.com/t5/opencl/slow-kernel-compilation-speed-clbuildprogram-with-radeon-5700-xt... 

3 Replies
dipak
Big Boss

Hi @nickfxh,

Thank you for reporting it. I've whitelisted you and moved the post to the OpenCL forum.

Please provide the kernel file which can be used to reproduce the issue. Also, please share the clinfo output and OS information.

Thanks.

Hi @dipak 

Apologies for the delay in replying, we wanted to do more checking on our side first to make sure we weren't wasting your time if it was possibly on our side. Also, there was a slight error, my card is a 6600XT, not a 6800XT. We received a prototype AMD 6800XT from AMD for our work and I got confused with the versions.

We've tested with a very simple kernel (included here) and the times to compile this are quite different between my 6600 XT and my colleague's WX 7100 (and my previous RX 580).

6800XT = 1546.62 ms
WX7100 = 517.466 ms

const sampler_t sampler = CLK_FILTER_NEAREST |
                          CLK_NORMALIZED_COORDS_FALSE |
                          CLK_ADDRESS_CLAMP;

static float toGrey(float4 color)
{
    return dot((float3)(0.299f, 0.587f, 0.114f), color.xyz);
}

__kernel void ConvertGreyscale(__global uchar *output,
                               __read_only image2d_t input,
                               const int2 dims)
{
    int2 coord = (int2)(get_global_id(0), get_global_id(1));

    float4 color = read_imagef(input, sampler, coord);
    float lum = toGrey(color);

    lum *= 255.0f;

    int idx = coord.y * dims.x + coord.x;
    uchar val = clamp(lum, 0.0f, 255.0f);

    if (all(coord < dims)) {
        output[idx] = val;
    }
}


Whilst we usually compile our kernels concurrently, we have also compiled in serial just to make sure it's not the issue. It does seem that concurrent compilation compounds the issue resulting in 10x delays in some cases.

CLInfo.exe output
------------------------------------

Number of platforms 1
Platform Name AMD Accelerated Parallel Processing
Platform Vendor Advanced Micro Devices, Inc.
Platform Version OpenCL 2.1 AMD-APP (3276.6)
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_khr_dx9_media_sharing cl_amd_event_callback cl_amd_offline_devices
Platform Extensions function suffix AMD
Platform Host timer resolution 100ns

Platform Name AMD Accelerated Parallel Processing
Number of devices 1
Device Name gfx1032
Device Vendor Advanced Micro Devices, Inc.
Device Vendor ID 0x1002
Device Version OpenCL 2.0 AMD-APP (3276.6)
Driver Version 3276.6 (PAL,LC)
Device OpenCL C Version OpenCL C 2.0
Device Type GPU
Device Board Name (AMD) AMD Radeon RX 6600 XT
Device PCI-e ID (AMD) 0x73ff
Device Topology (AMD) PCI-E, 0000:09:00.0
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Linker Available Yes
Max compute units 16
SIMD per compute unit (AMD) 4
SIMD width (AMD) 32
SIMD instruction width (AMD) 1
Max clock frequency 2382MHz
Graphics IP (AMD) 10.3
Device Partition (core)
Max number of sub-devices 16
Supported partition types None
Supported affinity domains (n/a)
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 (kernel) 32
Wavefront width (AMD) 32
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 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 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 8573157376 (7.984GiB)
Global free memory (AMD) 8306688 (7.922GiB) 8044544 (7.672GiB)
Global memory channels (AMD) 4
Global memory banks per channel (AMD) 4
Global memory bank width (AMD) 256 bytes
Error Correction support No
Max memory allocation 7059013632 (6.574GiB)
Unified memory for Host and Device No
Shared Virtual Memory (SVM) capabilities (core)
Coarse-grained buffer sharing Yes
Fine-grained buffer sharing Yes
Fine-grained system sharing No
Atomics No
Minimum alignment for any data type 128 bytes
Alignment of base address 2048 bits (256 bytes)
Preferred alignment for atomics
SVM 0 bytes
Global 0 bytes
Local 0 bytes
Max size for global variable 6353112064 (5.917GiB)
Preferred total size of global vars 8573157376 (7.984GiB)
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 441188352 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 64
Max number of read/write image args 64
Max number of pipe args 16
Max active pipe reservations 16
Max pipe packet size 2764046336 (2.574GiB)
Local memory type Local
Local memory size 65536 (64KiB)
Local memory size per CU (AMD) 65536 (64KiB)
Local memory banks (AMD) 32
Max number of constant args 8
Max constant buffer size 7059013632 (6.574GiB)
Preferred constant buffer size (AMD) 16384 (16KiB)
Max size of kernel argument 1024
Queue properties (on host)
Out-of-order execution No
Profiling Yes
Queue properties (on device)
Out-of-order execution Yes
Profiling Yes
Preferred size 262144 (256KiB)
Max size 8388608 (8MiB)
Max queues on device 1
Max events on device 1024
Prefer user sync for interop Yes
Number of P2P devices (AMD) 0
Profiling timer resolution 1ns
Profiling timer offset since Epoch (AMD) 1635151579836951700ns (Mon Oct 25 09:46:19 2021)
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) 3
Max real-time compute units (AMD) 8
printf() buffer size 4194304 (4MiB)
Built-in kernels (n/a)
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_fp16 cl_khr_gl_sharing cl_khr_gl_depth_images cl_amd_device_attribute_query cl_amd_media_ops cl_amd_media_ops2 cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_khr_dx9_media_sharing cl_khr_image2d_from_buffer cl_khr_subgroups cl_khr_gl_event cl_khr_depth_images cl_khr_mipmap_image cl_khr_mipmap_image_writes cl_amd_liquid_flash cl_amd_copy_buffer_p2p cl_amd_planar_yuv

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 gfx1032
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 gfx1032
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 gfx1032



 

0 Likes

Hi @nickfxh ,

Thank you for providing the kernel code and other information. I've reported the issue to the concerned team to look into this. I will notify you once I get any update on this.

Thanks.