Your message dated Wed, 19 Oct 2022 08:37:50 +0200
with message-id <6f9392d0-7292-281a-f485-732f971c7...@debian.org>
and subject line fixed in nvptx-tools update
has caused the Debian Bug report #1021660,
regarding gcc-12-offload-nvptx: offloading to nvidia via nvptx fails with cuda
version 11 (default in sid)
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
1021660: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021660
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-12-offload-nvptx
Version: 12.2.0-5
Severity: grave
Justification: renders package unusable for nvidia
Dear Maintainer,
the nvptx plugin for gcc-12 currently available for sid mandates a
cuda level sm_30, which is no longer available in cuda 11 (the one
now in sid). This means that even a trivial example code like
#include <omp.h>
#include <stdio.h>
int main(int argc, char **argv){
#pragma omp target parallel
{
int i, j;
i = omp_get_thread_num();
j = omp_get_num_threads();
printf("Hello world! I am thread %d out of %d\n", i, j);
}
}
fails to compile with
capitanata:~/test$ gcc-12 -fopenmp test_openmp_2.c
ptxas fatal : Value 'sm_30' is not defined for option 'gpu-name'
nvptx-as: ptxas returned 255 exit status
mkoffload: fatal error: x86_64-linux-gnu-accel-nvptx-none-gcc-12 returned 1
exit status
compilation terminated.
lto-wrapper: fatal error:
/usr/lib/gcc/x86_64-linux-gnu/12//accel/nvptx-none/mkoffload returned 1 exit
status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
even trying to set a specific target gpu arch does not seem to work, e.g.
gmulas@capitanata:~/test$ gcc-12 -fopenmp -foffload-options="-misa=sm_35"
test_openmp_2.c
ptxas fatal : Value 'sm_30' is not defined for option 'gpu-name'
nvptx-as: ptxas returned 255 exit status
mkoffload: fatal error: x86_64-linux-gnu-accel-nvptx-none-gcc-12 returned 1
exit status
compilation terminated.
lto-wrapper: fatal error:
/usr/lib/gcc/x86_64-linux-gnu/12//accel/nvptx-none/mkoffload returned 1 exit
status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
On the other hand, gcc-11 appears to have sm_35 as default, meaning it works,
both with and without the -misa option:
capitanata:~/test$ gcc-11 -fopenmp -foffload="-misa=sm_35" test_openmp_2.c
/usr/bin/ld: /tmp/user/1000/ccY5a4YE.crtoffloadtable.o: warning: relocation
against `__offload_vars_end' in read-only section `.rodata'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
capitanata:~/test$ gcc-11 -fopenmp test_openmp_2.c
/usr/bin/ld: /tmp/user/1000/ccHibGBc.crtoffloadtable.o: warning: relocation
against `__offload_vars_end' in read-only section `.rodata'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
and the resulting code runs:
capitanata:~/test$ ./a.out
Hello world! I am thread 4 out of 8
Hello world! I am thread 1 out of 8
Hello world! I am thread 6 out of 8
Hello world! I am thread 7 out of 8
Hello world! I am thread 0 out of 8
Hello world! I am thread 5 out of 8
Hello world! I am thread 2 out of 8
Hello world! I am thread 3 out of 8
Would it be possible to change the default -misa of gcc 12 to sm_35,
to enable gpu offloading to nvidia to work with gcc-12? And/or, is there
some undocumented, or poorly documented, way to actually specify on the
command line the requested cuda level architecture so that it works with
cuda 11 libraries?
Thanks in advance
Best regards
Giacomo Mulas
-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (401, 'unstable'), (10, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.19.0-2-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
TAINT_UNSIGNED_MODULE
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages gcc-12-offload-nvptx depends on:
ii gcc-12 12.2.0-5
ii gcc-12-base 12.2.0-5
ii libc6 2.35-3
ii libc6-dev 2.35-3
ii libgmp10 2:6.2.1+dfsg1-1.1
ii libgomp-plugin-nvptx1 12.2.0-5
ii libmpc3 1.2.1-2
ii libmpfr6 4.1.0-3
ii libzstd1 1.5.2+dfsg-1
ii nvptx-tools 0.20180301-1
ii zlib1g 1:1.2.11.dfsg-4.1
gcc-12-offload-nvptx recommends no packages.
gcc-12-offload-nvptx suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Version: 0.20220610-1
fixed in nvptx-tools update
--- End Message ---