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

**URL:** <https://chapel.discourse.group/t/external-issue-bug-the-gpu-kernel-example-halts/52450>\
**Category:** Issues\
**Created:** [November 8, 2026, 3:38pm UTC](https://chapel.discourse.group/t/external-issue-bug-the-gpu-kernel-example-halts/52450 "2026-11-08T15:38:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chapel\_Test\_User](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@Chapel\_Test\_User](https://chapel.discourse.group/u/Chapel_Test_User)\
**Post date:** [November 8, 2026, 3:38pm UTC](https://chapel.discourse.group/t/external-issue-bug-the-gpu-kernel-example-halts/52450/1 "2026-11-08T15:38:36Z")

</div>

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

> <https://github.com/chapel-lang/chapel/issues/29661>
>
> \### Summary of Problem
> 
> After installing Chapel on my Debian system, I went to c…ompile 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:\*\*
> 
> \`\`\`chapel
> 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\`:

### 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:

```Chapel
/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:**

```chapel
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`:

```Chapel
% 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`:

```Chapel
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`:

```Chapel
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`:
