Debugging with CUDA.jl

Does Debugger.jl work with CUDA.jl? I haven’t had any luck and wasn’t sure if I was missing something or it’s not supposed to work. Here’s the simplest case I came up with:

using CUDA
using Debugger
function test_cuda_debug(A,B)
    B .= A
end
A = CUDA.rand(Float32, 16)
B = CUDA.rand(Float32, 16)
test_cuda_debug(A,B)
@run test_cuda_debug(A,B)

gives

signal (4): Illegal instruction
in expression starting at REPL[8]

If this isn’t supported, what debugging workflows have people found are effective?

The illegal instruction is a bug in Julia, and should be filed there (or on the Debugger.jl repo if you can show it’s Debugger related).

Although you can use Debugger.jl to debug the innards of CUDA.jl, you can’t use it to debug actual kernel code. Printf-debugging is your best bet there. There is cuda-gdb, but due to a bug in CUDA we currently don’t emit the necessary debug information to make that a pleasant experience.