External Issue: [Bug]: The GPU kernel example halts

29661, "af-afk", "[Bug]: The GPU kernel example halts", "2026-11-08T15:36:58Z"

Summary of Problem

After installing Chapel on my Debian system, I went to compile the example for the GPU kernel and run it. But running it halts:

/home/user/Documents/knowledge/buffers/buffer-1794151362.chpl:11: error: halt reached - the step argument of the 'by' operator is zero
Stacktrace

halt() at $CHPL_HOME/modules/standard/Errors.chpl:858
halt() at $CHPL_HOME/modules/standard/Errors.chpl:844
boundsCheckHalt() at $CHPL_HOME/modules/standard/HaltWrappers.chpl:118
chpl__init_buffer-1794151362() at /home/user/Documents/knowledge/buffers/buffer-1794151362.chpl:1

Disable full stacktrace by setting 'CHPL_RT_UNWIND=0'
buffer-1794151362: exit 1

Steps to Reproduce

Source Code:

use Random, Math;

const nGpus = here.gpus.size,
      n     = Locales.size*nGpus;

var A: [1..n, 1..n] real;

fillRandom(A);

// use all nodes
coforall (loc, localRowStart) in zip(Locales, 1.. by nGpus) do on loc {
  // and all GPUs within each
  coforall (gpu, row) in zip(here.gpus, localRowStart..) do on gpu {
    var B: [1..n] real = A[row, ..];    // copy a row onto the device
    B = asin(B);                        // compute (kernel launch)
    A[row, ..] = B;                     // copy the row back
  }
}

writeln(A);

Compile command:
chpl example.chpl

Execution command:
./example

Configuration Information

  • Output of chpl --version:
% chpl --version
chpl version 2.10.0
  built with LLVM version 19.1.7
  available LLVM targets: xtensa, m68k, xcore, x86-64, x86, wasm64, wasm32, ve, systemz, sparcel, sparcv9, sparc, riscv64, riscv32, ppc64le, ppc64, ppc32le, ppc32, nvptx64, nvptx, msp430, mips64el, mips64, mipsel, mips, loongarch64, loongarch32, lanai, hexagon, bpfeb, bpfel, bpf, avr, thumbeb, thumb, armeb, arm, amdgcn, r600, aarch64_32, aarch64_be, aarch64, arm64_32, arm64
Copyright 2020-2026 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
% 
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
machine info: Linux mew 6.12.115+deb13.1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.115-2 (2026-11-01) x86_64
CHPL_HOME: /usr/share/chapel/2.10
script location: /usr/share/chapel/2.10/util/chplenv
CHPL_TARGET_PLATFORM: linux64 +
CHPL_TARGET_COMPILER: llvm +
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native +
CHPL_LOCALE_MODEL: flat +
CHPL_COMM: none +
CHPL_TASKS: qthreads +
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: system +
CHPL_TARGET_MEM: jemalloc +
CHPL_ATOMICS: cstdlib +
CHPL_GMP: system +
CHPL_HWLOC: system +
CHPL_RE2: bundled +
CHPL_LLVM: system +
CHPL_AUX_FILESYS: none
  • Back-end compiler and version, e.g. gcc --version or clang --version:
gcc (Debian 14.2.0-19) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • (For Cray systems only) Output of module list: