Observed issues › fresh/cce-list-directed-print-in-target-copy-crash
ftn: a list-directed PRINT in a target region aborts the run in copy mode
Legality: contested. An independent adjudicating reading finds the result not required: Both readings agree the program is conforming: a print statement is base-language code and nothing forbids it in a target region. How this is checked
Affected variants
| Compiler | MI300A gfx942 unified memory (XNACK 1) | MI300A gfx942 copy (XNACK 0) | MI250X gfx90a copy (XNACK 0) | MI300X gfx942 copy (XNACK 0) | MI350X gfx950 copy (XNACK 0) | A100 sm_80 separate memory | A100 sm_80 managed memory |
|---|---|---|---|---|---|---|---|
| AFAR 24.3.0 | correct | correct | correct | correct | correct | n/a | n/a |
| CCE 19.0.0 | correct | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | n/a | n/a |
| CCE 20.0.2 | correct | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.3 | correct | correct | correct | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.4 | correct | correct | correct | unknown not run | unknown not run | n/a | n/a |
| NVHPC 25.11 | n/a | n/a | n/a | n/a | n/a | correct | correct |
| NVHPC 26.9 | n/a | n/a | n/a | n/a | n/a | correct | correct |
| GCC 16.2.0 | correct | correct | correct | correct | correct | correct | n/a |
"behaves incorrectly" / "not supported": this issue, confirmed in up to four environments (another build directory, another node, a repeat). "fails another way": a different failure, not counted as this issue. "unknown": not run there, or the runs disagree.
Messages
| Result | Compiler and GPU | Message |
|---|---|---|
| behaves incorrectly | CCE 19.0.0, MI300A copy | showMemory access fault by GPU node-6 (Agent handle: 0x4c7c50) on address 0x154f25c2a000. Reason: Unknown. |
| behaves incorrectly | CCE 19.0.0, MI250X | showMemory access fault by GPU node-7 (Agent handle: 0x4bf200) on address 0x15543ae14000. Reason: Unknown. Failed to fetch queues snapshot. GPU core dump failed |
| behaves incorrectly | CCE 20.0.2, MI300A copy | showMemory access fault by GPU node-7 (Agent handle: 0x4cd0e0) on address 0x154f35a2a000. Reason: Unknown. |
| behaves incorrectly | CCE 20.0.2, MI250X | showMemory access fault by GPU node-11 (Agent handle: 0x4c5510) on address 0x15543ae14000. Reason: Unknown. |
Reproduce
CCE 19.0.0, MI300A copy
module load cce/19.0.0 craype-accel-amd-gfx942 rocm/6.4.3 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=0 OMP_TARGET_OFFLOAD=mandatory ./repro
CCE 20.0.2, MI300A copy
module load cce/20.0.2 craype-accel-amd-gfx942 rocm/6.4.3 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=0 OMP_TARGET_OFFLOAD=mandatory ./repro
AFAR 24.3.0, MI300A unified (runs correctly)
$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (35 lines)
! # Finding (from the data/bench/fresh draft fresh-022): CCE 19/20 abort on a list-directed ! PRINT in a target region in copy mode ! ! - source: data/bench/fresh/fresh-022.f90 (llvm-project issue 166338, the reporter's program unchanged) ! - compilers: CCE 19.0.0 and 20.0.2 ftn, -fopenmp -O2, OMP_TARGET_OFFLOAD=mandatory; MI300A (gfx942) ! at HSA_XNACK=0 and MI250X (gfx90a, Tioga) at HSA_XNACK=0 ! - expected: "Hello, world!" from the device. PRINT is a base-language statement; OpenMP 5.2 places ! no restriction on I/O statements in a target region (the restrictions on structured blocks, ! §4.3 p.76-77, concern branches into and out of the block), and an implementation is compliant ! only if it "compiles and executes all other conforming programs" (§1.6 p.34 l.22-24). HPE ! documents the case: "Fortran PRINT ! statements are supported, with limitations, when called from OpenMP offload regions compiled for ! AMD GPU targets. The current implementation supports PRINT statements with a single scalar value ! of type character, integer, real, or complex" (intro_openmp(7), CCE 19.0.0 and 20.0.2, ! "Printing from GPU kernels"; data/index/claims/) ! - actual: CCE 19 and 20 at HSA_XNACK=0: "Memory access fault by GPU node-4 ... Reason: Unknown", ! SIGABRT, nothing printed (MI300A three runs each; MI250X). At HSA_XNACK=1 correct. The same with ! `print *, 42` (data/reports/fresh-drafts/d022-list-int.f90) and with two list-directed PRINTs ! (d022-two-lists.f90) ! - control (same compiler): the formatted `print '(a)', "Hello, world!"` ! (data/reports/fresh-drafts/d022-fmt-literal.f90) prints the line on CCE 19/20 at XNACK 0 and 1. ! With a mapped scalar written in the same region the list-directed PRINT also works ! (d022-map-only.f90, d022-list-literal-dev.f90): the abort needs a region without other data ! - other families: AFAR, CCE 21.0.3 and NVHPC 25.11/26.9 (A100, separate and managed memory) print ! the line ! - legality: legal by reading (no OpenMP construct but target; no data) ! - evidence: results/fresh-drafts/tuo*-*.jsonl, tioga/tioga-a.jsonl, wingtip/nv.jsonl (runs of the review); ! the data/bench/fresh ground truth (data/bench/fresh/outcomes.csv: cce19/cce20 ! copy crash on gfx942 and gfx90a) program reproducer implicit none !$omp target print *, "Hello, world!" !$omp end target end program reproducer
Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page
Expected and observed
Expected
Hello, world!
Observed where it behaves incorrectly
Memory access fault by GPU node-6 (Agent handle: 0x4c7c50) on address 0x154f25c2a000. Reason: Unknown.
What the specification requires
The specification text this program relies on and the compiler is expected to support.
OpenMP 5.2 §4.3 p.76-77
OpenMP 5.2 §1.6 p.34 l.22-24
compiles and executes all other conforming programs
Evidence
Same compiler, one change
- a formatted PRINT, print '(a)', instead of list-directed print *: AFAR 24.3.0: correct; CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
Control program
program reproducer implicit none !$omp target print '(a)', "Hello, world!" !$omp end target end program reproducer
Other compilers run it correctly
AFAR 24.3.0, NVHPC 25.11, NVHPC 26.9, GCC 16.2.0