gcc-14 offload support for amd gfx103x and gfx110x gpus is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-14 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hi,
for context bug was posted here first:
https:/
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-
using the code posted below as sum.c
testing building with offload support on gfx1036:
gcc-14 -fopenmp -foffload=
fails with:
ld: error: incompatible mach: /usr/lib/
collect2: error: ld returned 1 exit status
gcn mkoffload: fatal error: x86_64-
compilation terminated.
lto-wrapper: fatal error: /usr/libexec/
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
instead selecting gfx900 works:
gcc-14 -fopenmp -foffload=
note gfx103x and gfx11xx targets are new to GCC-14..
inspecting files seems the error is due to package
gcc-14-
missing libgomp.so files in
\usr\lib\
but having this file in gfx9xx folders for ex:
\usr\lib\
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_
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(
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(
return(0);
}
so seems fedora 40 has packaged it right
https:/ /packages. fedoraproject. org/pkgs/ gcc/gcc- offload- nvptx/fedora- 40.html# provides
x86_64- redhat- linux/14/ accel/amdgcn- amdhsa/ gfx1036/
crt0.o .spec nonshared. a
libc.a
libcaf_single.a
libg.a
libgcc.a
libgcov.a
libgfortran.a
libgfortran
libgomp.a
libgomp.spec
libm.a
libssp.a
libssp_