[Bug 1907812] Re: Can't build simple OpenMP offloading programs (needs -no-pie)

Mehdi Chinoune 1907812 at bugs.launchpad.net
Fri Apr 23 06:19:17 UTC 2021


It's getting worse on Ubuntu 21.04

$ gfortran -fopenmp matmul.f90 -o test.x
lto-wrapper: fatal error: could not find accel/amdgcn-amdhsa/mkoffload in /usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/ (consider using ‘-B’)
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

I reported that before but someone has closed it.

$ gfortran -fopenmp -foffload=nvptx-none matmul.f90 -o test.x
/usr/bin/ld: /tmp/ccvGeRgU.crtoffloadtable.o: warning: relocation against `__offload_vars_end' in read-only section `.rodata'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE

$ gfortran -fopenmp -foffload=nvptx-none -no-pie matmul.f90 -o test.x
$ ./test.x
 dim1 = dim2 =            0
 MATMUL Time =    0.00000000    

libgomp: while loading libgomp-plugin-gcn.so.1: libgomp-plugin-gcn.so.1:
cannot open shared object file: No such file or directory

libgomp: Trying to map into device [0xf35dc0..0xf35dc0) object when
[0xf35da0..0xf35da0) is already mapped

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-10 in Ubuntu.
https://bugs.launchpad.net/bugs/1907812

Title:
  Can't build simple OpenMP offloading programs (needs -no-pie)

Status in gcc-10 package in Ubuntu:
  New
Status in gcc-9 package in Ubuntu:
  New

Bug description:
  $cat prod.f90
  program main
    implicit none
    integer, parameter :: sp = selected_real_kind(6,37)
    integer, parameter :: n = 4096
    real(sp), allocatable :: a(:), b(:), c(:), c2(:)
    integer :: i

    allocate( a(n), b(n), c(n) )
    
    c = 0._sp
    call random_number(a)
    call random_number(b)

    !$omp target teams map(to: a, b) map(from: c)
    !$omp distribute parallel do
    do i = 1, n
      c(i) = a(i)*b(i)
    end do
    !$omp end target teams
    
    c2 = a*b
    
    print*, maxval( abs(c2-c) )
    
  end program

  $ gfortran -O3 -flto -fopenmp -foffload=nvptx-none prod.f90 -o test.x
  /usr/bin/ld: /tmp/ccyvMF16.crtoffloadtable.o: warning: relocation against `__offload_vars_end' in read-only section `.rodata'
  /usr/bin/ld: warning: creating DT_TEXTREL in a PIE

  Ubuntu 20.10 x86_64
  Xeon E3-1505m-v6
  Nvidia Quadro M2200

  That doesn't happen on Ubuntu 20.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-10/+bug/1907812/+subscriptions



More information about the foundations-bugs mailing list