Skip to content

Simple throwing kernel hangs #433

Description

@tgymnich

This simple kernel will cause a hang leading to 100% GPU usage and eventually taking down the WindowServer. A similar Metal/C++ kernel runs just fine. The generated IR is also mostly identical.

Another interesting observation is that one can save the WindowServer from its death spiral by running the good C++ kernel. This leads me to belief that the problem is most likely not in the generated IR but in the way we handle kernel launches.

using Metal

function kernel()
    throw(nothing)
    return nothing
end

Metal.@sync @metal threads=8 kernel()
void gpu_report_exception() {
    return;
}

void gpu_signal_exception() {
    return;
}

kernel void add_arrays()
{
    gpu_report_exception();
    gpu_signal_exception();

    __builtin_trap();
    __builtin_unreachable();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kernelsThings about kernels and how they are compiled.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions