openCL application gives error after update

Bug #1860042 reported by Timothy Krause
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
libclc (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Timo Aaltonen
Eoan
Fix Released
Undecided
Timo Aaltonen

Bug Description

[Impact]

Compiler hardening flags are getting applied to the shader bitcode, which breaks OpenCL runtime.

Hardening flags haven't changed since -fstack-protector-strong got stripped from the flags by the package in 0.2.0+git20180917-2, but the combination with current driver code breaks runtime again. It's best to drop the hardening flags altogether, as they are fragile.

[Test case]

Install the update, run an opencl app on Radeon

[Regression potential]

Shouldn't be any, only compiler flags get modified.

--

My OpenCL program was working normally until a software update.

The program prints out:

ac_rtld error: !s->is_rx
LLVM failed to upload shader

when clEnqueueNDRangeKernel is called.

I've downloaded the source for mesa and traced the problem to the gallium radeon driver. The first error message is from

mesa-19.2.1/src/amd/common/ac_rtld.c

and the second error message is from

mesa-19.2.1/src/gallium/drivers/radeonsi/si_compute.c

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libllvm9 1:9-2~ubuntu18.04.1
ProcVersionSignature: Ubuntu 4.15.0-74.84-lowlatency 4.15.18
Uname: Linux 4.15.0-74-lowlatency x86_64
ApportVersion: 2.20.9-0ubuntu7.9
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Jan 16 14:35:15 2020
InstallationDate: Installed on 2018-04-28 (628 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: mesa-opencl-icd
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Timothy Krause (tmkrs4482) wrote :
summary: - openCL application gives error
+ openCL application gives error after update
description: updated
description: updated
affects: llvm-toolchain-9 (Ubuntu) → mesa (Ubuntu)
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

could you test with a newer mesa from this ppa

https://launchpad.net/~ubuntu-x-swat/+archive/ubuntu/updates

it's got latest bugfix release of the series, 19.2.8, and it's now pending as a distro update as well

Changed in mesa (Ubuntu):
status: New → Incomplete
Revision history for this message
Timothy Krause (tmkrs4482) wrote : Re: [Bug 1860042] Re: openCL application gives error after update

I've upgraded to Ubuntu 19.10 and used the PPA that you recommended and the
error is still there. I could give you a patch with the changes that I made
to
ac_rtld.c that fixed the problem for my computer.

On Wed, Jan 22, 2020 at 5:35 AM Timo Aaltonen <email address hidden> wrote:

> could you test with a newer mesa from this ppa
>
> https://launchpad.net/~ubuntu-x-swat/+archive/ubuntu/updates
>
> it's got latest bugfix release of the series, 19.2.8, and it's now
> pending as a distro update as well
>
> ** Changed in: mesa (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1860042
>
> Title:
> openCL application gives error after update
>
> Status in mesa package in Ubuntu:
> Incomplete
>
> Bug description:
> My OpenCL program was working normally until a software update.
>
> The program prints out:
>
> ac_rtld error: !s->is_rx
> LLVM failed to upload shader
>
> when clEnqueueNDRangeKernel is called.
>
> I've downloaded the source for mesa and traced the problem to the
> gallium radeon driver. The first error message is from
>
> mesa-19.2.1/src/amd/common/ac_rtld.c
>
> and the second error message is from
>
> mesa-19.2.1/src/gallium/drivers/radeonsi/si_compute.c
>
> ProblemType: Bug
> DistroRelease: Ubuntu 18.04
> Package: libllvm9 1:9-2~ubuntu18.04.1
> ProcVersionSignature: Ubuntu 4.15.0-74.84-lowlatency 4.15.18
> Uname: Linux 4.15.0-74-lowlatency x86_64
> ApportVersion: 2.20.9-0ubuntu7.9
> Architecture: amd64
> CurrentDesktop: ubuntu:GNOME
> Date: Thu Jan 16 14:35:15 2020
> InstallationDate: Installed on 2018-04-28 (628 days ago)
> InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64
> (20180426)
> SourcePackage: mesa-opencl-icd
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/1860042/+subscriptions
>

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

please do, the other bug does mention that mesa master works, but there have been no changes to that file other than a single commit which doesn't look related..

Revision history for this message
Timothy Krause (tmkrs4482) wrote :

I fixed it myself. I'm going to try to get a merge request.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

But someone said on your other bug (1860199) that mesa master works already, so just post your patch here first.

Revision history for this message
Nikolas Hericks (hericks) wrote :

Hi,

looks as I have the same issue:

Jan 27 12:26:44 XXXXXXXX libreoffice-calc.desktop[21996]: ac_rtld error: !s->is_rx
Jan 27 12:26:44 XXXXXXXX libreoffice-calc.desktop[21996]: LLVM failed to upload shader

with mesa-opencl-icd 19.2.1-1ubuntu1~18.04.1

Kind regards,

Nikolas

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

this is caused by the hardening patch in libclc

affects: mesa (Ubuntu) → libclc (Ubuntu)
Changed in libclc (Ubuntu):
status: Incomplete → Triaged
Changed in libclc (Ubuntu Bionic):
assignee: nobody → Timo Aaltonen (tjaalton)
Changed in libclc (Ubuntu Eoan):
assignee: nobody → Timo Aaltonen (tjaalton)
Timo Aaltonen (tjaalton)
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Timothy, or anyone else affected,

Accepted libclc into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libclc/0.2.0+git20190827-1ubuntu0.19.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libclc (Ubuntu Eoan):
status: New → Fix Committed
tags: added: verification-needed verification-needed-eoan
Changed in libclc (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Timothy, or anyone else affected,

Accepted libclc into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libclc/0.2.0+git20190827-1ubuntu0.18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libclc (Ubuntu Eoan):
status: Fix Committed → Confirmed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

don't touch the status..

Changed in libclc (Ubuntu Eoan):
status: Confirmed → Fix Committed
Revision history for this message
Nikolas Hericks (hericks) wrote :

Hi,

I can confirm the fix works for me on Eoan.

Thank you very much!

Nikolas

Changed in libclc (Ubuntu Eoan):
status: Fix Committed → Confirmed
Revision history for this message
Nikolas Hericks (hericks) wrote :

oh just saw your note..

Changed in libclc (Ubuntu Eoan):
status: Confirmed → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

right, the tag needs changing after being verified, and thanks!

tags: added: verification-done-eoan
removed: verification-needed-eoan
Revision history for this message
Timothy Krause (tmkrs4482) wrote :

The eoan-proposed repository didn't work for me. This is what apt-cache says:

mesa-opencl-icd:
  Installed: 19.2.8-0ubuntu0~19.10.1
  Candidate: 19.2.8-0ubuntu0~19.10.1
  Version table:
 *** 19.2.8-0ubuntu0~19.10.1 500
        500 http://ca.archive.ubuntu.com/ubuntu eoan-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status
     19.2.8-0ubuntu0~19.10.1~ppa1 500
        500 http://ppa.launchpad.net/ubuntu-x-swat/updates/ubuntu eoan/main amd64 Packages
     19.2.1-1ubuntu1 500
        500 http://ca.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

wrong package, this is not related to mesa

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

check libclc-amdgcn instead

in any case, this has been verified on eoan already, bionic needs to be verified too

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Since we're working on getting 18.04.4 prepared, I will be conditionally releasing it without full verification.

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

This bug was fixed in the package libclc - 0.2.0+git20190827-1ubuntu0.19.10.1

---------------
libclc (0.2.0+git20190827-1ubuntu0.19.10.1) eoan; urgency=medium

  * hardening.patch: Dropped, breaks opencl runtime. (LP: #1860042)

 -- Timo Aaltonen <email address hidden> Tue, 28 Jan 2020 10:22:43 +0200

Changed in libclc (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for libclc has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package libclc - 0.2.0+git20190827-1ubuntu0.18.04.1

---------------
libclc (0.2.0+git20190827-1ubuntu0.18.04.1) bionic; urgency=medium

  * hardening.patch: Dropped, breaks opencl runtime. (LP: #1860042)

 -- Timo Aaltonen <email address hidden> Tue, 28 Jan 2020 10:22:43 +0200

Changed in libclc (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libclc - 0.2.0+git20190827-4

---------------
libclc (0.2.0+git20190827-4) unstable; urgency=medium

  * use-python3.diff: Updated to fix new issues. (Closes: #950032)

 -- Timo Aaltonen <email address hidden> Wed, 05 Feb 2020 18:58:46 +0200

Changed in libclc (Ubuntu):
status: Triaged → Fix Released
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.