JuliaGPU / JuliaGPU/KernelAbstractions.jl

StackOverflow Error on get_backend(cu(rand(3)))

Open
#366 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
523
Forks
88
Avg merge
1d 11h
Merged PRs (30d)
25

Description

Hi! I just tried to get the backend of a CuArray as follows, which causes a stack overflow. Am I using it correctly?

using CUDA
using KernelAbstractions
get_backend(cu(rand(3)))

ERROR: StackOverflowError:
Stacktrace:
 [1] get_backend(A::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}) (repeats 79984 times)
   @ KernelAbstractions ~/.julia/packages/KernelAbstractions/I7qXs/src/KernelAbstractions.jl:355

Julia 1.8.0
CUDA 4.0.1
KernelAbstractions 0.9.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/KernelAbstractions.jl:355 and reproduce get_backend(cu(rand(3))) using the Julia, CUDA, and KernelAbstractions versions reported in the issue. Trace why get_backend repeats until StackOverflowError, then verify that the call returns the expected backend without recursion.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.