[Bug 2060619] Re: gcc-14 offload support for amd gfx103x and gfx110x gpus is broken
Launchpad Bug Tracker
2060619 at bugs.launchpad.net
Mon Apr 15 01:00:47 UTC 2024
This bug was fixed in the package gcc-14 - 14-20240412-0ubuntu1
---------------
gcc-14 (14-20240412-0ubuntu1) noble; urgency=medium
* Snapshot, taken from the trunk 20240412.
* Apply proposed patch for PR libquadmath/114533 (Simon Chopin).
Closes: #1064426. LP: #2052929.
* Don't build the libstdc++-doc package when the nodoc profile is enabled.
* Clean up some version restrictions on build-dependencies.
* Don't set the _FILE_OFFSET_BITS and _TIME_BITS macros, if the
_DISTRO_EVADE_TIME_BITS macro is defined.
See https://sourceware.org/bugzilla/show_bug.cgi?id=31624.
* Build-depend on amdgcn-tools-18, required for new gcn offload targets.
* Package the new gfx1030, gfx1036, gfx1100 and gfx1103 offload targets.
LP: #2060619.
-- Matthias Klose <doko at ubuntu.com> Fri, 12 Apr 2024 14:30:14 +0200
** Changed in: gcc-14 (Ubuntu)
Status: New => Fix Released
** Bug watch added: Sourceware.org Bugzilla #31624
https://sourceware.org/bugzilla/show_bug.cgi?id=31624
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-14 in Ubuntu.
https://bugs.launchpad.net/bugs/2060619
Title:
gcc-14 offload support for amd gfx103x and gfx110x gpus is broken
Status in gcc-14 package in Ubuntu:
Fix Released
Bug description:
Hi,
for context bug was posted here first:
https://github.com/gcc-mirror/gcc/commit/1bf18629c54adf4893c8db5227a36e1952ee69a3#commitcomment-140648051
gcc Andrew Stubbs author mentions:
"Yes, it looks like the libgomp device-side library is missing. Probably not listed in the packaging script?"
using gcc-14:
gcc-14 --version
gcc-14 (Ubuntu 14-20240330-1ubuntu2) 14.0.1 20240330 (experimental) [master r14-9728-g6fc84f680d0]
using the code posted below as sum.c
testing building with offload support on gfx1036:
gcc-14 -fopenmp -foffload=amdgcn-amdhsa -foffload-
options=-march=gfx1036 -fcf-protection=none sum.c -o sumamd1030.exe
fails with:
ld: error: incompatible mach: /usr/lib/gcc/x86_64-linux-gnu/14/accel/amdgcn-amdhsa/libgomp.a(parallel.o)
collect2: error: ld returned 1 exit status
gcn mkoffload: fatal error: x86_64-linux-gnu-accel-amdgcn-amdhsa-gcc-14 returned 1 exit status
compilation terminated.
lto-wrapper: fatal error: /usr/libexec/gcc/x86_64-linux-gnu/14//accel/amdgcn-amdhsa/mkoffload returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
instead selecting gfx900 works:
gcc-14 -fopenmp -foffload=amdgcn-amdhsa -foffload-options=-march=gfx900 -fcf-protection=none sum.c -o sumamd900.exe
note gfx103x and gfx11xx targets are new to GCC-14..
inspecting files seems the error is due to package
gcc-14-offload-amdgcn_14-20240330-1ubuntu2_amd64.deb
missing libgomp.so files in
\usr\lib\gcc\x86_64-linux-gnu\14\accel\amdgcn-amdhsa\gfx1036 folder
but having this file in gfx9xx folders for ex:
\usr\lib\gcc\x86_64-linux-gnu\14\accel\amdgcn-amdhsa\gfx906 folder
code used:
sum.c:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <omp.h>
int main(int argc, char *argv[]) {
long long int j, largeN;
double sum = 0.0;
clock_t tstart, tend;
int num_dev;
num_dev = omp_get_num_devices();
printf("%d\n", num_dev);
largeN = (long long int) atoll(argv[1]);
printf("Large Number = %lld\n", largeN);
tstart = clock();
#pragma omp parallel for private(j) reduction(+:sum)
for(j=1; j<largeN; j++) {
sum += (double) (1.0/j);
}
tend = clock();
printf("Sum [1, ... , %lld] = %.6f\n", largeN, sum);
printf("\nCompleted in %.2f seconds%45s\n\n", ( (double) (tend - tstart) ) / CLOCKS_PER_SEC, "");
sum = 0.0;
tstart = clock();
#pragma omp target map(to:largeN) map(tofrom:sum)
#pragma omp parallel for simd private(j) reduction(+:sum)
for (j=1; j<largeN; j++) {
sum += (double) (1.0/j);
}
tend = clock();
printf("Sum [1, ... , %lld] = %.6f\n", largeN, sum);
printf("\nCompleted in %.2f seconds%45s\n\n", ( (double) (tend - tstart) ) / CLOCKS_PER_SEC, "");
return(0);
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-14/+bug/2060619/+subscriptions
More information about the foundations-bugs
mailing list