libclc-amdgcn missing files for current AMD APUs

Bug #1909805 reported by Tessa
54
This bug affects 10 people
Affects Status Importance Assigned to Milestone
LLVM
Unknown
Unknown
libclc (Ubuntu)
Invalid
Undecided
Unassigned
llvm-toolchain-14 (Ubuntu)
Confirmed
Undecided
Unassigned
llvm-toolchain-15 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm finding that the libclc support for current AMD APUs is missing, at least for Ryzen 4000 series laptop APUs. when running something like `hashcat -b --force`, you get the following:

clBuildProgram(): CL_BUILD_PROGRAM_FAILURE

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

* Device #1: Kernel /usr/share/hashcat/OpenCL/shared.cl build failed.

Looking at the package, there's up to gfx906*, so if there's upstream support for these APUs, it'd be great to get the support packaged in. I'm filing this in the hope we can get this sorted out pre-21.04.

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: libclc-amdgcn 0.2.0+git20190827-7
ProcVersionSignature: Ubuntu 5.8.0-33.36-generic 5.8.17
Uname: Linux 5.8.0-33-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu50.3
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: X-Cinnamon
Date: Fri Jan 1 04:22:24 2021
PackageArchitecture: all
SourcePackage: libclc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tessa (unit3) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libclc (Ubuntu):
status: New → Confirmed
Revision history for this message
Nicolás Abel Carbone (nicocarbone) wrote :

Same problem with a AMD 5500XT GPU.

'/usr/lib/clc/gfx1012-amdgcn-mesa-mesa3d.bc': No such file or directory

Revision history for this message
Ole Jon Bjørkum (olejonbj) wrote :

Same problem too with Radeon RX 5500 XT. It worked on my Radeon RX 570 (AMD X570 + Ryzen 3950X). Using the generic ICD and Mesa OpenCL doesn't work.

The easy fix that also gives better results on all benchmarks I've done for Vulkan and OpenGL is installing the latest AMDGPU Pro driver (version 21.20) from AMD.com. Remember to specify:

--opencl=rocr

It's Open Source as most AMD projects. https://github.com/RadeonOpenCompute/ROCm

So NVIDIA users can use most of AMD's stuff because of being FOSS, like the below mentioned FidelityFX, is Open Source and appears for NVIDIA users too in the growing number of games supporting it. NVIDIA however contribute little back...

PS: Previously it was --opencl=PAL but that is deprecated. The installation docs and script help are updated good and now finally tells what legacy is (older than Vega 10). Using --help on the installation script tells what you need. Basically just that you specify (IDK what it does if you don't specify an OpenCL type but you can check with --dry-run and see if it installs packages with "rocr", the new, or "orca", the old. If you use the pro installation script, it is the same as specifying --pro on the all-free unless pro is specified.

Adding legacy OpenCL as well is NO point, as shown as an example in the docs, only if you switch between this and older than Vega 10 cards, as that legacy loader doesn't work alone, but doesn't matter if it's installed, however say Geekbench will complain about a lacking library (.so). Legacy for older than Vega 10 AMD Support told me before they added it to the docs.

Supports Ubuntu 20.04.2 and Ubuntu 18.04.5. Made the mistake of installing the previous that said Ubuntu 20.04.1 while having 20.04.2, as I supposed it wouldn't matter, as I've never had problems before. However, didn't work. Then of course like days later they had released one with "initial support" (because 1 known issue but rare use case), then soon after the current with a fix for that. As soon as installed, as it uses DKMS, I'm sure say when 20.04.3 comes it'll just work. Driver uses a local apt repo so must be manually updated (which is good if you're very satisfied with the one you've got now).

Keep in mind apparently there will be a new driver with some good updates to FidelityFX etc, although that already works in the 21.10 driver (Shadow of The Tomb Raider for example).

Revision history for this message
Oibaf (oibaf) wrote :

Moved from libclc to llvm-toolchain-14, since the former was removed from kinetic and the latter now provides libclc.

Changed in libclc (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Yann Droneaud (ydroneaud) wrote :

Running clinfo, I'm getting this error too:

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

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in llvm-toolchain-14 (Ubuntu):
status: New → Confirmed
Revision history for this message
Yann Droneaud (ydroneaud) wrote :
Revision history for this message
Oibaf (oibaf) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in llvm-toolchain-15 (Ubuntu):
status: New → Confirmed
Revision history for this message
lorn10 (kle) wrote :

For the sake of completeness I will add also here.

This problem is most likely resolved because the underlying libclc was finally updated. (It took quite while.)

More information can be found here:
https://github.com/llvm/llvm-project/pull/78884

So this was not a problem of Ubuntu nor it was a problem of Mesa. In the end it was a problem of libclc not supporting newer Radeon hardware (most likely anything newer than GCN4).

Revision history for this message
lorn10 (kle) wrote :

A further addition.

As already told, this is / will be fixed for the (upcoming) LLVM 18 version.

However, all previous LLVM releases are unfortunately still affected. So it would probably make sense to include that quite important libclc update into the Ubuntu LLVM packages down to LLVM 15 or 14.

Where can be such a "update request" placed? Probably this has to be done via a bug report which would be then migrated into a "feature request" or "wishlist". Will look into that when I fin the time.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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