Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: flang-new: OpenMP declare target arrays crash #241

Open
VeeEM opened this issue Jan 9, 2025 · 3 comments
Open

[Issue]: flang-new: OpenMP declare target arrays crash #241

VeeEM opened this issue Jan 9, 2025 · 3 comments
Labels
flang generic Build error, or some other issue not caused by an LLVM bug Under Investigation

Comments

@VeeEM
Copy link

VeeEM commented Jan 9, 2025

Problem Description

I'm seeing unexpected crashes with OpenMP offload code that uses declare target arrays after commit 13b4a9d.

Operating System

SUSE Linux Enterprise Server 15 SP5 (Cray OS on LUMI)

CPU

AMD EPYC 7742 64-Core

GPU

AMD Instinct MI250X

ROCm Version

ROCm 6.2.2

ROCm Component

flang

Steps to Reproduce

I think the program below might reproduce the issue. The program should print "acc 500" but after 13b4a9d it prints:

Queue error - HSA_STATUS_ERROR_MEMORY_FAULT
Display only launched kernel:
Kernel 'omp target in _QQmain @ 11 (__omp_offloading_54bbb604_a0017379__QQmain_l11)'
OFFLOAD ERROR: Memory access fault by GPU 4 (agent 0x35ff90) at virtual address (nil). Reasons: Unknown (0)
Device pointer (nil) does not point into any (current or prior) host-issued allocation (might be a global, stack, or shared location).

Compiler flags: flang-new -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa --offload-arch=gfx90a

program repr1
  integer, dimension(:), allocatable :: xs
  integer :: i, acc
  !$omp declare target (xs)

  allocate(xs(500))
  !$omp target enter data map(alloc:xs)
  xs = 1
  acc = 0
  !$omp target update to(xs)

  !$omp target map(acc)
  do i=1, 500
    acc = acc + xs(i)
  end do
  !$omp end target 
  
  print *, "acc", acc
end program

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

@ppanchad-amd ppanchad-amd added generic Build error, or some other issue not caused by an LLVM bug Under Investigation labels Jan 9, 2025
@ppanchad-amd
Copy link

Hi @VeeEM. Internal ticket has been created to investigate your issue. Thanks!

@tcgu-amd
Copy link

tcgu-amd commented Jan 9, 2025

Hi @VeeEM, thanks for reaching out! Just to clarify, did the program work before 13b4a9d?

@tcgu-amd tcgu-amd added the flang label Jan 9, 2025
@VeeEM
Copy link
Author

VeeEM commented Jan 10, 2025

Yes, the program works before 13b4a9d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang generic Build error, or some other issue not caused by an LLVM bug Under Investigation
Projects
None yet
Development

No branches or pull requests

3 participants