fatal error: cannot open file '/usr/lib/clc/gfx1031-amdgcn-mesa-mesa3d.bc': No such file or directory

Bug #2029173 reported by Your full Name
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mesa (Ubuntu)
New
Undecided
Unassigned

Bug Description

Programs using OpenCL report the following bug:
fatal error: cannot open file '/usr/lib/clc/gfx1031-amdgcn-mesa-mesa3d.bc': No such file or directory

This bug is encountered when trying to run github.com/ggerganov/llama.cpp build with CLBlast or just using clinfo.

The hardware is an AMD Radeon RX 6700 XT

lsb_release -rd:
No LSB modules are available.
Description: Ubuntu 23.04
Release: 23.04

apt-cache policy mesa-opencl-icd #although I am not sure that this is the offending package
mesa-opencl-icd:
  Installed: 23.0.4-0ubuntu1~23.04.1
  Candidate: 23.0.4-0ubuntu1~23.04.1
  Version table:
 *** 23.0.4-0ubuntu1~23.04.1 500
        500 http://de.archive.ubuntu.com/ubuntu lunar-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     23.0.2-1ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu lunar/universe amd64 Packages
pc@pc-MS-7C02:~/ML/llama.cpp$

clinfo output:
Number of platforms 2
  Platform Name Clover
  Platform Vendor Mesa
  Platform Version OpenCL 1.1 Mesa 23.0.4-0ubuntu1~23.04.1
  Platform Profile FULL_PROFILE
  Platform Extensions cl_khr_icd
  Platform Extensions function suffix MESA

  Platform Name rusticl
  Platform Vendor Mesa/X.org
  Platform Version OpenCL 3.0
  Platform Profile FULL_PROFILE
  Platform Extensions cl_khr_icd
  Platform Extensions with Version cl_khr_icd 0x400000 (1.0.0)
  Platform Numeric Version 0xc00000 (3.0.0)
  Platform Extensions function suffix MESA
  Platform Host timer resolution 0ns

  Platform Name Clover
Number of devices 1
  Device Name AMD Radeon RX 6700 XT (navi22, LLVM 15.0.7, DRM 3.49, 6.2.0-26-generic)
  Device Vendor AMD
  Device Vendor ID 0x1002
  Device Version OpenCL 1.1 Mesa 23.0.4-0ubuntu1~23.04.1
  Device Numeric Version 0x401000 (1.1.0)
  Driver Version 23.0.4-0ubuntu1~23.04.1
  Device OpenCL C Version OpenCL C 1.1
  Device OpenCL C Numeric Version 0x401000 (1.1.0)
  Device Type GPU
  Device Profile FULL_PROFILE
  Device Available Yes
  Compiler Available Yes
  Max compute units 40
  Max clock frequency 2855MHz
  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/lib/clc/gfx1031-amdgcn-mesa-mesa3d.bc': No such file or directory
  Preferred work group size multiple (kernel) <getWGsizes:1980: 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 12884901888 (12GiB)
  Error Correction support No
  Max memory allocation 3221225472 (3GiB)
  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 65536 (64KiB)
  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
    ILs with version SPIR-V 0x400000 (1.0.0)
  Built-in kernels with version (n/a)
  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 cl_khr_extended_versioning
  Device Extensions with Version cl_khr_byte_addressable_store 0x400000 (1.0.0)
                                                  cl_khr_global_int32_base_atomics 0x400000 (1.0.0)
                                                  cl_khr_global_int32_extended_atomics 0x400000 (1.0.0)
                                                  cl_khr_local_int32_base_atomics 0x400000 (1.0.0)
                                                  cl_khr_local_int32_extended_atomics 0x400000 (1.0.0)
                                                  cl_khr_int64_base_atomics 0x400000 (1.0.0)
                                                  cl_khr_int64_extended_atomics 0x400000 (1.0.0)
                                                  cl_khr_fp64 0x400000 (1.0.0)
                                                  cl_khr_extended_versioning 0x400000 (1.0.0)

  Platform Name rusticl
Number of devices 0

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 [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1)
    Platform Name Clover
    Device Name AMD Radeon RX 6700 XT (navi22, LLVM 15.0.7, DRM 3.49, 6.2.0-26-generic)
  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 Radeon RX 6700 XT (navi22, LLVM 15.0.7, DRM 3.49, 6.2.0-26-generic)
  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 Radeon RX 6700 XT (navi22, LLVM 15.0.7, DRM 3.49, 6.2.0-26-generic)

ICD loader properties
  ICD loader Name Khronos OpenCL ICD Loader
  ICD loader Vendor Khronos Group
  ICD loader Version 3.0.6
  ICD loader Profile OpenCL 3.0

Revision history for this message
Oibaf (oibaf) wrote :

@kolota: can you try with Ubuntu 23.10?

Revision history for this message
Your full Name (kolota) wrote :

The error is unchanged with Kubuntu 23.10

Revision history for this message
lorn10 (kle) wrote :

Yeah, this is (or was) not a problem of Ubuntu nor it was a problem of Mesa.

In the end it was a problem of libclc (which is part of LLVM) not supporting newer Radeon hardware (I think anything newer than GCN4).

Whatever, - this problem was resolved when the libclc was updated:
https://github.com/llvm/llvm-project/pull/78884

Ergo, as of the end of January 2024 libclc includes support for Radeon hardware up to the RDNA2 generation.

Revision history for this message
Oibaf (oibaf) wrote :

Let's mark this as a duplicate of bug 1909805.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.