OpenCL doesn't work on AMD Navi 14 [Radeon RX 5500/5500M / Pro 5500M]
System information
- OS: Fedora 33
- GPU: 04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] [1002:7340] (rev c5)
- Kernel version: Linux localhost 5.10.10-200.fc33.x86_64 #1 (closed) SMP Sun Jan 24 19:58:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
- Mesa version: OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.3.3
- Xserver version (if applicable): xorg-x11-server-Xorg-1.20.10-1.fc33.x86_64
- Desktop manager and compositor: i3-4.19-2.fc33.x86_64
Describe the issue
Running clinfo
with the Mesa ICD generates information about the Radeon RX 5500 hardware, but also includes an error:
fatal error: cannot open file '/usr/lib64/clc//gfx1012-amdgcn-mesa-mesa3d.bc': No such file or directory
Running any OpenCL programs also generates the same error (and the programs fail to run). The .bc
file is missing.
- If the missing file is symlinked to the existing AMD common
tahiti-amdgcn-mesa-mesa3d.bc
file, the programs still fail though they find the.bc
file. - libclc doesn't seem to build this missing file even in llvm git HEAD. If libclc is modified to generate for the gfx1012 target, running OpenCL programs with the generated file causes X restart or system reboot.
It is always reproducible. Is there any way of making mesa OpenCL work on Navi hardware?
Vulkan (which is a different API) works just fine.
AMD's ROCm project does not support Navi hardware either, so there don't seem to be any open source ways to have OpenCL using it.
Full clinfo
output:
Number of platforms 1
Platform Name Clover
Platform Vendor Mesa
Platform Version OpenCL 1.1 Mesa 20.3.3
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix MESA
Platform Name Clover
Number of devices 1
Device Name Radeon RX 5500 XT (NAVI14, DRM 3.40.0, 5.10.10-200.fc33.x86_64, LLVM 11.0.0)
Device Vendor AMD
Device Vendor ID 0x1002
Device Version OpenCL 1.1 Mesa 20.3.3
Driver Version 20.3.3
Device OpenCL C Version OpenCL C 1.1
Device Type GPU
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Max compute units 22
Max clock frequency 1900MHz
Max work item dimensions 3
Max work item sizes 256x256x256
Max work group size 256
=== CL_PROGRAM_BUILD_LOG ===
fatal error: cannot open file '/usr/lib64/clc//gfx1012-amdgcn-mesa-mesa3d.bc': No such file or directory
Preferred work group size multiple <getWGsizes:1200: create kernel : error -46>
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 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 (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 8589934592 (8GiB)
Error Correction support No
Max memory allocation 6871947673 (6.4GiB)
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 16
Max constant buffer size 67108864 (64MiB)
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 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64
NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Clover
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [MESA]
clCreateContext(NULL, ...) [default] Success [MESA]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1)
Platform Name Clover
Device Name Radeon RX 5500 XT (NAVI14, DRM 3.40.0, 5.10.10-200.fc33.x86_64, LLVM 11.0.0)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Clover
Device Name Radeon RX 5500 XT (NAVI14, DRM 3.40.0, 5.10.10-200.fc33.x86_64, LLVM 11.0.0)
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 Radeon RX 5500 XT (NAVI14, DRM 3.40.0, 5.10.10-200.fc33.x86_64, LLVM 11.0.0)
ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.13
ICD loader Profile OpenCL 3.0
NOTE: your OpenCL library declares to support OpenCL 3.0,
but it seems to support up to OpenCL 2.2 only.