mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 13:58:46 +01:00
metal : log more info on error (#6987)
This commit is contained in:
parent
9c67c2773d
commit
a68a1e7ed0
39
ggml-metal.m
39
ggml-metal.m
@ -2779,6 +2779,45 @@ static enum ggml_status ggml_metal_graph_compute(
|
|||||||
MTLCommandBufferStatus status = [command_buffer status];
|
MTLCommandBufferStatus status = [command_buffer status];
|
||||||
if (status != MTLCommandBufferStatusCompleted) {
|
if (status != MTLCommandBufferStatusCompleted) {
|
||||||
GGML_METAL_LOG_INFO("%s: command buffer %d failed with status %lu\n", __func__, i, status);
|
GGML_METAL_LOG_INFO("%s: command buffer %d failed with status %lu\n", __func__, i, status);
|
||||||
|
if (status == MTLCommandBufferStatusError) {
|
||||||
|
MTLCommandBufferError error_code = [command_buffer error].code;
|
||||||
|
switch (error_code) {
|
||||||
|
case MTLCommandBufferErrorNone:
|
||||||
|
GGML_METAL_LOG_INFO("no error code reported\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorTimeout:
|
||||||
|
GGML_METAL_LOG_INFO("timeout\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorPageFault:
|
||||||
|
GGML_METAL_LOG_INFO("unserviceable page fault\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorOutOfMemory:
|
||||||
|
GGML_METAL_LOG_INFO("out of memory\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorInvalidResource:
|
||||||
|
GGML_METAL_LOG_INFO("invalid reference to resource\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorMemoryless:
|
||||||
|
GGML_METAL_LOG_INFO("GPU ran out of one or more of its internal resources that support memoryless render pass attachments\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorDeviceRemoved:
|
||||||
|
GGML_METAL_LOG_INFO("device removed\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorStackOverflow:
|
||||||
|
GGML_METAL_LOG_INFO("kernel function of tile shader used too many stack frames\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorAccessRevoked:
|
||||||
|
GGML_METAL_LOG_INFO("access to device revoked by system\n");
|
||||||
|
break;
|
||||||
|
case MTLCommandBufferErrorInternal:
|
||||||
|
GGML_METAL_LOG_INFO("internal error\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
GGML_METAL_LOG_INFO("unknown error %lu\n", error_code);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return GGML_STATUS_FAILED;
|
return GGML_STATUS_FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user