Skip to content

Conversation

@lubosz
Copy link

@lubosz lubosz commented Nov 5, 2025

This patch enables C++ exception handling for queue submission in the Vulkan backend.

Currently the Vulkan.hpp API produces C++ exceptions when other results than VK_SUCCESS are returned.
Since they do not occur in a try/catch block, the backend causes aborts / crashes in these cases.

This patch catches Vulkan exceptions (vk::SystemError) in ggml_vk_compute_forward, where only thevk::DeviceLostError is handled as fatal error and others are only printed.

It enables applications to exit gracefully by correctly returning GGML_STATUS_FAILED in ggml_backend_vk_graph_compute instead of aborting.

Don't crash when Vulkan exceptions occur during queue submission in
graph_compute.

Exit gracefully by returning GGML_STATUS_FAILED.

Give up in case of vk::DeviceLostError, try to continue on other errors.
@gianni-cor gianni-cor merged commit 0cf1ef7 into tetherto:temp-latest-finetuning Nov 5, 2025
36 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants