OffTarget

Observed issues › cce-acc-init-set-runtime-assert

Appears to behave incorrectlyCrashes or aborts at run time · Fortran · OpenACC · Open

ftn -h acc: !$acc init and !$acc set default_async abort in the runtime ("Incorrect device type set")

Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked

Affected variants

CompilerMI300A 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.0n/an/an/an/an/an/an/a
CCE 19.0.0behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 20.0.2behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.3behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.4behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
NVHPC 25.11n/an/an/an/an/afails another wayfails another way
NVHPC 26.9n/an/an/an/an/acorrectcorrect
GCC 16.2.0fails another wayfails another wayfails another wayfails another wayfails another wayfails another wayn/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

ResultCompiler and GPUMessage
behaves incorrectlyCCE 19.0.0, MI300A unified
CCE 19.0.0, MI300A copy
CCE 19.0.0, MI250X
show
repro: libcrayacc/acc_runtime.c:4171: void _cray_acc_init_device(acc_device_t, int): Assertion `(device_type == CurrentHardware->get_device_type()) && "Incorrect device type set !!!"' failed.
behaves incorrectlyCCE 20.0.2, MI300A unified
CCE 20.0.2, MI300A copy
CCE 20.0.2, MI250X
show
repro: libcrayacc/acc_runtime.c:4368: void _cray_acc_init_device(acc_device_t, int): Assertion `(device_type == CurrentHardware->get_device_type()) && "Incorrect device type set !!!"' failed.
behaves incorrectlyCCE 21.0.3, MI300A unified
CCE 21.0.3, MI300A copy
CCE 21.0.3, MI250X
CCE 21.0.4, MI300A unified
CCE 21.0.4, MI300A copy
CCE 21.0.4, MI250X
show
repro: libcrayacc/acc_runtime.c:4450: void _cray_acc_init_device(acc_device_t, int): Assertion `(device_type == CurrentHardware->get_device_type()) && "Incorrect device type set !!!"' failed.
fails another wayNVHPC 25.11, A100 separate
NVHPC 25.11, A100 managed
show
NVFORTRAN-S-0038-Symbol, acc_get_default_async, has not been explicitly declared (cce-acc-init-set-runtime-assert.f90: 1)
  0 inform,   0 warnings,   1 severes, 0 fatal for t
fails another wayGCC 16.2.0, MI300A unified
GCC 16.2.0, MI300A copy
GCC 16.2.0, MI250X
GCC 16.2.0, MI300X
GCC 16.2.0, MI350X
GCC 16.2.0, A100 separate
show
cce-acc-init-set-runtime-assert.f90:6:9:
    6 |   !$acc init
      |         1
Error: Unclassifiable OpenACC directive at (1)
cce-acc-init-set-runtime-assert.f90:12:9:
   12 |   !$acc set default_async(2)
      |         1
Error: Unclassifiable OpenACC directive at (1)

Reproduce

CCE 19.0.0, MI300A unified

module load cce/19.0.0 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

CCE 20.0.2, MI300A unified

module load cce/20.0.2 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

CCE 21.0.3, MI300A unified

module load cce/21.0.3 craype-accel-amd-gfx942 rocm/7.2.0
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

CCE 21.0.4, MI300A unified

module load cce/21.0.4 craype-accel-amd-gfx942 rocm/7.2.0
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

NVHPC 26.9, A100 separate (runs correctly)

export LD_LIBRARY_PATH=$NVHPC_26_9/compilers/lib
nvfortran -acc=gpu -gpu=cc80 -gpu=mem:separate -O2 repro.f90 -o repro
./repro
Program (29 lines)
! OpenACC 3.4 §2.14.1 (init; with no clause all devices are initialized)
! and §2.14.3 (set default_async). Legal. Expected output: ok 2 then
! ok 2 2. Compile: ftn -h acc -O2. Variants that abort the same way:
! `!$acc set device_num(0)`, `!$acc shutdown device_type(radeon)` (device-
! number assertion); `!$acc init device_type(radeon)` works.
! The catalog's acc34-directive-init, -set and -shutdown programs
! (no clauses) abort on CCE 19, 20 and 21 in both memory modes and on
! MI250X: "_cray_acc_init_device ... Incorrect device type set" and, for
! a plain `!$acc shutdown`, "_cray_acc_shutdown_device ... Shutting down
! incorrect device type" (results/acc_matrix.jsonl).
program t
  use openacc
  implicit none
  integer :: a(8), i
  a = 1
  !$acc init
  !$acc parallel loop copy(a)
  do i = 1, 8
    a(i) = 2
  end do
  print *, 'ok', a(1)
  !$acc set default_async(2)
  !$acc parallel loop copy(a) async
  do i = 1, 8
    a(i) = 2
  end do
  !$acc wait(2)
  print *, 'ok', a(1), acc_get_default_async()
end program t

Source in the repository

Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page

Expected and observed

Observed where it behaves incorrectly

repro: libcrayacc/acc_runtime.c:4171: void _cray_acc_init_device(acc_device_t, int): Assertion `(device_type == CurrentHardware->get_device_type()) && "Incorrect device type set !!!"' failed.

What the specification requires

The specification text this program relies on and the compiler is expected to support.

OpenACC 3.4 §2.14.1

OpenACC 3.4 §2.14.3

Evidence

Same compiler, one change

  • device_type(radeon) added to the init and set directives: CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
    Control program
    program t
      use openacc
      implicit none
      integer :: a(8), i
      a = 1
      !$acc init device_type(radeon)
      !$acc parallel loop copy(a)
      do i = 1, 8
        a(i) = 2
      end do
      print *, 'ok', a(1)
      !$acc set default_async(2) device_type(radeon)
      !$acc parallel loop copy(a) async
      do i = 1, 8
        a(i) = 2
      end do
      !$acc wait(2)
      print *, 'ok', a(1), acc_get_default_async()
    end program t
    

Other compilers run it correctly

NVHPC 26.9