Hi,
Developer of PTGui here (www.ptgui.com).
One of the users of my software has reported an error while building OpenCL kernels on a Radeon RX 5700 XT on Windows 10. clBuildProgram returns "AMD HSA Code Object loading failed". The problem seems to be isolated to this particular GPU, the same kernels have compiled fine for years on other AMD GPUs and nvidia GPUs.
Windows 10.0.18362
NAME: AMD Radeon RX 5700 XT
CL_DEVICE_ADDRESS_BITS: 64
CL_DEVICE_AVAILABLE: true
CL_DEVICE_COMPILER_AVAILABLE: true
CL_DEVICE_ENDIAN_LITTLE: true
CL_DEVICE_ERROR_CORRECTION_SUPPORT: false
CL_DEVICE_EXECUTION_CAPABILITIES: 1
CL_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
CL_DEVICE_GLOBAL_MEM_CACHE_SIZE: 16384
CL_DEVICE_GLOBAL_MEM_CACHE_TYPE: 2
CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: 64
CL_DEVICE_GLOBAL_MEM_SIZE: 8573157376
CL_DEVICE_HALF_FP_CONFIG: 0
CL_DEVICE_HOST_UNIFIED_MEMORY: false
CL_DEVICE_IMAGE_SUPPORT: true
CL_DEVICE_IMAGE2D_MAX_HEIGHT: 16384
CL_DEVICE_IMAGE2D_MAX_WIDTH: 16384
CL_DEVICE_IMAGE3D_MAX_DEPTH: 2048
CL_DEVICE_IMAGE3D_MAX_HEIGHT: 2048
CL_DEVICE_IMAGE3D_MAX_WIDTH: 2048
CL_DEVICE_LOCAL_MEM_SIZE: 65536
CL_DEVICE_LOCAL_MEM_TYPE: 1
CL_DEVICE_MAX_CLOCK_FREQUENCY: 1755
CL_DEVICE_MAX_COMPUTE_UNITS: 20
CL_DEVICE_MAX_CONSTANT_ARGS: 8
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 4244635648
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 4244635648
CL_DEVICE_MAX_PARAMETER_SIZE: 1024
CL_DEVICE_MAX_READ_IMAGE_ARGS: 128
CL_DEVICE_MAX_SAMPLERS: 16
CL_DEVICE_MAX_WORK_GROUP_SIZE: 256
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS: 3
CL_DEVICE_MAX_WRITE_IMAGE_ARGS: 64
CL_DEVICE_MEM_BASE_ADDR_ALIGN: 2048
CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE: 128
CL_DEVICE_NAME: gfx1010
CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR: 4
CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE: 1
CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT: 1
CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF: 1
CL_DEVICE_NATIVE_VECTOR_WIDTH_INT: 1
CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG: 1
CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT: 2
CL_DEVICE_OPENCL_C_VERSION: OpenCL C 2.0
CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR: 4
CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF: 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT: 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG: 1
CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT: 2
CL_DEVICE_PROFILE: FULL_PROFILE
CL_DEVICE_PROFILING_TIMER_RESOLUTION: 1
CL_DEVICE_QUEUE_PROPERTIES: 2
CL_DEVICE_SINGLE_FP_CONFIG: 191
CL_DEVICE_TYPE: 4
CL_DEVICE_VENDOR_ID: 4098
CL_DEVICE_VENDOR: Advanced Micro Devices, Inc.
CL_DEVICE_VERSION: OpenCL 2.0 AMD-APP (2906.10)
CL_DRIVER_VERSION: 2906.10 (PAL,LC)
CL_DEVICE_MAX_WORK_ITEM_SIZES: [1024, 1024, 1024]
I can't share the OpenCL code publicly in this forum. According to Compute - The AMD Radeon RX 5700 XT & RX 5700 Review: Navi Renews Competition in the Midrange Market this may not be an isolated issue, so I hope this is already being solved.
Posting here because I'm not allowed to post anywhere else in these forums. Let me know if you need more information or if there is a better place to report these issues.
Thanks
Joost
Hi Joost,
Thank you for reporting it. I've whitelisted you and moved this post to our OpenCL forum.
To investigate the above build issue, it would be helpful for us if you can provide the reproducible kernel code. I've sent you a PM regarding this. Please check your inbox.
Thanks.
Update:
The OpenCL team was able to reproduce the above issue and they are now investigating it. I'll get back to you once I've any further update on this.
Thanks.
Thank you!
As I already informed you via email, here is the OpenCL team's reply about this issue:
"The kernel uses the C99/OpenCL `inline` attribute incorrectly. All of the relevant options for fixing the use are listed at http://clang.llvm.org/compatibility.html#inline."
Thanks.
I can confirm that removing the 'inline' keyword from the openCL c code fixed the problem.
Thanks dipak and the OpenCL team!
Thank you for the confirmation.